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 {
description = ""

View file

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