diff --git a/lib/gogostream-extractor/build.gradle.kts b/lib/gogostream-extractor/build.gradle.kts new file mode 100644 index 0000000000..95a8119ba7 --- /dev/null +++ b/lib/gogostream-extractor/build.gradle.kts @@ -0,0 +1,19 @@ +plugins { + id("com.android.library") + kotlin("android") + id("kotlinx-serialization") +} + +android { + compileSdk = AndroidConfig.compileSdk + namespace = "eu.kanade.tachiyomi.lib.gogostreamextractor" + + defaultConfig { + minSdk = AndroidConfig.minSdk + } +} + +dependencies { + compileOnly(libs.bundles.common) + implementation(project(":lib-playlist-utils")) +} diff --git a/lib/gogostream-extractor/src/main/java/eu/kanade/tachiyomi/lib/gogostreamextractor/GogoStreamExtractor.kt b/lib/gogostream-extractor/src/main/java/eu/kanade/tachiyomi/lib/gogostreamextractor/GogoStreamExtractor.kt new file mode 100644 index 0000000000..1fc0f1fb5f --- /dev/null +++ b/lib/gogostream-extractor/src/main/java/eu/kanade/tachiyomi/lib/gogostreamextractor/GogoStreamExtractor.kt @@ -0,0 +1,97 @@ +package eu.kanade.tachiyomi.lib.gogostreamextractor + +import android.util.Base64 +import eu.kanade.tachiyomi.animesource.model.Video +import eu.kanade.tachiyomi.network.GET +import eu.kanade.tachiyomi.util.asJsoup +import kotlinx.serialization.json.Json +import okhttp3.Headers +import eu.kanade.tachiyomi.lib.playlistutils.PlaylistUtils +import okhttp3.HttpUrl.Companion.toHttpUrl +import okhttp3.OkHttpClient +import java.lang.Exception +import java.util.Locale +import org.jsoup.nodes.Element +import javax.crypto.Cipher +import javax.crypto.spec.IvParameterSpec +import javax.crypto.spec.SecretKeySpec +import uy.kohesive.injekt.injectLazy + +class GogoStreamExtractor(private val client: OkHttpClient) { + private val json: Json by injectLazy() + private val playlistUtils by lazy { PlaylistUtils(client) } + + private fun Element.getBytesAfter(item: String) = className() + .substringAfter(item) + .filter(Char::isDigit) + .toByteArray() + + fun videosFromUrl(serverUrl: String): List