[HeanCms] Small improvements (#1751)

Co-authored-by: Draken <dragonx943@users.noreply.github.com>
master
Draken 12 months ago committed by GitHub
parent cea4db9619
commit 7ea59a7bf1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -143,9 +143,13 @@ internal abstract class HeanCms(
protected open val datePattern = "yyyy-MM-dd"
protected open fun reqUrl(seriesId: Long): String {
return "https://$apiPath/chapter/query?page=1&perPage=9999&series_id=$seriesId"
}
override suspend fun getDetails(manga: Manga): Manga {
val seriesId = manga.url.toLongOrNull() ?: manga.id // backward compatibility
val url = "https://$apiPath/chapter/query?page=1&perPage=9999&series_id=$seriesId"
val url = reqUrl(seriesId) // keep old API url, can replace it
val response = webClient.httpGet(url).parseJson()
val data = response.getJSONArray("data").asTypedList<JSONObject>()
val dateFormat = SimpleDateFormat(datePattern, Locale.ENGLISH)

@ -11,4 +11,8 @@ internal class ReaperComics(context: MangaLoaderContext) :
override val cdn = "media.reaperscans.com/file/4SRBHm//"
override val paramsUpdated = "updated_at"
override val selectPages = ".flex > img"
}
override fun reqUrl(seriesId: Long): String {
return "https://$apiPath/chapters/$seriesId?page=1&perPage=9999&order=desc"
}
}
Loading…
Cancel
Save