mirror of
https://github.com/keiyoushi/extensions-source.git
synced 2024-11-22 10:22:47 +01:00
Baozimhorg: handle new api (#5494)
This commit is contained in:
parent
2b3b82947a
commit
16d3044606
@ -2,7 +2,7 @@ ext {
|
||||
extName = 'GoDa'
|
||||
extClass = '.GoDaManhua'
|
||||
themePkg = 'goda'
|
||||
overrideVersionCode = 29
|
||||
overrideVersionCode = 30
|
||||
}
|
||||
|
||||
apply from: "$rootDir/common.gradle"
|
||||
|
@ -53,9 +53,12 @@ private val dateFormat = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", Locale
|
||||
class PageListDto(val info: PageListInfoDto)
|
||||
|
||||
@Serializable
|
||||
class PageListInfoDto(val images: List<ImageDto>)
|
||||
class PageListInfoDto(val images: PageListInfoImagesDto)
|
||||
|
||||
@Serializable
|
||||
class PageListInfoImagesDto(val images: List<ImageDto>)
|
||||
|
||||
@Serializable
|
||||
class ImageDto(private val url: String, private val order: Int) {
|
||||
fun toPage() = Page(order, imageUrl = url)
|
||||
fun toPage() = Page(order, imageUrl = "https://f40-1-4.g-mh.online$url")
|
||||
}
|
||||
|
@ -39,17 +39,17 @@ class GoDaManhua : GoDa("GoDa漫画", "", "zh"), ConfigurableSource {
|
||||
private val json: Json = Injekt.get()
|
||||
|
||||
override fun fetchChapterList(mangaId: String): List<SChapter> {
|
||||
val response = client.newCall(GET("https://api-get.mgsearcher.com/api/manga/get?mid=$mangaId&mode=all", headers)).execute()
|
||||
val response = client.newCall(GET("https://api-get-v2.mgsearcher.com/api/manga/get?mid=$mangaId&mode=all", headers)).execute()
|
||||
return json.decodeFromString<ResponseDto<ChapterListDto>>(response.body.string()).data.toChapterList()
|
||||
}
|
||||
|
||||
override fun pageListRequest(mangaId: String, chapterId: String): Request {
|
||||
if (mangaId.isEmpty() || chapterId.isEmpty()) throw Exception("请刷新漫画")
|
||||
return GET("https://api-get.mgsearcher.com/api/chapter/getinfo?m=$mangaId&c=$chapterId", headers)
|
||||
return GET("https://api-get-v2.mgsearcher.com/api/chapter/getinfo?m=$mangaId&c=$chapterId", headers)
|
||||
}
|
||||
|
||||
override fun pageListParse(response: Response): List<Page> {
|
||||
return json.decodeFromString<ResponseDto<PageListDto>>(response.body.string()).data.info.images.map { it.toPage() }
|
||||
return json.decodeFromString<ResponseDto<PageListDto>>(response.body.string()).data.info.images.images.map { it.toPage() }
|
||||
}
|
||||
|
||||
override fun setupPreferenceScreen(screen: PreferenceScreen) {
|
||||
|
Loading…
Reference in New Issue
Block a user