diff --git a/src/zh/zaimanhua/build.gradle b/src/zh/zaimanhua/build.gradle index e8b20e5a3..f3d45e989 100644 --- a/src/zh/zaimanhua/build.gradle +++ b/src/zh/zaimanhua/build.gradle @@ -1,7 +1,7 @@ ext { extName = 'Zaimanhua' extClass = '.Zaimanhua' - extVersionCode = 8 + extVersionCode = 9 isNsfw = false } diff --git a/src/zh/zaimanhua/src/eu/kanade/tachiyomi/extension/zh/zaimanhua/Zaimanhua.kt b/src/zh/zaimanhua/src/eu/kanade/tachiyomi/extension/zh/zaimanhua/Zaimanhua.kt index 5e7e62d5b..025558b5f 100644 --- a/src/zh/zaimanhua/src/eu/kanade/tachiyomi/extension/zh/zaimanhua/Zaimanhua.kt +++ b/src/zh/zaimanhua/src/eu/kanade/tachiyomi/extension/zh/zaimanhua/Zaimanhua.kt @@ -40,6 +40,7 @@ class Zaimanhua : HttpSource(), ConfigurableSource { override val name = "再漫画" override val baseUrl = "https://manhua.zaimanhua.com" + private val mobileBaseUrl = "https://m.zaimanhua.com" private val apiUrl = "https://v4api.zaimanhua.com/app/v1" private val accountApiUrl = "https://account-api.zaimanhua.com/v1" private val checkTokenRegex = Regex("""$apiUrl/comic/(detail|chapter)""") @@ -125,6 +126,10 @@ class Zaimanhua : HttpSource(), ConfigurableSource { } // Detail + override fun getMangaUrl(manga: SManga): String { + return "$mobileBaseUrl/pages/comic/detail?id=${manga.url}" + } + // path: "/comic/detail/mangaId" override fun mangaDetailsRequest(manga: SManga): Request = GET("$apiUrl/comic/detail/${manga.url}?channel=android", apiHeaders) @@ -151,6 +156,11 @@ class Zaimanhua : HttpSource(), ConfigurableSource { } // PageList + override fun getChapterUrl(chapter: SChapter): String { + val (mangaId, chapterId) = chapter.url.split("/", limit = 2) + return "$mobileBaseUrl/pages/comic/page?comic_id=$mangaId&chapter_id=$chapterId" + } + // path: "/comic/chapter/mangaId/chapterId" private fun pageListApiRequest(path: String): Request = GET("$apiUrl/comic/chapter/$path", apiHeaders, USE_CACHE) diff --git a/src/zh/zaimanhua/src/eu/kanade/tachiyomi/extension/zh/zaimanhua/ZaimanhuaDto.kt b/src/zh/zaimanhua/src/eu/kanade/tachiyomi/extension/zh/zaimanhua/ZaimanhuaDto.kt index a7f334843..27ae9e4d3 100644 --- a/src/zh/zaimanhua/src/eu/kanade/tachiyomi/extension/zh/zaimanhua/ZaimanhuaDto.kt +++ b/src/zh/zaimanhua/src/eu/kanade/tachiyomi/extension/zh/zaimanhua/ZaimanhuaDto.kt @@ -51,11 +51,10 @@ class ChapterGroupDto( ) { fun toSChapterList(mangaId: String, lastUpdateChapter: String, lastUpdateTime: Long): List { val groupName = title - val isDefaultGroup = groupName == "连载" val current = System.currentTimeMillis() return data.map { it.toSChapterInternal().apply { - if (!isDefaultGroup) scanlator = groupName + scanlator = groupName // For some chapters, api will always return current time as upload time // Therefore upload times that differ too little from the current time will be ignored // When the chapter is the latest chapter, use the last update time as the upload time