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 // use an integer for version numbers
version = 109 version = 110
cloudstream { cloudstream {

View file

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

View file

@ -675,6 +675,13 @@ suspend fun bypassTechmny(url: String) : String? {
return fixUrl(path, getBaseUrl(driveUrl)) 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> { private fun getTechmnyCookies(page: String): Triple<String, String, String> {
val cat = "rdst_cat" val cat = "rdst_cat"
val post = "rdst_post" val post = "rdst_post"