fix nepnep thumbnails (#12654)

This commit is contained in:
Basara-Hatake 2022-07-21 04:36:51 +02:00 committed by GitHub
parent adc8fdafb8
commit 2a895ba62f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 2 deletions

View File

@ -95,13 +95,24 @@ abstract class NepNep(
SManga.create().apply {
title = directory[i].getString("s")!!
url = "/manga/${directory[i].getString("i")}"
thumbnail_url = "https://cover.nep.li/cover/${directory[i].getString("i")}.jpg"
thumbnail_url = getThumbnailUrl(directory[i].getString("i")!!)
}
)
}
return MangasPage(mangas, endRange < directory.lastIndex)
}
private var thumbnailUrl: String? = null
private fun getThumbnailUrl(id: String): String {
if (thumbnailUrl.isNullOrEmpty()) {
val response = client.newCall(popularMangaRequest(1)).execute()
thumbnailUrl = response.asJsoup().select(".SearchResult > .SearchResultCover img").first().attr("ng-src")
}
return thumbnailUrl!!.replace("{{Result.i}}", id)
}
// Latest
override fun fetchLatestUpdates(page: Int): Observable<MangasPage> {

View File

@ -9,7 +9,7 @@ class NepNepGenerator : ThemeSourceGenerator {
override val themeClass = "NepNep"
override val baseVersionCode: Int = 9
override val baseVersionCode: Int = 10
override val sources = listOf(
SingleLang("MangaSee", "https://mangasee123.com", "en", overrideVersionCode = 20),