Fix/revert to img (#8648)

* TeamX: revert page image extraction to use <img> instead of <canvas>

* TeamX: support both <img> and <canvas> for page extraction
This commit is contained in:
xMohnad 2025-04-27 05:08:15 +03:00 committed by Draff
parent 312747fb1a
commit c9d562c63a
No known key found for this signature in database
GPG Key ID: E8A89F3211677653
2 changed files with 9 additions and 4 deletions

View File

@ -1,7 +1,7 @@
ext {
extName = 'Team X'
extClass = '.TeamX'
extVersionCode = 21
extVersionCode = 22
isNsfw = false
}

View File

@ -215,9 +215,14 @@ class TeamX : ParsedHttpSource(), ConfigurableSource {
// Pages
override fun pageListParse(document: Document): List<Page> {
return document.select("div.image_list canvas[data-src]").mapIndexed { i, img ->
Page(i, "", img.absUrl("data-src"))
}
return document.select("div.image_list canvas[data-src], div.image_list img[src]")
.mapIndexed { i, element ->
val url = when {
element.hasAttr("src") -> element.absUrl("src")
else -> element.absUrl("data-src")
}
Page(i, "", url)
}
}
override fun imageUrlParse(document: Document): String = throw UnsupportedOperationException()