forked from recloudstream/cloudstream
fixed the qualities scraping in tenshi.moe
This commit is contained in:
parent
bb2928fa7b
commit
2ac8d45237
1 changed files with 12 additions and 17 deletions
|
@ -248,25 +248,20 @@ class TenshiProvider : MainAPI() {
|
||||||
): Boolean {
|
): Boolean {
|
||||||
val response = khttp.get(data)
|
val response = khttp.get(data)
|
||||||
val src = Jsoup.parse(response.text).selectFirst(".embed-responsive > iframe").attr("src")
|
val src = Jsoup.parse(response.text).selectFirst(".embed-responsive > iframe").attr("src")
|
||||||
val mp4moe = Jsoup.parse(khttp.get(src).text).selectFirst("video#player")
|
val mp4moe = Jsoup.parse(khttp.get(src, headers=mapOf("Referer" to data)).text).selectFirst("video#player")
|
||||||
|
|
||||||
for (source in mp4moe.select("source")) {
|
val sources = mp4moe.select("source").map {
|
||||||
try {
|
ExtractorLink(
|
||||||
val quality = source.attr("title")
|
this.name,
|
||||||
val link = source.attr("src")
|
"${this.name} ${it.attr("title")}" + if (it.attr("title").endsWith('p')) "" else 'p',
|
||||||
|
fixUrl(it.attr("src")),
|
||||||
|
this.mainUrl,
|
||||||
|
getQualityFromName(it.attr("title"))
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
callback.invoke(
|
for (source in sources) {
|
||||||
ExtractorLink(
|
callback.invoke(source)
|
||||||
this.name,
|
|
||||||
"${this.name} $quality" + if (quality.endsWith('p')) "" else 'p',
|
|
||||||
fixUrl(link),
|
|
||||||
this.mainUrl,
|
|
||||||
getQualityFromName(quality)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
} catch (e: Exception) {
|
|
||||||
//IDK
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue