Fix BacaKomik no pages found (#16977)

* Update BacaKomik.kt

change target document.select for fix page not found

* update extVersionCode to 5

* update bacakomik from document.select to document.getElementsByTag with cdnUrl
This commit is contained in:
Fadilah Riczky 2023-07-04 06:56:31 +07:00 committed by GitHub
parent 13f4e346c3
commit aaa067a4f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 5 deletions

View File

@ -5,7 +5,7 @@ ext {
extName = 'BacaKomik'
pkgNameSuffix = 'id.bacakomik'
extClass = '.BacaKomik'
extVersionCode = 4
extVersionCode = 5
}
apply from: "$rootDir/common.gradle"

View File

@ -185,11 +185,14 @@ class BacaKomik : ParsedHttpSource() {
override fun pageListParse(document: Document): List<Page> {
val pages = mutableListOf<Page>()
var i = 0
document.select("div.imgch-auh img").forEach { element ->
val cdnUrl = "https://ttl.bakul.buzz/" // change with correct CDN url
document.getElementsByTag("img").forEach { element ->
val url = element.attr("onError").substringAfter("src='").substringBefore("';")
i++
if (url.isNotEmpty()) {
pages.add(Page(i, "", url))
if (url.startsWith(cdnUrl)) {
i++
if (url.isNotEmpty()) {
pages.add(Page(i, "", url))
}
}
}
return pages