FaselHD fixed
This commit is contained in:
parent
5fb40f4a5a
commit
277ea990cb
2 changed files with 18 additions and 28 deletions
|
@ -1,4 +1,4 @@
|
||||||
version = 1
|
version = 2
|
||||||
|
|
||||||
cloudstream {
|
cloudstream {
|
||||||
description = ""
|
description = ""
|
||||||
|
|
|
@ -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,
|
|
||||||
Qualities.Unknown.value
|
|
||||||
)
|
)
|
||||||
)
|
).first
|
||||||
//player.select("div.quality_change button.hd_btn").map {
|
M3u8Helper.generateM3u8(
|
||||||
// callback.invoke(
|
this.name,
|
||||||
// ExtractorLink(
|
webView?.url.toString(),
|
||||||
// this.name,
|
referer = mainUrl
|
||||||
// this.name,
|
).forEach(callback)
|
||||||
// it.attr("data-url"),
|
|
||||||
// this.mainUrl,
|
|
||||||
// quality = it.text().getIntFromText() ?: Qualities.Unknown.value,
|
|
||||||
// isM3u8 = true
|
|
||||||
// )
|
|
||||||
// )
|
|
||||||
//}
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue