fix load image from i0.wp.com komikcast (#1574)
fix load image from i0.wp.com komikcast
This commit is contained in:
parent
84e4d80a39
commit
4e45edd8cf
|
@ -5,7 +5,7 @@ ext {
|
||||||
appName = 'Tachiyomi: Komikcast'
|
appName = 'Tachiyomi: Komikcast'
|
||||||
pkgNameSuffix = 'id.komikcast'
|
pkgNameSuffix = 'id.komikcast'
|
||||||
extClass = '.Komikcast'
|
extClass = '.Komikcast'
|
||||||
extVersionCode = 3
|
extVersionCode = 4
|
||||||
libVersion = '1.2'
|
libVersion = '1.2'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -187,7 +187,7 @@ class Komikcast : ParsedHttpSource() {
|
||||||
document.select("div#readerarea img").forEach { element ->
|
document.select("div#readerarea img").forEach { element ->
|
||||||
val url = element.attr("src")
|
val url = element.attr("src")
|
||||||
i++
|
i++
|
||||||
if (url.length != 0) {
|
if (url.length > 0) {
|
||||||
pages.add(Page(i, "", url))
|
pages.add(Page(i, "", url))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -197,11 +197,18 @@ class Komikcast : ParsedHttpSource() {
|
||||||
override fun imageUrlParse(document: Document) = ""
|
override fun imageUrlParse(document: Document) = ""
|
||||||
|
|
||||||
override fun imageRequest(page: Page): Request {
|
override fun imageRequest(page: Page): Request {
|
||||||
val imgHeader = Headers.Builder().apply {
|
var headers = Headers.Builder()
|
||||||
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")
|
headers.apply {
|
||||||
add("Referer", baseUrl)
|
add("Referer", baseUrl)
|
||||||
}.build()
|
add("User-Agent", "Mozilla/5.0 (Linux; U; Android 4.4.2; en-us; LGMS323 Build/KOT49I.MS32310c) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/76.0.3809.100 Mobile Safari/537.36")
|
||||||
return GET(page.imageUrl!!, imgHeader)
|
}
|
||||||
|
|
||||||
|
if (page.imageUrl!!.contains("i0.wp.com")) {
|
||||||
|
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())
|
||||||
}
|
}
|
||||||
|
|
||||||
private class SortBy : UriPartFilter("Sort by", arrayOf(
|
private class SortBy : UriPartFilter("Sort by", arrayOf(
|
||||||
|
|
Loading…
Reference in New Issue