FaselHD fixed

This commit is contained in:
Zaw 2022-08-28 15:36:55 +03:00
parent 5fb40f4a5a
commit 277ea990cb
2 changed files with 18 additions and 28 deletions

View file

@ -1,4 +1,4 @@
version = 1 version = 2
cloudstream { cloudstream {
description = "" description = ""

View file

@ -3,8 +3,9 @@ package com.faselhd
import com.lagradost.cloudstream3.* import com.lagradost.cloudstream3.*
import com.lagradost.cloudstream3.utils.ExtractorLink import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.network.CloudflareKiller import com.lagradost.nicehttp.requestCreator
import com.lagradost.cloudstream3.utils.Qualities import com.lagradost.cloudstream3.network.WebViewResolver
import com.lagradost.cloudstream3.utils.M3u8Helper
import org.jsoup.nodes.Element import org.jsoup.nodes.Element
class FaselHD : MainAPI() { class FaselHD : MainAPI() {
@ -15,7 +16,6 @@ class FaselHD : MainAPI() {
override val hasMainPage = true override val hasMainPage = true
override val supportedTypes = setOf(TvType.TvSeries, TvType.Movie, TvType.AsianDrama, TvType.Anime) override val supportedTypes = setOf(TvType.TvSeries, TvType.Movie, TvType.AsianDrama, TvType.Anime)
val cfKiller = CloudflareKiller()
private fun String.getIntFromText(): Int? { private fun String.getIntFromText(): Int? {
return Regex("""\d+""").find(this)?.groupValues?.firstOrNull()?.toIntOrNull() return Regex("""\d+""").find(this)?.groupValues?.firstOrNull()?.toIntOrNull()
} }
@ -145,29 +145,19 @@ class FaselHD : MainAPI() {
subtitleCallback: (SubtitleFile) -> Unit, subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit callback: (ExtractorLink) -> Unit
): Boolean { ): Boolean {
val player = app.get(app.get(data).document.select(".downloadLinks a").attr("href"), interceptor = cfKiller, referer = data).document val urlToRequest = app.get(data).document.select("iframe[name=\"player_iframe\"]").attr("src")
val webView = WebViewResolver(
callback.invoke( Regex("""master\.m3u8""")
ExtractorLink( ).resolveUsingWebView(
this.name, requestCreator(
this.name, "GET", urlToRequest, referer = mainUrl
player.select("div.dl-link a").attr("href"), )
this.mainUrl, ).first
Qualities.Unknown.value M3u8Helper.generateM3u8(
) this.name,
) webView?.url.toString(),
//player.select("div.quality_change button.hd_btn").map { referer = mainUrl
// callback.invoke( ).forEach(callback)
// ExtractorLink(
// this.name,
// this.name,
// it.attr("data-url"),
// this.mainUrl,
// quality = it.text().getIntFromText() ?: Qualities.Unknown.value,
// isM3u8 = true
// )
// )
//}
return true return true
} }
} }