diff --git a/src/all/ninehentai/build.gradle b/src/all/ninehentai/build.gradle index fb22dcaa5..70aaeb3e2 100644 --- a/src/all/ninehentai/build.gradle +++ b/src/all/ninehentai/build.gradle @@ -5,7 +5,7 @@ ext { appName = 'Tachiyomi: NineHentai' pkgNameSuffix = 'all.ninehentai' extClass = '.NineHentai' - extVersionCode = 1 + extVersionCode = 2 libVersion = '1.2' } dependencies { diff --git a/src/all/ninehentai/src/eu/kanade/tachiyomi/extension/all/ninehentai/NineHentai.kt b/src/all/ninehentai/src/eu/kanade/tachiyomi/extension/all/ninehentai/NineHentai.kt index f0327ba88..9d7ae7383 100644 --- a/src/all/ninehentai/src/eu/kanade/tachiyomi/extension/all/ninehentai/NineHentai.kt +++ b/src/all/ninehentai/src/eu/kanade/tachiyomi/extension/all/ninehentai/NineHentai.kt @@ -17,8 +17,10 @@ import rx.Observable import java.net.URLEncoder import java.util.* -open class NineHentai() : ParsedHttpSource() { +open class NineHentai : ParsedHttpSource() { + final override val baseUrl = "https://9hentai.com" + override val name = "NineHentai" override val lang = "en" @@ -46,7 +48,7 @@ open class NineHentai() : ParsedHttpSource() { override fun popularMangaParse(response: Response): MangasPage { val list = getMangaList(response) - return MangasPage(list, false) + return MangasPage(list, list.isNotEmpty()) } override fun fetchLatestUpdates(page: Int): Observable { @@ -164,18 +166,7 @@ open class NineHentai() : ParsedHttpSource() { private fun buildRequestBody(searchText: String = "", page: Int = 0, sort: Int = 0): RequestBody { //in the future switch this to dtos and actually build the json. This is just a work around for //initial release, then you can have actual tag searching etc - var json = """{"search":{"text":"","page":0,"sort":0,"pages":{"range":[0,2000]},"tag":{"text":"","type":1,"tags":[],"items":{"included":[],"excluded":[]}}}}""" - if (searchText.isNotEmpty()) { - val encodedSearch = URLEncoder.encode(searchText, "UTF-8") - json = json.replaceFirst(""""text":""""", """"text":"$encodedSearch"""") - } - if (page > 0) { - json = json.replaceFirst(""""page":0""", """"page":$page""") - } - if (sort > 0) { - json = json.replaceFirst(""""sort":0""", """"sort":$sort""") - - } + val json = """{"search":{"text":"${URLEncoder.encode(searchText, "UTF-8")}","page":$page,"sort":$sort,"pages":{"range":[0,2000]},"tag":{"text":"","type":1,"tags":[],"items":{"included":[],"excluded":[]}}}}""" return RequestBody.create(MEDIA_TYPE, json) } diff --git a/src/ru/henchan/build.gradle b/src/ru/henchan/build.gradle index 62df83da0..f19ee67d1 100644 --- a/src/ru/henchan/build.gradle +++ b/src/ru/henchan/build.gradle @@ -5,7 +5,7 @@ ext { appName = 'Tachiyomi: Henchan' pkgNameSuffix = 'ru.henchan' extClass = '.Henchan' - extVersionCode = 3 + extVersionCode = 4 libVersion = '1.2' } diff --git a/src/ru/henchan/src/eu/kanade/tachiyomi/extension/ru/henchan/Henchan.kt b/src/ru/henchan/src/eu/kanade/tachiyomi/extension/ru/henchan/Henchan.kt index cd70c834d..09d610ba0 100644 --- a/src/ru/henchan/src/eu/kanade/tachiyomi/extension/ru/henchan/Henchan.kt +++ b/src/ru/henchan/src/eu/kanade/tachiyomi/extension/ru/henchan/Henchan.kt @@ -76,11 +76,11 @@ class Henchan : ParsedHttpSource() { override fun searchMangaFromElement(element: Element): SManga = popularMangaFromElement(element) - override fun popularMangaNextPageSelector() = "#pagination > a:nth-child(2)" + override fun popularMangaNextPageSelector() = "#pagination > a:contains(Вперед)" override fun latestUpdatesNextPageSelector() = popularMangaNextPageSelector() - override fun searchMangaNextPageSelector() = ".navigation a#nextlink" + override fun searchMangaNextPageSelector() = "" override fun mangaDetailsParse(document: Document): SManga {