mirror of
https://github.com/hexated/cloudstream-extensions-hexated.git
synced 2024-08-15 00:03:22 +00:00
sora: fixed Smashy and Fdmovies
This commit is contained in:
parent
65f5283ae6
commit
3b907e3d5a
3 changed files with 44 additions and 2 deletions
|
@ -1,7 +1,7 @@
|
|||
import org.jetbrains.kotlin.konan.properties.Properties
|
||||
|
||||
// use an integer for version numbers
|
||||
version = 144
|
||||
version = 145
|
||||
|
||||
android {
|
||||
defaultConfig {
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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(
|
||||
|
|
Loading…
Reference in a new issue