Fix images load DocTruyen3Q (#8119)

This commit is contained in:
Fioren 2025-03-18 19:31:46 +07:00 committed by Draff
parent 9dc2d6f03f
commit 6f47ed8bc1
No known key found for this signature in database
GPG Key ID: E8A89F3211677653
2 changed files with 8 additions and 4 deletions

View File

@ -2,8 +2,8 @@ ext {
extName = 'DocTruyen3Q' extName = 'DocTruyen3Q'
extClass = '.DocTruyen3Q' extClass = '.DocTruyen3Q'
themePkg = 'wpcomics' themePkg = 'wpcomics'
baseUrl = 'https://doctruyen3qui.pro' baseUrl = 'https://doctruyen3qui3.pro'
overrideVersionCode = 5 overrideVersionCode = 6
isNsfw = true isNsfw = true
} }

View File

@ -23,7 +23,7 @@ import java.util.TimeZone
class DocTruyen3Q : class DocTruyen3Q :
WPComics( WPComics(
"DocTruyen3Q", "DocTruyen3Q",
"https://doctruyen3qui.pro", "https://doctruyen3qui3.pro",
"vi", "vi",
dateFormat = SimpleDateFormat("dd-MM-yyyy", Locale.ROOT).apply { dateFormat = SimpleDateFormat("dd-MM-yyyy", Locale.ROOT).apply {
timeZone = TimeZone.getTimeZone("Asia/Ho_Chi_Minh") timeZone = TimeZone.getTimeZone("Asia/Ho_Chi_Minh")
@ -38,7 +38,11 @@ class DocTruyen3Q :
override fun pageListParse(document: Document): List<Page> { override fun pageListParse(document: Document): List<Page> {
return document.select(".page-chapter[id] a img, .page-chapter[id] img").mapIndexed { index, element -> return document.select(".page-chapter[id] a img, .page-chapter[id] img").mapIndexed { index, element ->
val img = element.attr("abs:src").takeIf { it.isNotBlank() } ?: element.attr("abs:data-original") val img = if (element.hasAttr("data-original")) {
element.attr("abs:data-original")
} else {
element.attr("abs:src")
}
Page(index, imageUrl = img) Page(index, imageUrl = img)
}.distinctBy { it.imageUrl } }.distinctBy { it.imageUrl }
} }