From d4ff3f65eeafeef35317d9c5f309e31475deaae5 Mon Sep 17 00:00:00 2001 From: hexated Date: Sat, 1 Oct 2022 14:29:56 +0700 Subject: [PATCH] fixed Animixplay movie --- Animixplay/build.gradle.kts | 2 +- .../src/main/kotlin/com/hexated/Animixplay.kt | 2 +- .../kotlin/com/hexated/GogoanimeProvider.kt | 27 ++++++------------- 3 files changed, 10 insertions(+), 21 deletions(-) diff --git a/Animixplay/build.gradle.kts b/Animixplay/build.gradle.kts index d3a2ba0c..baaa5491 100644 --- a/Animixplay/build.gradle.kts +++ b/Animixplay/build.gradle.kts @@ -1,5 +1,5 @@ // use an integer for version numbers -version = 1 +version = 2 cloudstream { diff --git a/Animixplay/src/main/kotlin/com/hexated/Animixplay.kt b/Animixplay/src/main/kotlin/com/hexated/Animixplay.kt index b59cc40e..73981481 100644 --- a/Animixplay/src/main/kotlin/com/hexated/Animixplay.kt +++ b/Animixplay/src/main/kotlin/com/hexated/Animixplay.kt @@ -202,7 +202,7 @@ class Animixplay : MainAPI() { return newAnimeLoadResponse( res.title ?: return null, url, - getType(res.type) + TvType.Anime ) { engName = res.title posterUrl = res.imageUrl diff --git a/Animixplay/src/main/kotlin/com/hexated/GogoanimeProvider.kt b/Animixplay/src/main/kotlin/com/hexated/GogoanimeProvider.kt index edf66dd0..901afe50 100644 --- a/Animixplay/src/main/kotlin/com/hexated/GogoanimeProvider.kt +++ b/Animixplay/src/main/kotlin/com/hexated/GogoanimeProvider.kt @@ -4,10 +4,7 @@ import com.fasterxml.jackson.annotation.JsonProperty import com.lagradost.cloudstream3.* import com.lagradost.cloudstream3.mvvm.normalSafeApiCall import com.lagradost.cloudstream3.mvvm.safeApiCall -import com.lagradost.cloudstream3.utils.AppUtils -import com.lagradost.cloudstream3.utils.ExtractorLink -import com.lagradost.cloudstream3.utils.getQualityFromName -import com.lagradost.cloudstream3.utils.loadExtractor +import com.lagradost.cloudstream3.utils.* import org.jsoup.Jsoup import org.jsoup.nodes.Document import java.net.URI @@ -139,24 +136,16 @@ class GogoanimeProvider : MainAPI() { val datadecrypted = cryptoHandler(dataencrypted, foundIv, foundDecryptKey, false) val sources = AppUtils.parseJson(datadecrypted) - fun invokeGogoSource( + suspend fun invokeGogoSource( source: GogoSource, sourceCallback: (ExtractorLink) -> Unit ) { - sourceCallback.invoke( - ExtractorLink( - mainApiName, - mainApiName, - source.file, - mainUrl, - getQualityFromName(source.label), - isM3u8 = source.type == "hls" || source.label?.contains( - "auto", - ignoreCase = true - ) == true, - mapOf("Origin" to "https://gogohd.net") - ) - ) + M3u8Helper.generateM3u8( + mainApiName, + source.file, + mainUrl, + headers = mapOf("Origin" to "https://plyr.link") + ).forEach(sourceCallback) } sources.source?.forEach {