From 419d9a7a641ef634da0f39e3d9da76e05cf9ef4c Mon Sep 17 00:00:00 2001 From: Edgard Lorraine Messias Date: Fri, 29 Mar 2024 13:04:03 -0300 Subject: [PATCH] fix(pt/goanimes): Fix video extraction (#3079) --- src/pt/goanimes/build.gradle | 2 +- .../animeextension/pt/goanimes/GoAnimes.kt | 5 ++- .../goanimes/extractors/GoAnimesExtractor.kt | 36 ++++++++++++++++--- .../goanimes/extractors/PlaylistExtractor.kt | 15 ++++++-- 4 files changed, 48 insertions(+), 10 deletions(-) diff --git a/src/pt/goanimes/build.gradle b/src/pt/goanimes/build.gradle index f6b1f1c354..fff275fa7a 100644 --- a/src/pt/goanimes/build.gradle +++ b/src/pt/goanimes/build.gradle @@ -3,7 +3,7 @@ ext { extClass = '.GoAnimes' themePkg = 'dooplay' baseUrl = 'https://goanimes.net' - overrideVersionCode = 11 + overrideVersionCode = 12 isNsfw = true } diff --git a/src/pt/goanimes/src/eu/kanade/tachiyomi/animeextension/pt/goanimes/GoAnimes.kt b/src/pt/goanimes/src/eu/kanade/tachiyomi/animeextension/pt/goanimes/GoAnimes.kt index f308e89ae5..a5f5af152a 100644 --- a/src/pt/goanimes/src/eu/kanade/tachiyomi/animeextension/pt/goanimes/GoAnimes.kt +++ b/src/pt/goanimes/src/eu/kanade/tachiyomi/animeextension/pt/goanimes/GoAnimes.kt @@ -86,7 +86,6 @@ class GoAnimes : DooPlay( .replace("SD", "480p") val url = getPlayerUrl(player) return when { - "player5.goanimes.net" in url -> goanimesExtractor.videosFromUrl(url, name) "https://gojopoolt" in url -> { val headers = headers.newBuilder() .set("referer", url) @@ -129,7 +128,7 @@ class GoAnimes : DooPlay( listOf("/bloggerjwplayer", "/m3u8", "/multivideo").any { it in url } -> { val script = client.newCall(GET(url)).await() .body.string() - .let(JsDecoder::decodeScript) + .let { JsDecoder.decodeScript(it, true).ifBlank { JsDecoder.decodeScript(it, false).ifBlank { it } } } when { "/bloggerjwplayer" in url -> BloggerJWPlayerExtractor.videosFromScript(script) @@ -145,7 +144,7 @@ class GoAnimes : DooPlay( } } "www.blogger.com" in url -> bloggerExtractor.videosFromUrl(url, headers) - else -> emptyList