parent
9c2cdd3729
commit
11ee82af81
2 changed files with 14 additions and 16 deletions
|
@ -3,7 +3,7 @@ ext {
|
|||
extClass = '.RineCloud'
|
||||
themePkg = 'animestream'
|
||||
baseUrl = 'https://rine.cloud'
|
||||
overrideVersionCode = 9
|
||||
overrideVersionCode = 10
|
||||
}
|
||||
|
||||
apply from: "$rootDir/common.gradle"
|
||||
|
|
|
@ -29,21 +29,19 @@ class RineCloudExtractor(private val client: OkHttpClient, private val headers:
|
|||
?: return emptyList()
|
||||
}
|
||||
|
||||
return if ("googlevideo" in script) {
|
||||
script.substringAfter("sources:").substringBefore("]")
|
||||
.split("{")
|
||||
.drop(1)
|
||||
.map {
|
||||
val videoUrl = it.substringAfter("file\":\"").substringBefore('"')
|
||||
val quality = it.substringAfter("label\":\"").substringBefore('"')
|
||||
Video(videoUrl, "Rinecloud - $quality", videoUrl, headers)
|
||||
}
|
||||
} else {
|
||||
val masterPlaylistUrl = script.substringAfter("sources:")
|
||||
.substringAfter("file\":\"")
|
||||
.substringBefore('"')
|
||||
return script.substringAfter("sources:").substringBefore("]")
|
||||
.split("{")
|
||||
.drop(1)
|
||||
.flatMap {
|
||||
val videoUrl = it.substringAfter("\"file\"").substringAfter('"').substringBefore('"')
|
||||
val quality = it.substringAfter("\"label\"").substringAfter('"').substringBefore('"').ifBlank { "Unknown" }
|
||||
|
||||
playlistUtils.extractFromHls(masterPlaylistUrl, videoNameGen = { "Rinecloud - $it" })
|
||||
}
|
||||
when {
|
||||
arrayOf("googlevideo", ".mp4").any(videoUrl) -> listOf(Video(videoUrl, "Rinecloud - $quality", videoUrl, headers))
|
||||
else -> playlistUtils.extractFromHls(videoUrl, videoNameGen = { "Rinecloud - ${if (it == "Video") quality else it}" })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun Array<String>.any(url: String): Boolean = this.any { url.contains(it, ignoreCase = true) }
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue