package com.hexated import com.lagradost.cloudstream3.SubtitleFile import com.lagradost.cloudstream3.app import com.lagradost.cloudstream3.extractors.Chillx import com.lagradost.cloudstream3.utils.* class Sbnmp : ExtractorApi() { override val name = "Sbnmp" override var mainUrl = "https://sbnmp.bar" override val requiresReferer = true override suspend fun getUrl( url: String, referer: String?, subtitleCallback: (SubtitleFile) -> Unit, callback: (ExtractorLink) -> Unit ) { val response = app.get(url, referer = referer) val script = if (!getPacked(response.text).isNullOrEmpty()) { getAndUnpack(response.text) } else { response.document.selectFirst("script:containsData(sources:)")?.data() } val m3u8 = Regex("file:\\s*\"(.*?m3u8.*?)\"").find(script ?: return)?.groupValues?.getOrNull(1) callback.invoke( ExtractorLink( this.name, this.name, m3u8 ?: return, mainUrl, Qualities.Unknown.value, INFER_TYPE, ) ) } } open class Akamaicdn : ExtractorApi() { override val name = "Akamaicdn" override val mainUrl = "https://akamaicdn.life" override val requiresReferer = true override suspend fun getUrl( url: String, referer: String?, subtitleCallback: (SubtitleFile) -> Unit, callback: (ExtractorLink) -> Unit ) { val res = app.get(url, referer = referer).document val mappers = res.selectFirst("script:containsData(sniff\\()")?.data()?.substringAfter("sniff(") ?.substringBefore(");") ?: return val ids = mappers.split(",").map { it.replace("\"", "") } callback.invoke( ExtractorLink( this.name, this.name, "$mainUrl/m3u8/${ids[1]}/${ids[2]}/master.txt?s=1&cache=1", url, Qualities.Unknown.value, isM3u8 = true, ) ) } } class AnimesagaStream : Chillx() { override val name = "AnimesagaStream" override val mainUrl = "https://stream.anplay.in" }