diff --git a/src/en/questionablecontent/build.gradle b/src/en/questionablecontent/build.gradle new file mode 100644 index 000000000..a84dc15dd --- /dev/null +++ b/src/en/questionablecontent/build.gradle @@ -0,0 +1,18 @@ +apply plugin: 'com.android.application' +apply plugin: 'kotlin-android' + +ext { + appName = 'Tachiyomi: Questionable Content' + pkgNameSuffix = 'en.questionablecontent' + extClass = '.QuestionableContent' + extVersionCode = 1 + libVersion = '1.2' +} + +dependencies { + compileOnly project(':duktape-stub') + compileOnly 'com.google.code.gson:gson:2.8.2' + compileOnly 'com.github.salomonbrys.kotson:kotson:2.5.0' +} + +apply from: "$rootDir/common.gradle" diff --git a/src/en/questionablecontent/res/mipmap-hdpi/ic_launcher.png b/src/en/questionablecontent/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 000000000..9b1092b74 Binary files /dev/null and b/src/en/questionablecontent/res/mipmap-hdpi/ic_launcher.png differ diff --git a/src/en/questionablecontent/res/mipmap-mdpi/ic_launcher.png b/src/en/questionablecontent/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 000000000..8a9f6c552 Binary files /dev/null and b/src/en/questionablecontent/res/mipmap-mdpi/ic_launcher.png differ diff --git a/src/en/questionablecontent/res/mipmap-xhdpi/ic_launcher.png b/src/en/questionablecontent/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 000000000..14ccdbc46 Binary files /dev/null and b/src/en/questionablecontent/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/src/en/questionablecontent/res/mipmap-xxhdpi/ic_launcher.png b/src/en/questionablecontent/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 000000000..0df0852f5 Binary files /dev/null and b/src/en/questionablecontent/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/src/en/questionablecontent/res/mipmap-xxxhdpi/ic_launcher.png b/src/en/questionablecontent/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 000000000..2d0c17cdb Binary files /dev/null and b/src/en/questionablecontent/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/src/en/questionablecontent/res/web_hi_res_512.png b/src/en/questionablecontent/res/web_hi_res_512.png new file mode 100644 index 000000000..a48a6ab5b Binary files /dev/null and b/src/en/questionablecontent/res/web_hi_res_512.png differ diff --git a/src/en/questionablecontent/src/eu/kanade/tachiyomi/extension/en/questionablecontent/QuestionableContent.kt b/src/en/questionablecontent/src/eu/kanade/tachiyomi/extension/en/questionablecontent/QuestionableContent.kt new file mode 100644 index 000000000..323c06303 --- /dev/null +++ b/src/en/questionablecontent/src/eu/kanade/tachiyomi/extension/en/questionablecontent/QuestionableContent.kt @@ -0,0 +1,86 @@ +package eu.kanade.tachiyomi.extension.en.questionablecontent + +import eu.kanade.tachiyomi.source.model.* +import eu.kanade.tachiyomi.source.online.ParsedHttpSource +import okhttp3.Request +import org.jsoup.nodes.Document +import org.jsoup.nodes.Element +import rx.Observable + +class QuestionableContent : ParsedHttpSource() { + override val name = "Questionable Content" + + override val versionId = 1 + + override val baseUrl = "https://www.questionablecontent.net" + + override val lang = "en" + + override val supportsLatest = false + + override fun fetchPopularManga(page: Int): Observable { + val manga = SManga.create() + manga.title = "Questionable Content" + manga.artist = "Jeph Jacques" + manga.author = "Jeph Jacques" + manga.status = SManga.ONGOING + manga.url = "/archive.php" + manga.description = "An internet comic strip about romance and robots" + manga.thumbnail_url = "https://i.ibb.co/ZVL9ncS/qc-teh.png" + return Observable.just(MangasPage(arrayListOf(manga), false)) + } + + override fun fetchSearchManga(page: Int, query: String, filters: FilterList) = Observable.just(MangasPage(arrayListOf(), false)) + + override fun fetchMangaDetails(manga: SManga): Observable { + return Observable.just(manga) + } + + override fun chapterListSelector() = """div#container a[href^="view.php?comic="]""" + + override fun chapterFromElement(element: Element): SChapter { + val chapter = SChapter.create() + val urlregex = """view\.php\?comic=(.*)""".toRegex() + val number = urlregex.find(element.attr("href"))!!.groupValues[1] + chapter.chapter_number = number.toFloat() + chapter.name = element.text() + return chapter + } + + override fun fetchPageList(chapter: SChapter): Observable> { + val pages = mutableListOf() + pages.add(Page(0, "", "$baseUrl/comics/${chapter.chapter_number.toInt()}.png")) + return Observable.just(pages) + } + + override fun pageListParse(document: Document): List = throw Exception("Not used") + + override fun imageUrlParse(document: Document) = throw Exception("Not used") + + override fun popularMangaSelector(): String = throw Exception("Not used") + + override fun searchMangaFromElement(element: Element): SManga = throw Exception("Not used") + + override fun searchMangaNextPageSelector(): String? = throw Exception("Not used") + + override fun searchMangaSelector(): String = throw Exception("Not used") + + override fun popularMangaRequest(page: Int): Request = throw Exception("Not used") + + override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request = throw Exception("Not used") + + override fun popularMangaNextPageSelector(): String? = throw Exception("Not used") + + override fun popularMangaFromElement(element: Element): SManga = throw Exception("Not used") + + override fun mangaDetailsParse(document: Document): SManga = throw Exception("Not used") + + override fun latestUpdatesNextPageSelector(): String? = throw Exception("Not used") + + override fun latestUpdatesFromElement(element: Element): SManga = throw Exception("Not used") + + override fun latestUpdatesRequest(page: Int): Request = throw Exception("Not used") + + override fun latestUpdatesSelector(): String = throw Exception("Not used") + +}