sora: fix UHDMovies

This commit is contained in:
hexated 2023-03-31 04:18:33 +07:00
parent fa093cd1a0
commit e69a0f141d
3 changed files with 12 additions and 5 deletions

View File

@ -1,5 +1,5 @@
// use an integer for version numbers
version = 109
version = 110
cloudstream {

View File

@ -1282,13 +1282,13 @@ object SoraExtractor : SoraStream() {
}
sources.apmap { (quality, link) ->
val driveLink = bypassTechmny(link ?: return@apmap null)
val base = getBaseUrl(driveLink ?: return@apmap null)
val driveLink = if(link?.contains("driveleech") == true) bypassDriveleech(link) else bypassTechmny(link ?: return@apmap)
val base = getBaseUrl(driveLink ?: return@apmap)
val resDoc = app.get(driveLink).document
val bitLink = resDoc.selectFirst("a.btn.btn-outline-success")?.attr("href")
val downloadLink = if (bitLink.isNullOrEmpty()) {
val backupIframe = resDoc.select("a.btn.btn-outline-warning").attr("href")
extractBackupUHD(backupIframe ?: return@apmap null)
extractBackupUHD(backupIframe ?: return@apmap)
} else {
extractMirrorUHD(bitLink, base)
}
@ -1307,7 +1307,7 @@ object SoraExtractor : SoraStream() {
ExtractorLink(
"UHDMovies",
"UHDMovies $tags $size",
downloadLink ?: return@apmap null,
downloadLink ?: return@apmap,
"",
qualities
)

View File

@ -675,6 +675,13 @@ suspend fun bypassTechmny(url: String) : String? {
return fixUrl(path, getBaseUrl(driveUrl))
}
suspend fun bypassDriveleech(url: String) : String? {
val path = app.get(url).text.substringAfter("replace(\"")
.substringBefore("\")")
if (path == "/404") return null
return fixUrl(path, getBaseUrl(url))
}
private fun getTechmnyCookies(page: String): Triple<String, String, String> {
val cat = "rdst_cat"
val post = "rdst_post"