Invinciblescans: Trial and error the file extension of images. (#10207)
This commit is contained in:
parent
a4babea523
commit
eb480815e8
@ -1,7 +1,7 @@
|
|||||||
ext {
|
ext {
|
||||||
extName = 'Invincible ComicsVF'
|
extName = 'Invincible ComicsVF'
|
||||||
extClass = '.InvincibleComics'
|
extClass = '.InvincibleComics'
|
||||||
extVersionCode = 1
|
extVersionCode = 2
|
||||||
}
|
}
|
||||||
|
|
||||||
apply from: "$rootDir/common.gradle"
|
apply from: "$rootDir/common.gradle"
|
||||||
|
@ -22,6 +22,20 @@ class InvincibleComics : HttpSource() {
|
|||||||
|
|
||||||
override val supportsLatest = true
|
override val supportsLatest = true
|
||||||
|
|
||||||
|
override val client = network.cloudflareClient.newBuilder().addInterceptor { chain ->
|
||||||
|
val req = chain.request()
|
||||||
|
val res = chain.proceed(req)
|
||||||
|
|
||||||
|
if (req.url.fragment != "page" || res.code != 404) return@addInterceptor res
|
||||||
|
|
||||||
|
res.close()
|
||||||
|
val newRequest = req.newBuilder()
|
||||||
|
.url(chain.request().url.toString().replace(".jpg", ".png"))
|
||||||
|
.build()
|
||||||
|
|
||||||
|
chain.proceed(newRequest)
|
||||||
|
}.build()
|
||||||
|
|
||||||
// Popular
|
// Popular
|
||||||
override fun popularMangaRequest(page: Int): Request {
|
override fun popularMangaRequest(page: Int): Request {
|
||||||
return GET(baseUrl, headers)
|
return GET(baseUrl, headers)
|
||||||
@ -81,9 +95,9 @@ class InvincibleComics : HttpSource() {
|
|||||||
description = document.selectFirst("strong:contains(Résumé)")?.parent()?.ownText()
|
description = document.selectFirst("strong:contains(Résumé)")?.parent()?.ownText()
|
||||||
author = document.selectFirst("strong:contains(Auteur)")?.parent()?.ownText()
|
author = document.selectFirst("strong:contains(Auteur)")?.parent()?.ownText()
|
||||||
genre = document.selectFirst("strong:contains(Genres)")?.parent()?.ownText()
|
genre = document.selectFirst("strong:contains(Genres)")?.parent()?.ownText()
|
||||||
status = when (document.selectFirst("strong:contains(Statut)")?.parent()?.ownText()) {
|
status = when (document.selectFirst("strong:contains(Status)")?.parent()?.ownText()?.trim()) {
|
||||||
"En cours" -> SManga.ONGOING // OK
|
"En cours" -> SManga.ONGOING
|
||||||
"Terminé" -> SManga.COMPLETED // TODO: Check if this is correct
|
"Términé" -> SManga.COMPLETED
|
||||||
else -> SManga.UNKNOWN
|
else -> SManga.UNKNOWN
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -114,7 +128,7 @@ class InvincibleComics : HttpSource() {
|
|||||||
?: error("Failed to extract total pages from script")
|
?: error("Failed to extract total pages from script")
|
||||||
|
|
||||||
return (1..totalPages.toInt()).map { pageNumber ->
|
return (1..totalPages.toInt()).map { pageNumber ->
|
||||||
Page(pageNumber, imageUrl = "$imageBaseUrl${"%03d".format(pageNumber)}.png")
|
Page(pageNumber, imageUrl = "$imageBaseUrl${"%03d".format(pageNumber)}.jpg#page")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user