Fix chapters not found at AS. (#8587)
This commit is contained in:
parent
d6838a544e
commit
20e87bd4a2
@ -2,7 +2,12 @@ package eu.kanade.tachiyomi.extension.pt.arthurscan
|
||||
|
||||
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
|
||||
import eu.kanade.tachiyomi.multisrc.madara.Madara
|
||||
import eu.kanade.tachiyomi.network.POST
|
||||
import eu.kanade.tachiyomi.source.model.SChapter
|
||||
import eu.kanade.tachiyomi.util.asJsoup
|
||||
import okhttp3.OkHttpClient
|
||||
import okhttp3.Response
|
||||
import org.jsoup.nodes.Document
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.Locale
|
||||
import java.util.concurrent.TimeUnit
|
||||
@ -18,9 +23,33 @@ class ArthurScan : Madara(
|
||||
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS))
|
||||
.build()
|
||||
|
||||
override val altName: String = "Nome alternativo: "
|
||||
|
||||
override fun popularMangaSelector() = "div.page-item-detail.manga"
|
||||
|
||||
override val altName: String = "Nome alternativo: "
|
||||
override fun getXhrChapters(mangaId: String): Document {
|
||||
val xhrHeaders = headersBuilder()
|
||||
.add("Referer", baseUrl)
|
||||
.add("X-Requested-With", "XMLHttpRequest")
|
||||
.build()
|
||||
|
||||
val request = POST("$mangaId/ajax/chapters", xhrHeaders)
|
||||
|
||||
return client.newCall(request).execute().asJsoup()
|
||||
}
|
||||
|
||||
override fun chapterListParse(response: Response): List<SChapter> {
|
||||
val document = response.asJsoup()
|
||||
val dataIdSelector = "div[id^=manga-chapters-holder]"
|
||||
|
||||
return document.select(chapterListSelector())
|
||||
.let { elements ->
|
||||
if (elements.isEmpty() && !document.select(dataIdSelector).isNullOrEmpty())
|
||||
getXhrChapters(document.location().removeSuffix("/")).select(chapterListSelector())
|
||||
else elements
|
||||
}
|
||||
.map(::chapterFromElement)
|
||||
}
|
||||
|
||||
// [...document.querySelectorAll('div.genres li a')]
|
||||
// .map(x => `Genre("${x.innerText.slice(1, -4).trim()}", "${x.href.replace(/.*-genre\/(.*)\//, '$1')}")`)
|
||||
|
@ -400,7 +400,7 @@ abstract class Madara(
|
||||
}
|
||||
}
|
||||
|
||||
protected fun getXhrChapters(mangaId: String): Document {
|
||||
protected open fun getXhrChapters(mangaId: String): Document {
|
||||
val xhrHeaders = headersBuilder().add("Content-Type: application/x-www-form-urlencoded; charset=UTF-8")
|
||||
.add("Referer", baseUrl)
|
||||
.build()
|
||||
|
@ -35,7 +35,7 @@ class MadaraGenerator : ThemeSourceGenerator {
|
||||
SingleLang("ApollComics", "https://apollcomics.xyz", "es", overrideVersionCode = 1),
|
||||
SingleLang("ArazNovel", "https://www.araznovel.com", "tr", overrideVersionCode = 1),
|
||||
SingleLang("Argos Scan", "https://argosscan.com", "pt-BR", overrideVersionCode = 3),
|
||||
SingleLang("Arthur Scan", "https://arthurscan.xyz", "pt-BR", overrideVersionCode = 2),
|
||||
SingleLang("Arthur Scan", "https://arthurscan.xyz", "pt-BR", overrideVersionCode = 3),
|
||||
SingleLang("Astral Library", "https://www.astrallibrary.net", "en", overrideVersionCode = 2),
|
||||
SingleLang("Asura Raw", "https://asuraraw.com", "en"),
|
||||
SingleLang("Atikrost", "https://atikrost.com", "tr", overrideVersionCode = 1),
|
||||
|
Loading…
x
Reference in New Issue
Block a user