Webtoons.com Transaltion fix alternated translators nor loading (#11101)

* Fix support for alternate translators

* Update WebtoonsTranslateGenerator.kt
This commit is contained in:
jopejoe1 2022-03-15 10:38:37 +13:00 committed by GitHub
parent 7a813e13b0
commit 606c79215d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -165,8 +165,9 @@ open class WebtoonsTranslate(
override fun pageListParse(document: Document): List<Page> = throw Exception("Not used") override fun pageListParse(document: Document): List<Page> = throw Exception("Not used")
override fun chapterListRequest(manga: SManga): Request { override fun chapterListRequest(manga: SManga): Request {
val titleNo = manga.url.toHttpUrlOrNull()!! val mangaUrl = manga.url.toHttpUrlOrNull()!!
.queryParameter("titleNo") val titleNo = mangaUrl.queryParameter("titleNo")
val teamVersion = mangaUrl.queryParameter("teamVersion")
val chapterListUrl = apiBaseUrl val chapterListUrl = apiBaseUrl
.resolve("/lineWebtoon/ctrans/translatedEpisodes_jsonp.json")!! .resolve("/lineWebtoon/ctrans/translatedEpisodes_jsonp.json")!!
.newBuilder() .newBuilder()
@ -174,6 +175,7 @@ open class WebtoonsTranslate(
.addQueryParameter("languageCode", translateLangCode) .addQueryParameter("languageCode", translateLangCode)
.addQueryParameter("offset", "0") .addQueryParameter("offset", "0")
.addQueryParameter("limit", "10000") .addQueryParameter("limit", "10000")
.addQueryParameter("teamVersion", teamVersion)
.toString() .toString()
return GET(chapterListUrl, mobileHeaders) return GET(chapterListUrl, mobileHeaders)
} }

View File

@ -11,7 +11,7 @@ class WebtoonsTranslateGenerator : ThemeSourceGenerator {
override val baseVersionCode: Int = 2 override val baseVersionCode: Int = 2
override val sources = listOf( override val sources = listOf(
MultiLang("Webtoons.com Translations", "https://translate.webtoons.com", listOf("en", "zh-Hans", "zh-Hant", "th", "id", "fr", "vi", "ru", "ar", "fil", "de", "hi", "it", "ja", "pt-BR", "tr", "ms", "pl", "pt", "bg", "da", "nl", "ro", "mn", "el", "lt", "cs", "sv", "bn", "fa", "uk", "es"), className = "WebtoonsTranslateFactory", pkgName = "webtoonstranslate", overrideVersionCode = 2), MultiLang("Webtoons.com Translations", "https://translate.webtoons.com", listOf("en", "zh-Hans", "zh-Hant", "th", "id", "fr", "vi", "ru", "ar", "fil", "de", "hi", "it", "ja", "pt-BR", "tr", "ms", "pl", "pt", "bg", "da", "nl", "ro", "mn", "el", "lt", "cs", "sv", "bn", "fa", "uk", "es"), className = "WebtoonsTranslateFactory", pkgName = "webtoonstranslate", overrideVersionCode = 3),
) )
companion object { companion object {