Fix BacaKomik (#19397)
chore: BacaKomik * Update domain and url path. * Also fix Author, Status in manga desc. Signed-off-by: Ahmad Thoriq Najahi <najahi@zephyrus.id>
This commit is contained in:
parent
dd07b03464
commit
bab543a363
|
@ -5,7 +5,7 @@ ext {
|
|||
extName = 'BacaKomik'
|
||||
pkgNameSuffix = 'id.bacakomik'
|
||||
extClass = '.BacaKomik'
|
||||
extVersionCode = 7
|
||||
extVersionCode = 8
|
||||
}
|
||||
|
||||
apply from: "$rootDir/common.gradle"
|
||||
|
|
|
@ -19,7 +19,7 @@ import java.util.Locale
|
|||
|
||||
class BacaKomik : ParsedHttpSource() {
|
||||
override val name = "BacaKomik"
|
||||
override val baseUrl = "https://bacakomik.me"
|
||||
override val baseUrl = "https://bacakomik.net"
|
||||
override val lang = "id"
|
||||
override val supportsLatest = true
|
||||
private val dateFormat: SimpleDateFormat = SimpleDateFormat("MMM d, yyyy", Locale.US)
|
||||
|
@ -34,11 +34,11 @@ class BacaKomik : ParsedHttpSource() {
|
|||
.build()
|
||||
|
||||
override fun popularMangaRequest(page: Int): Request {
|
||||
return GET("$baseUrl/daftar-manga/page/$page/?order=popular", headers)
|
||||
return GET("$baseUrl/daftar-komik/page/$page/?order=popular", headers)
|
||||
}
|
||||
|
||||
override fun latestUpdatesRequest(page: Int): Request {
|
||||
return GET("$baseUrl/daftar-manga/page/$page/?order=update", headers)
|
||||
return GET("$baseUrl/daftar-komik/page/$page/?order=update", headers)
|
||||
}
|
||||
|
||||
override fun popularMangaSelector() = "div.animepost"
|
||||
|
@ -62,7 +62,7 @@ class BacaKomik : ParsedHttpSource() {
|
|||
}
|
||||
|
||||
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
|
||||
val builtUrl = if (page == 1) "$baseUrl/daftar-manga/" else "$baseUrl/daftar-manga/page/$page/?order="
|
||||
val builtUrl = if (page == 1) "$baseUrl/daftar-komik/" else "$baseUrl/daftar-komik/page/$page/?order="
|
||||
val url = builtUrl.toHttpUrlOrNull()!!.newBuilder()
|
||||
url.addQueryParameter("title", query)
|
||||
url.addQueryParameter("page", page.toString())
|
||||
|
@ -104,8 +104,8 @@ class BacaKomik : ParsedHttpSource() {
|
|||
val manga = SManga.create()
|
||||
manga.title = document.select("#breadcrumbs li:last-child span").text()
|
||||
// need authorCleaner to take "pengarang:" string to remove it from author
|
||||
val authorCleaner = document.select(".infox .spe b:contains(Pengarang)").text()
|
||||
manga.author = document.select(".infox .spe span:contains(Pengarang)").text().substringAfter(authorCleaner)
|
||||
val authorCleaner = document.select(".infox .spe b:contains(Author)").text()
|
||||
manga.author = document.select(".infox .spe span:contains(Author)").text().substringAfter(authorCleaner)
|
||||
manga.artist = manga.author
|
||||
val genres = mutableListOf<String>()
|
||||
infoElement.select(".infox > .genre-info > a, .infox .spe span:contains(Jenis Komik) a").forEach { element ->
|
||||
|
@ -113,7 +113,8 @@ class BacaKomik : ParsedHttpSource() {
|
|||
genres.add(genre)
|
||||
}
|
||||
manga.genre = genres.joinToString(", ")
|
||||
manga.status = parseStatus(infoElement.select(".infox > .spe > span:nth-child(1)").text())
|
||||
val statusCleaner = document.select(".infox .spe b:contains(Status)").text()
|
||||
manga.status = parseStatus(document.select(".infox .spe span:contains(Status)").text().substringAfter(statusCleaner))
|
||||
manga.description = descElement.select("p").text().substringAfter("bercerita tentang ")
|
||||
manga.thumbnail_url = document.select(".thumb > img:nth-child(1)").attr("src")
|
||||
return manga
|
||||
|
|
Loading…
Reference in New Issue