sora: fixed Smashy and Fdmovies

This commit is contained in:
hexated 2023-07-21 16:55:03 +07:00
parent 65f5283ae6
commit 3b907e3d5a
3 changed files with 44 additions and 2 deletions

View file

@ -1,7 +1,7 @@
import org.jetbrains.kotlin.konan.properties.Properties
// use an integer for version numbers
version = 144
version = 145
android {
defaultConfig {

View file

@ -1491,7 +1491,13 @@ object SoraExtractor : SoraStream() {
extractGdflix(gdBotLink ?: return@apmap null)
}
type.contains("oiya") -> {
extractOiya(fdLink ?: return@apmap null, qualities)
val oiyaLink = extractOiya(fdLink ?: return@apmap null, qualities)
if(oiyaLink?.contains("gdtot") == true) {
val gdBotLink = extractGdbot(oiyaLink)
extractGdflix(gdBotLink ?: return@apmap null)
} else {
oiyaLink
}
}
else -> {
return@apmap null
@ -2041,6 +2047,9 @@ object SoraExtractor : SoraStream() {
it.first.contains("/rip") -> {
invokeSmashyRip(it.second, it.first, subtitleCallback, callback)
}
it.first.contains("/im.php") && !isAnime -> {
invokeSmashyIm(it.second, it.first, subtitleCallback, callback)
}
else -> return@apmap
}
}

View file

@ -563,6 +563,39 @@ suspend fun invokeSmashyRip(
}
suspend fun invokeSmashyIm(
name: String,
url: String,
subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit,
) {
val script =
app.get(url).document.selectFirst("script:containsData(player =)")?.data() ?: return
val sources =
Regex("['\"]?file['\"]?:\\s*\"([^\"]+)").find(script)?.groupValues?.get(1) ?: return
val subtitles =
Regex("['\"]?subtitle['\"]?:\\s*\"([^\"]+)").find(script)?.groupValues?.get(1) ?: return
M3u8Helper.generateM3u8(
name,
sources,
""
).forEach(callback)
subtitles.split(",").map { sub ->
val lang = Regex("\\[(.*?)]").find(sub)?.groupValues?.getOrNull(1)?.trim()
val trimmedSubLink = sub.removePrefix("[$lang]").trim().substringAfter("?url=")
subtitleCallback.invoke(
SubtitleFile(
lang.takeIf { !it.isNullOrEmpty() } ?: return@map,
trimmedSubLink
)
)
}
}
suspend fun getDumpIdAndType(title: String?, year: Int?, season: Int?): Pair<String?, Int?> {
val res = tryParseJson<DumpQuickSearchData>(
queryApi(