From 66a097714dc7fb4106944f5035250ffa206fc8ad Mon Sep 17 00:00:00 2001 From: hollow <35398794+hollowshiroyuki@users.noreply.github.com> Date: Wed, 27 Mar 2024 10:03:43 +0000 Subject: [PATCH 1/2] fix(lib/streamhidevid): Fix getting playlist url from the page if unpacking fails (#3080) --- lib/streamhidevid-extractor/build.gradle.kts | 1 + .../StreamHideVidExtractor.kt | 29 ++++++------------- 2 files changed, 10 insertions(+), 20 deletions(-) diff --git a/lib/streamhidevid-extractor/build.gradle.kts b/lib/streamhidevid-extractor/build.gradle.kts index 7e089728a6..86e567adac 100644 --- a/lib/streamhidevid-extractor/build.gradle.kts +++ b/lib/streamhidevid-extractor/build.gradle.kts @@ -3,6 +3,7 @@ plugins { } dependencies { + implementation(project(":lib:playlist-utils")) implementation("dev.datlag.jsunpacker:jsunpacker:1.0.1") { exclude(group = "org.jetbrains.kotlin", module = "kotlin-stdlib-jdk8") } diff --git a/lib/streamhidevid-extractor/src/main/java/eu/kanade/tachiyomi/lib/streamhidevidextractor/StreamHideVidExtractor.kt b/lib/streamhidevid-extractor/src/main/java/eu/kanade/tachiyomi/lib/streamhidevidextractor/StreamHideVidExtractor.kt index 6b06f90ddc..87daac7ac8 100644 --- a/lib/streamhidevid-extractor/src/main/java/eu/kanade/tachiyomi/lib/streamhidevidextractor/StreamHideVidExtractor.kt +++ b/lib/streamhidevid-extractor/src/main/java/eu/kanade/tachiyomi/lib/streamhidevidextractor/StreamHideVidExtractor.kt @@ -1,36 +1,25 @@ package eu.kanade.tachiyomi.lib.streamhidevidextractor import dev.datlag.jsunpacker.JsUnpacker -import eu.kanade.tachiyomi.animesource.model.Track import eu.kanade.tachiyomi.animesource.model.Video +import eu.kanade.tachiyomi.lib.playlistutils.PlaylistUtils import eu.kanade.tachiyomi.network.GET import okhttp3.OkHttpClient class StreamHideVidExtractor(private val client: OkHttpClient) { - // from nineanime / ask4movie FilemoonExtractor - private val subtitleRegex = Regex("""#EXT-X-MEDIA:TYPE=SUBTITLES.*?NAME="(.*?)".*?URI="(.*?)"""") + + private val playlistUtils by lazy { PlaylistUtils(client) } fun videosFromUrl(url: String, prefix: String = ""): List