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,7 +148,13 @@ 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(
doc.select(".downloadLinks a").attr("href") to "download",
doc.select("iframe[name=\"player_iframe\"]").attr("src") to "iframe"
).apmap { (url, method) ->
if(method == "download") {
val player = app.get(url, interceptor = CloudflareKiller(), referer = mainUrl).document
println(player)
callback.invoke( callback.invoke(
ExtractorLink( ExtractorLink(
this.name, this.name,
@ -158,11 +164,12 @@ class FaselHD : MainAPI() {
Qualities.Unknown.value Qualities.Unknown.value
) )
) )
} else if(method == "iframe") {
val webView = WebViewResolver( val webView = WebViewResolver(
Regex("""master\.m3u8""") Regex("""master\.m3u8""")
).resolveUsingWebView( ).resolveUsingWebView(
requestCreator( requestCreator(
"GET", doc.select("iframe[name=\"player_iframe\"]").attr("src"), referer = mainUrl "GET", url, referer = mainUrl
) )
).first ).first
M3u8Helper.generateM3u8( M3u8Helper.generateM3u8(
@ -170,6 +177,8 @@ class FaselHD : MainAPI() {
webView?.url.toString(), webView?.url.toString(),
referer = mainUrl referer = mainUrl
).forEach(callback) ).forEach(callback)
}
}
return true return true
} }
} }