Komikindoid fix (#8157)

* Update KomikIndoID.kt

* Update build.gradle
This commit is contained in:
HaruSasaki 2021-07-17 20:23:52 +07:00 committed by GitHub
parent acf457c12e
commit 1f96d41169
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 58 deletions

View File

@ -5,7 +5,7 @@ ext {
extName = 'KomikIndoID' extName = 'KomikIndoID'
pkgNameSuffix = 'id.komikindoid' pkgNameSuffix = 'id.komikindoid'
extClass = '.KomikIndoID' extClass = '.KomikIndoID'
extVersionCode = 2 extVersionCode = 3
libVersion = '1.2' libVersion = '1.2'
} }

View File

@ -180,7 +180,7 @@ class KomikIndoID : ParsedHttpSource() {
override fun pageListParse(document: Document): List<Page> { override fun pageListParse(document: Document): List<Page> {
val pages = mutableListOf<Page>() val pages = mutableListOf<Page>()
var i = 0 var i = 0
document.select("div.imgch-auh img").forEach { element -> document.select("div.imgch img").forEach { element ->
val url = element.attr("src") val url = element.attr("src")
i++ i++
if (url.isNotEmpty()) { if (url.isNotEmpty()) {
@ -190,23 +190,7 @@ class KomikIndoID : ParsedHttpSource() {
return pages return pages
} }
override fun imageUrlParse(document: Document) = "" override fun imageUrlParse(document: Document): String = throw UnsupportedOperationException("Not Used")
override fun imageRequest(page: Page): Request {
if (page.imageUrl!!.contains("i2.wp.com")) {
val headers = Headers.Builder()
headers.apply {
add("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3")
}
return GET(page.imageUrl!!, headers.build())
} else {
val imgHeader = Headers.Builder().apply {
add("User-Agent", "Mozilla/5.0 (Linux; U; Android 4.1.1; en-gb; Build/KLP) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Safari/534.30")
add("Referer", baseUrl)
}.build()
return GET(page.imageUrl!!, imgHeader)
}
}
private class AuthorFilter : Filter.Text("Author") private class AuthorFilter : Filter.Text("Author")
@ -259,64 +243,32 @@ class KomikIndoID : ParsedHttpSource() {
) )
private fun getGenreList() = listOf( private fun getGenreList() = listOf(
Genre("4-Koma", "4-koma"),
Genre("4-Koma. Comedy", "4-koma-comedy"),
Genre("Action", "action"), Genre("Action", "action"),
Genre("Action. Adventure", "action-adventure"),
Genre("Adult", "adult"),
Genre("Adventure", "adventure"), Genre("Adventure", "adventure"),
Genre("Comedy", "comedy"), Genre("Comedy", "comedy"),
Genre("Cooking", "cooking"), Genre("Crime", "crime"),
Genre("Demons", "demons"),
Genre("Doujinshi", "doujinshi"),
Genre("Drama", "drama"), Genre("Drama", "drama"),
Genre("Ecchi", "ecchi"),
Genre("Echi", "echi"),
Genre("Fantasy", "fantasy"), Genre("Fantasy", "fantasy"),
Genre("Game", "game"), Genre("Girls Love", "girls-love"),
Genre("Gender Bender", "gender-bender"),
Genre("Gore", "gore"),
Genre("Harem", "harem"), Genre("Harem", "harem"),
Genre("Historical", "historical"), Genre("Historical", "historical"),
Genre("Horror", "horror"), Genre("Horror", "horror"),
Genre("Isekai", "isekai"), Genre("Isekai", "isekai"),
Genre("Josei", "josei"), Genre("Magical Girls", "magical-girls"),
Genre("Magic", "magic"),
Genre("Manga", "manga"),
Genre("Manhua", "manhua"),
Genre("Manhwa", "manhwa"),
Genre("Martial Arts", "martial-arts"),
Genre("Mature", "mature"),
Genre("Mecha", "mecha"), Genre("Mecha", "mecha"),
Genre("Medical", "medical"), Genre("Medical", "medical"),
Genre("Military", "military"), Genre("Philosophical", "philosophical"),
Genre("Music", "music"),
Genre("Mystery", "mystery"),
Genre("One Shot", "one-shot"),
Genre("Oneshot", "oneshot"),
Genre("Parody", "parody"),
Genre("Police", "police"),
Genre("Psychological", "psychological"), Genre("Psychological", "psychological"),
Genre("Romance", "romance"), Genre("Romance", "romance"),
Genre("Samurai", "samurai"), Genre("Sci-Fi", "sci-fi"),
Genre("School", "school"),
Genre("School Life", "school-life"),
Genre("Sci-fi", "sci-fi"),
Genre("Seinen", "seinen"),
Genre("Shoujo", "shoujo"),
Genre("Shoujo Ai", "shoujo-ai"), Genre("Shoujo Ai", "shoujo-ai"),
Genre("Shounen", "shounen"),
Genre("Shounen Ai", "shounen-ai"), Genre("Shounen Ai", "shounen-ai"),
Genre("Slice of Life", "slice-of-life"), Genre("Slice of Life", "slice-of-life"),
Genre("Smut", "smut"),
Genre("Sports", "sports"), Genre("Sports", "sports"),
Genre("Super Power", "super-power"), Genre("Superhero", "superhero"),
Genre("Supernatural", "supernatural"),
Genre("Thriller", "thriller"), Genre("Thriller", "thriller"),
Genre("Tragedy", "tragedy"), Genre("Tragedy", "tragedy"),
Genre("Vampire", "vampire"), Genre("Wuxia", "wuxia"),
Genre("Webtoon", "webtoon"),
Genre("Webtoons", "webtoons"),
Genre("Yuri", "yuri") Genre("Yuri", "yuri")
) )