fixed SoraExtractor source

This commit is contained in:
hexated 2022-10-17 16:03:17 +07:00
parent 7d95adf87e
commit 09c6347589

View file

@ -116,16 +116,25 @@ object SoraExtractor : SoraStream() {
subtitleCallback: (SubtitleFile) -> Unit, subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit callback: (ExtractorLink) -> Unit
) { ) {
val url = if (season == null) {
"$dbgoAPI/imdb.php?id=$id"
} else {
"$dbgoAPI/imdbse.php?id=$id&s=$season&e=$episode"
}
val doc = app.get(url).document var iframeDbgo: String? = null
val iframe = doc.select("div.myvideo iframe").attr("src") val script = if (season == null) {
val script = app.get(iframe, referer = "$dbgoAPI/").document.select("script") val doc = app.get("$dbgoAPI/imdb.php?id=$id").document
.find { it.data().contains("CDNplayerConfig =") }?.data() iframeDbgo = doc.select("div.myvideo iframe").attr("src")
app.get(iframeDbgo, referer = "$dbgoAPI/").document.select("script")
.find { it.data().contains("CDNplayerConfig =") }?.data()
} else {
val doc = app.get("$dbgoAPI/tv-imdb.php?id=$id&s=$season").document
iframeDbgo = doc.select("div.myvideo iframe").attr("src")
val token = app.get(
iframeDbgo,
referer = "$dbgoAPI/"
).document.selectFirst("select#translator-name option")?.attr("data-token")
app.get("https://voidboost.net/serial/$token/iframe?s=$season&e=$episode&h=dbgo.fun").document.select(
"script"
)
.find { it.data().contains("CDNplayerConfig =") }?.data()
}
val source = val source =
Regex("['|\"]file['|\"]:\\s['|\"](#\\S+?)['|\"]").find(script.toString())?.groupValues?.get( Regex("['|\"]file['|\"]:\\s['|\"](#\\S+?)['|\"]").find(script.toString())?.groupValues?.get(
@ -147,11 +156,11 @@ object SoraExtractor : SoraStream() {
name, name,
name, name,
link, link,
"${getBaseUrl(iframe)}/", "${getBaseUrl(iframeDbgo)}/",
getQuality(quality), getQuality(quality),
isM3u8 = link.contains(".m3u8"), isM3u8 = link.contains(".m3u8"),
headers = mapOf( headers = mapOf(
"Origin" to getBaseUrl(iframe) "Origin" to getBaseUrl(iframeDbgo)
) )
) )
) )