Yidan Girl: fix thumbnail (#17427)
* Yidan Girl: fix thumbnail * Yidan Girl: remove dead domains Co-authored-by: stevenyomi <95685115+stevenyomi@users.noreply.github.com> --------- Co-authored-by: stevenyomi <95685115+stevenyomi@users.noreply.github.com>
This commit is contained in:
parent
e2c5be2b47
commit
a66beaf8d3
|
@ -6,7 +6,7 @@ ext {
|
||||||
extName = 'Yidan Girl'
|
extName = 'Yidan Girl'
|
||||||
pkgNameSuffix = 'zh.yidan'
|
pkgNameSuffix = 'zh.yidan'
|
||||||
extClass = '.Yidan'
|
extClass = '.Yidan'
|
||||||
extVersionCode = 1
|
extVersionCode = 2
|
||||||
isNsfw = true
|
isNsfw = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ class MangaDto(
|
||||||
private val coverPic: String?,
|
private val coverPic: String?,
|
||||||
private val id: Int,
|
private val id: Int,
|
||||||
) {
|
) {
|
||||||
fun toSManga() = SManga.create().apply {
|
fun toSManga(baseUrl: String) = SManga.create().apply {
|
||||||
url = id.toString()
|
url = id.toString()
|
||||||
title = this@MangaDto.title
|
title = this@MangaDto.title
|
||||||
author = this@MangaDto.author
|
author = this@MangaDto.author
|
||||||
|
@ -29,7 +29,7 @@ class MangaDto(
|
||||||
"5" in mhcate.split(",") -> SManga.COMPLETED
|
"5" in mhcate.split(",") -> SManga.COMPLETED
|
||||||
else -> SManga.ONGOING
|
else -> SManga.ONGOING
|
||||||
}
|
}
|
||||||
thumbnail_url = coverPic
|
thumbnail_url = if (coverPic?.startsWith("http") == true) coverPic else baseUrl + coverPic
|
||||||
initialized = true
|
initialized = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,7 @@ class Yidan : HttpSource(), ConfigurableSource {
|
||||||
|
|
||||||
override fun popularMangaParse(response: Response): MangasPage {
|
override fun popularMangaParse(response: Response): MangasPage {
|
||||||
val listing: ListingDto = response.parseAs()
|
val listing: ListingDto = response.parseAs()
|
||||||
val mangas = listing.list.map { it.toSManga() }
|
val mangas = listing.list.map { it.toSManga(baseUrl) }
|
||||||
val hasNextPage = run {
|
val hasNextPage = run {
|
||||||
val url = response.request.url
|
val url = response.request.url
|
||||||
val pageSize = url.queryParameter("pageSize")!!.toInt()
|
val pageSize = url.queryParameter("pageSize")!!.toInt()
|
||||||
|
@ -84,7 +84,7 @@ class Yidan : HttpSource(), ConfigurableSource {
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun mangaDetailsParse(response: Response) =
|
override fun mangaDetailsParse(response: Response) =
|
||||||
response.parseAs<MangaDto>().toSManga()
|
response.parseAs<MangaDto>().toSManga(baseUrl)
|
||||||
|
|
||||||
override fun chapterListRequest(manga: SManga) =
|
override fun chapterListRequest(manga: SManga) =
|
||||||
GET("$baseUrl/prod-api/app-api/vv/mh-episodes/list?mhid=${manga.url}", headers)
|
GET("$baseUrl/prod-api/app-api/vv/mh-episodes/list?mhid=${manga.url}", headers)
|
||||||
|
@ -132,6 +132,6 @@ class Yidan : HttpSource(), ConfigurableSource {
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private const val MIRROR_PREF = "MIRROR"
|
private const val MIRROR_PREF = "MIRROR"
|
||||||
private val MIRRORS get() = arrayOf("ydan.cc", "ydan.vip", "dans.cc")
|
private val MIRRORS get() = arrayOf("ydan.cc", "yidan.one", "yidan.in", "yidan.info")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue