mirror of
https://github.com/keiyoushi/extensions-source.git
synced 2024-11-22 10:22:47 +01:00
LectorTmo: Fix images not loading (#4997)
* fix * Use url.fragment Co-authored-by: Vetle Ledaal <vetle.ledaal@gmail.com> * bruh --------- Co-authored-by: Vetle Ledaal <vetle.ledaal@gmail.com>
This commit is contained in:
parent
08fab7cd11
commit
332ff9eea4
@ -1,7 +1,7 @@
|
||||
ext {
|
||||
extName = 'TuMangaOnline / LectorManga'
|
||||
extClass = '.LectorTmoFactory'
|
||||
extVersionCode = 1
|
||||
extVersionCode = 2
|
||||
isNsfw = true
|
||||
}
|
||||
|
||||
|
@ -57,13 +57,9 @@ abstract class LectorTmo(
|
||||
.build()
|
||||
|
||||
protected open val imageCDNUrls = arrayOf(
|
||||
"https://img1.followmanga.com",
|
||||
"https://img1.biggestchef.com",
|
||||
"https://img1.indalchef.com",
|
||||
"https://img1.recipesandcook.com",
|
||||
"https://img1.cyclingte.com",
|
||||
"https://img1.japanreader.com",
|
||||
"https://japanreader.com",
|
||||
"https://imgtmo.com",
|
||||
)
|
||||
|
||||
private fun OkHttpClient.Builder.rateLimitImageCDNs(hosts: Array<String>, permits: Int, period: Long): OkHttpClient.Builder {
|
||||
@ -108,7 +104,7 @@ abstract class LectorTmo(
|
||||
.addInterceptor { chain ->
|
||||
val request = chain.request()
|
||||
val url = request.url
|
||||
if (url.host.contains("japanreader.com")) {
|
||||
if (url.fragment == "imagereq") {
|
||||
return@addInterceptor ignoreSslClient.newCall(request).execute()
|
||||
}
|
||||
chain.proceed(request)
|
||||
@ -444,7 +440,7 @@ abstract class LectorTmo(
|
||||
}
|
||||
|
||||
override fun imageRequest(page: Page): Request {
|
||||
return GET(page.imageUrl!!, tmoHeaders)
|
||||
return GET(page.imageUrl!! + "#imagereq", tmoHeaders)
|
||||
}
|
||||
|
||||
override fun imageUrlParse(document: Document) = throw UnsupportedOperationException()
|
||||
|
@ -83,7 +83,7 @@ class LectorManga : LectorTmo("LectorManga", "https://lectormanga.com", "es", ra
|
||||
}
|
||||
|
||||
override fun imageRequest(page: Page) = GET(
|
||||
url = page.imageUrl!!,
|
||||
url = page.imageUrl!! + "#imagereq",
|
||||
headers = headers.newBuilder()
|
||||
.set("Referer", page.url.substringBefore("news/"))
|
||||
.build(),
|
||||
|
Loading…
Reference in New Issue
Block a user