Fix/hc not finding pages (#9669)
* Update build.gradle * fix: pageListParse not returning any pages The old selector wasn't returning any images. Changed fetchChapterList url to the new HC `story` page which has all the images, unpaginated. Updated pageListParse.
This commit is contained in:
parent
187fa7de52
commit
42e4618a13
@ -1,7 +1,7 @@
|
||||
ext {
|
||||
extName = 'Hentai Cosplay'
|
||||
extClass = '.HentaiCosplay'
|
||||
extVersionCode = 4
|
||||
extVersionCode = 5
|
||||
isNsfw = true
|
||||
}
|
||||
|
||||
|
@ -198,7 +198,7 @@ class HentaiCosplay : HttpSource() {
|
||||
override fun fetchChapterList(manga: SManga): Observable<List<SChapter>> = Observable.fromCallable {
|
||||
SChapter.create().apply {
|
||||
name = "Gallery"
|
||||
url = manga.url.removeSuffix("/").plus("/attachment/1/")
|
||||
url = manga.url.replace("/image/", "/story/")
|
||||
date_upload = runCatching {
|
||||
dateFormat.parse(dateCache[manga.url]!!)!!.time
|
||||
}.getOrDefault(0L)
|
||||
@ -209,21 +209,13 @@ class HentaiCosplay : HttpSource() {
|
||||
|
||||
override fun pageListParse(response: Response): List<Page> {
|
||||
val document = response.asJsoup()
|
||||
val pageUrl = document.location().substringBeforeLast("/1/")
|
||||
|
||||
val totalPages = document.selectFirst("#right_sidebar > h3, #title > h2")
|
||||
?.text()?.trim()
|
||||
?.run { pagesRegex.find(this)?.groupValues?.get(1) }
|
||||
?.toIntOrNull()
|
||||
?: return emptyList()
|
||||
|
||||
val pages = (1..totalPages).map {
|
||||
Page(it, "$pageUrl/$it/")
|
||||
}
|
||||
|
||||
pages[0].imageUrl = imageUrlParse(document)
|
||||
|
||||
return pages
|
||||
return document.select("amp-img[src*=upload]")
|
||||
.mapIndexed { index, element ->
|
||||
Page(
|
||||
index = index,
|
||||
imageUrl = element.attr("src"),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
override fun imageUrlParse(response: Response) = imageUrlParse(response.asJsoup())
|
||||
|
Loading…
x
Reference in New Issue
Block a user