small fix

This commit is contained in:
hexated 2023-09-16 04:56:44 +07:00
parent 86f2735502
commit 87f99f31f9

View file

@ -2438,7 +2438,7 @@ object SoraExtractor : SoraStream() {
"shows/view/$urlSlug" "shows/view/$urlSlug"
} }
val streamUrl = app.get("$monsterMainUrl/$viewSlug").document.select("a.round-button:first-child").attr("href") val streamUrl = app.get("$monsterMainUrl/$viewSlug").document.select("a.round-button:first-child").attr("href")
val res = app.get(streamUrl).document val res = app.get(fixUrl(streamUrl, monsterMainUrl)).document
val script = res.selectFirst("script:containsData(hash:)")?.data() val script = res.selectFirst("script:containsData(hash:)")?.data()
val hash = val hash =
Regex("hash:\\s*['\"](\\S+)['\"],").find(script ?: return)?.groupValues?.get(1) Regex("hash:\\s*['\"](\\S+)['\"],").find(script ?: return)?.groupValues?.get(1)
@ -2450,7 +2450,7 @@ object SoraExtractor : SoraStream() {
"$monsterMainUrl/api/v1/security/episode-access?id_episode=$episodeId&hash=$hash&expires=$expires" "$monsterMainUrl/api/v1/security/episode-access?id_episode=$episodeId&hash=$hash&expires=$expires"
} }
app.get(videoUrl, referer = streamUrl) app.get(videoUrl, referer = streamUrl, headers = mapOf("X-Requested-With" to "XMLHttpRequest"))
.parsedSafe<WatchOnlineResponse>()?.streams?.mapKeys { source -> .parsedSafe<WatchOnlineResponse>()?.streams?.mapKeys { source ->
callback.invoke( callback.invoke(
ExtractorLink( ExtractorLink(