maybe a fix for faselhd

This commit is contained in:
Zaw 2022-09-01 12:02:44 +03:00
parent 76cff3549f
commit 41c0c35f79

View file

@ -148,28 +148,37 @@ class FaselHD : MainAPI() {
callback: (ExtractorLink) -> Unit callback: (ExtractorLink) -> Unit
): Boolean { ): Boolean {
val doc = app.get(data).document val doc = app.get(data).document
val player = app.get(doc.select(".downloadLinks a").attr("href"), interceptor = CloudflareKiller(), referer = data).document listOf(
callback.invoke( doc.select(".downloadLinks a").attr("href") to "download",
ExtractorLink( doc.select("iframe[name=\"player_iframe\"]").attr("src") to "iframe"
this.name, ).apmap { (url, method) ->
this.name + "Download Source", if(method == "download") {
player.select("div.dl-link a").attr("href"), val player = app.get(url, interceptor = CloudflareKiller(), referer = mainUrl).document
this.mainUrl, println(player)
Qualities.Unknown.value callback.invoke(
) ExtractorLink(
) this.name,
val webView = WebViewResolver( this.name + " Download Source",
Regex("""master\.m3u8""") player.select("div.dl-link a").attr("href"),
).resolveUsingWebView( this.mainUrl,
requestCreator( Qualities.Unknown.value
"GET", doc.select("iframe[name=\"player_iframe\"]").attr("src"), referer = mainUrl )
) )
).first } else if(method == "iframe") {
M3u8Helper.generateM3u8( val webView = WebViewResolver(
this.name, Regex("""master\.m3u8""")
webView?.url.toString(), ).resolveUsingWebView(
referer = mainUrl requestCreator(
).forEach(callback) "GET", url, referer = mainUrl
)
).first
M3u8Helper.generateM3u8(
this.name,
webView?.url.toString(),
referer = mainUrl
).forEach(callback)
}
}
return true return true
} }
} }