fix(pt/rinecloud): Fix rinecloud extractor (#2734)
This commit is contained in:
parent
afb33b7e01
commit
facbb2a526
@ -14,20 +14,23 @@ class RineCloudExtractor(private val client: OkHttpClient, private val headers:
|
||||
|
||||
fun videosFromUrl(url: String): List<Video> {
|
||||
val playerDoc = client.newCall(GET(url, headers)).execute().asJsoup()
|
||||
val scriptData = playerDoc.selectFirst("script:containsData(JuicyCodes.Run)")
|
||||
val encodedScript = playerDoc.selectFirst("script:containsData(JuicyCodes.Run)")
|
||||
?.data()
|
||||
?: return emptyList()
|
||||
|
||||
val decodedData = scriptData.substringAfter("(").substringBefore(")")
|
||||
val script = if (encodedScript != null) {
|
||||
val decodedData = encodedScript.substringAfter("(").substringBefore(")")
|
||||
.split("+\"")
|
||||
.joinToString("") { it.replace("\"", "") }
|
||||
.let { Base64.decode(it, Base64.DEFAULT) }
|
||||
.let(::String)
|
||||
Unpacker.unpack(decodedData).ifEmpty { return emptyList() }
|
||||
} else {
|
||||
playerDoc.selectFirst("script:containsData(const player)")?.data()
|
||||
?: return emptyList()
|
||||
}
|
||||
|
||||
val unpackedJs = Unpacker.unpack(decodedData).ifEmpty { return emptyList() }
|
||||
|
||||
return if ("googlevideo" in unpackedJs) {
|
||||
unpackedJs.substringAfter("sources:").substringBefore("]")
|
||||
return if ("googlevideo" in script) {
|
||||
script.substringAfter("sources:").substringBefore("]")
|
||||
.split("{")
|
||||
.drop(1)
|
||||
.map {
|
||||
@ -36,7 +39,7 @@ class RineCloudExtractor(private val client: OkHttpClient, private val headers:
|
||||
Video(videoUrl, "Rinecloud - $quality", videoUrl, headers)
|
||||
}
|
||||
} else {
|
||||
val masterPlaylistUrl = unpackedJs.substringAfter("sources:")
|
||||
val masterPlaylistUrl = script.substringAfter("sources:")
|
||||
.substringAfter("file\":\"")
|
||||
.substringBefore('"')
|
||||
|
||||
|
@ -26,7 +26,7 @@ class AnimeStreamGenerator : ThemeSourceGenerator {
|
||||
SingleLang("LMAnime", "https://lmanime.com", "all", isNsfw = false, overrideVersionCode = 5),
|
||||
SingleLang("LuciferDonghua", "https://luciferdonghua.in", "en", isNsfw = false, overrideVersionCode = 3),
|
||||
SingleLang("MiniOppai", "https://minioppai.org", "id", isNsfw = true, overrideVersionCode = 3),
|
||||
SingleLang("RineCloud", "https://rine.cloud", "pt-BR", isNsfw = false, overrideVersionCode = 3),
|
||||
SingleLang("RineCloud", "https://rine.cloud", "pt-BR", isNsfw = false, overrideVersionCode = 4),
|
||||
SingleLang("TRAnimeCI", "https://tranimaci.com", "tr", isNsfw = false, overrideVersionCode = 1),
|
||||
)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user