parent
9c2cdd3729
commit
11ee82af81
2 changed files with 14 additions and 16 deletions
|
@ -3,7 +3,7 @@ ext {
|
||||||
extClass = '.RineCloud'
|
extClass = '.RineCloud'
|
||||||
themePkg = 'animestream'
|
themePkg = 'animestream'
|
||||||
baseUrl = 'https://rine.cloud'
|
baseUrl = 'https://rine.cloud'
|
||||||
overrideVersionCode = 9
|
overrideVersionCode = 10
|
||||||
}
|
}
|
||||||
|
|
||||||
apply from: "$rootDir/common.gradle"
|
apply from: "$rootDir/common.gradle"
|
||||||
|
|
|
@ -29,21 +29,19 @@ class RineCloudExtractor(private val client: OkHttpClient, private val headers:
|
||||||
?: return emptyList()
|
?: return emptyList()
|
||||||
}
|
}
|
||||||
|
|
||||||
return if ("googlevideo" in script) {
|
return script.substringAfter("sources:").substringBefore("]")
|
||||||
script.substringAfter("sources:").substringBefore("]")
|
.split("{")
|
||||||
.split("{")
|
.drop(1)
|
||||||
.drop(1)
|
.flatMap {
|
||||||
.map {
|
val videoUrl = it.substringAfter("\"file\"").substringAfter('"').substringBefore('"')
|
||||||
val videoUrl = it.substringAfter("file\":\"").substringBefore('"')
|
val quality = it.substringAfter("\"label\"").substringAfter('"').substringBefore('"').ifBlank { "Unknown" }
|
||||||
val quality = it.substringAfter("label\":\"").substringBefore('"')
|
|
||||||
Video(videoUrl, "Rinecloud - $quality", videoUrl, headers)
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
val masterPlaylistUrl = script.substringAfter("sources:")
|
|
||||||
.substringAfter("file\":\"")
|
|
||||||
.substringBefore('"')
|
|
||||||
|
|
||||||
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