sora: fixed Movie123Net

This commit is contained in:
hexated 2023-02-11 17:50:38 +07:00
parent ea0b76509d
commit 796c67c7ef
3 changed files with 24 additions and 14 deletions

View File

@ -1838,7 +1838,7 @@ object SoraExtractor : SoraStream() {
it.t?.equals( it.t?.equals(
"$title - Season $season", "$title - Season $season",
true true
) == true || it.s?.contains("$fixTitle-season-$season", true) == true ) == true || it.s?.contains("$fixTitle-season-$season-", true) == true
} }
}?.s?.substringAfterLast("-") ?: return }?.s?.substringAfterLast("-") ?: return
@ -2348,15 +2348,14 @@ object SoraExtractor : SoraStream() {
// removed due to rate limit // removed due to rate limit
// if (!app.get(path).isSuccessful) return@apmap null // if (!app.get(path).isSuccessful) return@apmap null
val size = file.size?.toDouble() ?: return@apmap null val size = "%.2f GB".format(bytesToGigaBytes(file.size?.toDouble() ?: return@apmap null))
val sizeFile = "%.2f GB".format(bytesToGigaBytes(size))
val quality = getIndexQuality(file.name) val quality = getIndexQuality(file.name)
val tags = getIndexQualityTags(file.name) val tags = getIndexQualityTags(file.name)
callback.invoke( callback.invoke(
ExtractorLink( ExtractorLink(
"$api $tags [$sizeFile]", "$api $tags [$size]",
"$api $tags [$sizeFile]", "$api $tags [$size]",
path, path,
"", "",
quality, quality,

View File

@ -85,7 +85,7 @@ open class SoraStream : TmdbProvider() {
const val series9API = "https://series9.la" const val series9API = "https://series9.la"
const val idlixAPI = "https://idlixian.com" const val idlixAPI = "https://idlixian.com"
const val noverseAPI = "https://www.nollyverse.com" const val noverseAPI = "https://www.nollyverse.com"
const val olgplyAPI = "https://olgply.xyz" const val olgplyAPI = "https://olgply.xyz" // dead
const val uniqueStreamAPI = "https://uniquestreaming.net" const val uniqueStreamAPI = "https://uniquestreaming.net"
const val filmxyAPI = "https://www.filmxy.vip" const val filmxyAPI = "https://www.filmxy.vip"
const val kimcartoonAPI = "https://kimcartoon.li" const val kimcartoonAPI = "https://kimcartoon.li"

View File

@ -82,7 +82,10 @@ fun String.filterIframe(seasonNum: Int?, lastSeason: Int?, year: Int?, title: St
) )
} }
} else { } else {
this.contains(Regex("(?i)($year)|($dotSlug)|($spaceSlug)")) && !this.contains("Download", true) this.contains(Regex("(?i)($year)|($dotSlug)|($spaceSlug)")) && !this.contains(
"Download",
true
)
} }
} }
@ -116,13 +119,13 @@ suspend fun extractMirrorUHD(url: String, ref: String): String? {
var downLink = baseDoc.getMirrorLink() var downLink = baseDoc.getMirrorLink()
run lit@{ run lit@{
(1..2).forEach { (1..2).forEach {
if(downLink != null) return@lit if (downLink != null) return@lit
val server = baseDoc.getMirrorServer(it.plus(1)) val server = baseDoc.getMirrorServer(it.plus(1))
baseDoc = app.get(fixUrl(server, ref)).document baseDoc = app.get(fixUrl(server, ref)).document
downLink = baseDoc.getMirrorLink() downLink = baseDoc.getMirrorLink()
} }
} }
if(downLink?.contains(".mkv") == true || downLink?.contains(".mp4") == true) return downLink if (downLink?.contains(".mkv") == true || downLink?.contains(".mp4") == true) return downLink
val downPage = app.get(downLink ?: return null).document val downPage = app.get(downLink ?: return null).document
return downPage.selectFirst("form[method=post] a.btn.btn-success") return downPage.selectFirst("form[method=post] a.btn.btn-success")
?.attr("onclick")?.substringAfter("Openblank('")?.substringBefore("')") ?: run { ?.attr("onclick")?.substringAfter("Openblank('")?.substringBefore("')") ?: run {
@ -270,7 +273,12 @@ suspend fun getDrivebotLink(url: String?): String? {
referer = url referer = url
).parsedSafe<DriveBotLink>()?.url ?: return null ).parsedSafe<DriveBotLink>()?.url ?: return null
return app.get(fixUrl(file, baseUrl)).document.selectFirst("script:containsData(window.open)") return if (file.startsWith("http")) file else app.get(
fixUrl(
file,
baseUrl
)
).document.selectFirst("script:containsData(window.open)")
?.data()?.substringAfter("window.open('")?.substringBefore("')") ?.data()?.substringAfter("window.open('")?.substringBefore("')")
} }
@ -641,6 +649,7 @@ fun decodeIndexJson(json: String): String {
val slug = json.reversed().substring(24) val slug = json.reversed().substring(24)
return base64Decode(slug.substring(0, slug.length - 20)) return base64Decode(slug.substring(0, slug.length - 20))
} }
fun String?.createSlug(): String? { fun String?.createSlug(): String? {
return this?.replace(Regex("[!%:'?,]|( &)"), "")?.replace(" ", "-")?.lowercase() return this?.replace(Regex("[!%:'?,]|( &)"), "")?.replace(" ", "-")?.lowercase()
?.replace("--", "-") ?.replace("--", "-")
@ -650,18 +659,20 @@ fun getLanguage(str: String): String {
return if (str.contains("(in_ID)")) "Indonesian" else str return if (str.contains("(in_ID)")) "Indonesian" else str
} }
fun bytesToGigaBytes( number: Double ): Double = number / 1024000000 fun bytesToGigaBytes(number: Double): Double = number / 1024000000
fun getKisskhTitle(str: String?): String? { fun getKisskhTitle(str: String?): String? {
return str?.replace(Regex("[^a-zA-Z\\d]"), "-") return str?.replace(Regex("[^a-zA-Z\\d]"), "-")
} }
fun getIndexQualityTags(str: String?): String { fun getIndexQualityTags(str: String?): String {
return Regex("\\d{3,4}[pP]\\.?(.*?)\\.(mkv|mp4|avi)").find(str ?: "")?.groupValues?.getOrNull(1)?.replace(".", " ")?.trim() ?: "" return Regex("\\d{3,4}[pP]\\.?(.*?)\\.(mkv|mp4|avi)").find(str ?: "")?.groupValues?.getOrNull(1)
?.replace(".", " ")?.trim() ?: ""
} }
fun getIndexQuality(str: String?): Int { fun getIndexQuality(str: String?): Int {
return Regex("(\\d{3,4})[pP]").find(str ?: "")?.groupValues?.getOrNull(1)?.toIntOrNull() ?: Qualities.Unknown.value return Regex("(\\d{3,4})[pP]").find(str ?: "")?.groupValues?.getOrNull(1)?.toIntOrNull()
?: Qualities.Unknown.value
} }
fun getQuality(str: String): Int { fun getQuality(str: String): Int {
@ -711,7 +722,7 @@ fun getDbgoLanguage(str: String): String {
} }
} }
fun String.encodeUrl() : String { fun String.encodeUrl(): String {
val url = URL(this) val url = URL(this)
val uri = URI(url.protocol, url.userInfo, url.host, url.port, url.path, url.query, url.ref) val uri = URI(url.protocol, url.userInfo, url.host, url.port, url.path, url.query, url.ref)
return uri.toURL().toString() return uri.toURL().toString()