diff --git a/src/zh/dmzj/build.gradle b/src/zh/dmzj/build.gradle index a26401854..48c299857 100644 --- a/src/zh/dmzj/build.gradle +++ b/src/zh/dmzj/build.gradle @@ -6,7 +6,7 @@ ext { extName = 'DMZJ' pkgNameSuffix = 'zh.dmzj' extClass = '.Dmzj' - extVersionCode = 35 + extVersionCode = 36 } apply from: "$rootDir/common.gradle" diff --git a/src/zh/dmzj/src/eu/kanade/tachiyomi/extension/zh/dmzj/ApiSearch.kt b/src/zh/dmzj/src/eu/kanade/tachiyomi/extension/zh/dmzj/ApiSearch.kt index 52af16503..1d27f7f7f 100644 --- a/src/zh/dmzj/src/eu/kanade/tachiyomi/extension/zh/dmzj/ApiSearch.kt +++ b/src/zh/dmzj/src/eu/kanade/tachiyomi/extension/zh/dmzj/ApiSearch.kt @@ -10,7 +10,7 @@ import okhttp3.Response object ApiSearch { fun textSearchUrl(query: String) = - "http://s.acg.dmzj.com/comicsum/search.php".toHttpUrl().newBuilder() + "http://sacg.idmzj.com/comicsum/search.php".toHttpUrl().newBuilder() .addQueryParameter("s", query) .toString() diff --git a/src/zh/dmzj/src/eu/kanade/tachiyomi/extension/zh/dmzj/ApiV3.kt b/src/zh/dmzj/src/eu/kanade/tachiyomi/extension/zh/dmzj/ApiV3.kt index d9be298a3..ba3dc993e 100644 --- a/src/zh/dmzj/src/eu/kanade/tachiyomi/extension/zh/dmzj/ApiV3.kt +++ b/src/zh/dmzj/src/eu/kanade/tachiyomi/extension/zh/dmzj/ApiV3.kt @@ -10,7 +10,7 @@ import okhttp3.Response object ApiV3 { - private const val v3apiUrl = "https://v3api.dmzj.com" + private const val v3apiUrl = "https://v3api.idmzj.com" private const val apiUrl = "https://api.dmzj.com" fun popularMangaUrl(page: Int) = "$v3apiUrl/classify/0/0/${page - 1}.json" @@ -33,7 +33,15 @@ object ApiV3 { } fun parseChapterListV1(response: Response): List { - return parseMangaInfoV1(response).data.list.map { it.toSChapter() } + val data = parseMangaInfoV1(response).data + return buildList(data.list.size + data.alone.size) { + data.list.mapTo(this) { + it.toSChapter() + } + data.alone.mapTo(this) { + it.toSChapter().apply { name = "单行本: $name" } + } + } } fun chapterCommentsUrl(path: String) = "$v3apiUrl/viewPoint/0/$path.json" @@ -92,7 +100,7 @@ object ApiV3 { } @Serializable - class DataDto(val info: MangaDto, val list: List) + class DataDto(val info: MangaDto, val list: List, val alone: List) @Serializable class ResponseDto(val data: DataDto) diff --git a/src/zh/dmzj/src/eu/kanade/tachiyomi/extension/zh/dmzj/ApiV4.kt b/src/zh/dmzj/src/eu/kanade/tachiyomi/extension/zh/dmzj/ApiV4.kt index 9d08d38d8..fda8a7b8c 100644 --- a/src/zh/dmzj/src/eu/kanade/tachiyomi/extension/zh/dmzj/ApiV4.kt +++ b/src/zh/dmzj/src/eu/kanade/tachiyomi/extension/zh/dmzj/ApiV4.kt @@ -18,8 +18,8 @@ import kotlin.reflect.typeOf object ApiV4 { - private const val v4apiUrl = "https://nnv4api.dmzj.com" - private const val imageSmallCDNUrl = "https://imgsmall.dmzj.com" + private const val v4apiUrl = "https://nnv4api.idmzj.com" + private const val imageSmallCDNUrl = "https://imgsmall.idmzj.com" fun mangaInfoUrl(id: String) = "$v4apiUrl/comic/detail/$id?uid=2665531" diff --git a/src/zh/dmzj/src/eu/kanade/tachiyomi/extension/zh/dmzj/Dmzj.kt b/src/zh/dmzj/src/eu/kanade/tachiyomi/extension/zh/dmzj/Dmzj.kt index 2640a7255..18d4804ca 100644 --- a/src/zh/dmzj/src/eu/kanade/tachiyomi/extension/zh/dmzj/Dmzj.kt +++ b/src/zh/dmzj/src/eu/kanade/tachiyomi/extension/zh/dmzj/Dmzj.kt @@ -28,7 +28,7 @@ class Dmzj : ConfigurableSource, HttpSource() { override val lang = "zh" override val supportsLatest = true override val name = "动漫之家" - override val baseUrl = "https://m.dmzj.com" + override val baseUrl = "https://m.idmzj.com" private val preferences: SharedPreferences by lazy { Injekt.get().getSharedPreferences("source_$id", 0x0000) @@ -47,7 +47,7 @@ class Dmzj : ConfigurableSource, HttpSource() { .build() private fun fetchIdBySlug(slug: String): String { - val request = GET("https://manhua.dmzj.com/$slug/", headers) + val request = GET("https://manhua.idmzj.com/$slug/", headers) val html = client.newCall(request).execute().body.string() val start = "g_comic_id = \"" val startIndex = html.indexOf(start) + start.length @@ -133,7 +133,6 @@ class Dmzj : ConfigurableSource, HttpSource() { throw UnsupportedOperationException() } - // Bypass mangaDetailsRequest, fetch api url directly override fun fetchMangaDetails(manga: SManga): Observable { val id = manga.url.extractMangaId() return Observable.fromCallable { fetchMangaDetails(id) } @@ -147,11 +146,13 @@ class Dmzj : ConfigurableSource, HttpSource() { return ApiV3.parseMangaDetailsV1(response) } - // Workaround to allow "Open in browser" use human readable webpage url. - // headers are not needed override fun mangaDetailsRequest(manga: SManga): Request { + throw UnsupportedOperationException() + } + + override fun getMangaUrl(manga: SManga): String { val cid = manga.url.extractMangaId() - return GET("$baseUrl/info/$cid.html") + return "$baseUrl/info/$cid.html" } override fun mangaDetailsParse(response: Response) = SManga.create().apply { @@ -178,8 +179,7 @@ class Dmzj : ConfigurableSource, HttpSource() { throw UnsupportedOperationException() } - // for WebView, headers are not needed - override fun pageListRequest(chapter: SChapter) = GET("$baseUrl/view/${chapter.url}.html") + override fun getChapterUrl(chapter: SChapter) = "$baseUrl/view/${chapter.url}.html" override fun fetchPageList(chapter: SChapter): Observable> { val path = chapter.url