fixed Animixplay main server

This commit is contained in:
hexated 2022-10-04 05:03:23 +07:00
parent de37a1a597
commit 2e12876f90
3 changed files with 20 additions and 8 deletions

View file

@ -1,5 +1,5 @@
// use an integer for version numbers // use an integer for version numbers
version = 3 version = 4
cloudstream { cloudstream {

View file

@ -188,7 +188,7 @@ class Animixplay : MainAPI() {
).parsedSafe<DataAni>()?.data?.media?.id ).parsedSafe<DataAni>()?.data?.media?.id
val res = app.get("$mainUrl/assets/mal/$malId.json").parsedSafe<AnimeDetail>() val res = app.get("$mainUrl/assets/mal/$malId.json").parsedSafe<AnimeDetail>()
?: throw ErrorLoadingException("Invalid json responses") ?: throw ErrorLoadingException("No data found")
val subEpisodes = mutableListOf<Episode>() val subEpisodes = mutableListOf<Episode>()
val dubEpisodes = mutableListOf<Episode>() val dubEpisodes = mutableListOf<Episode>()

View file

@ -140,12 +140,24 @@ class GogoanimeProvider : MainAPI() {
source: GogoSource, source: GogoSource,
sourceCallback: (ExtractorLink) -> Unit sourceCallback: (ExtractorLink) -> Unit
) { ) {
if (source.file.contains(".m3u8")) {
M3u8Helper.generateM3u8( M3u8Helper.generateM3u8(
mainApiName, mainApiName,
source.file, source.file,
mainUrl, mainUrl,
headers = mapOf("Origin" to "https://plyr.link") headers = mapOf("Origin" to "https://plyr.link")
).forEach(sourceCallback) ).forEach(sourceCallback)
} else {
sourceCallback.invoke(
ExtractorLink(
mainApiName,
mainApiName,
source.file,
mainUrl,
getQualityFromName(source.label),
)
)
}
} }
sources.source?.forEach { sources.source?.forEach {