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
)
} }
} }
@ -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("--", "-")
@ -657,11 +666,13 @@ fun getKisskhTitle(str: String?): String? {
} }
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 {