sora: fix dub in crunchy

This commit is contained in:
hexated 2023-04-17 21:47:08 +07:00
parent 0e746f4aff
commit 39e12bbbb5

View file

@ -638,7 +638,9 @@ object SoraExtractor : SoraStream() {
it.attr("href").contains(Regex("(?i)Episode-0*$episode")) it.attr("href").contains(Regex("(?i)Episode-0*$episode"))
}?.attr("href") }?.attr("href")
} ?: return } ?: return
val servers = app.get(fixUrl(iframe, kimcartoonAPI)).document.select("#selectServer > option").map { fixUrl(it.attr("value"), kimcartoonAPI) } val servers =
app.get(fixUrl(iframe, kimcartoonAPI)).document.select("#selectServer > option")
.map { fixUrl(it.attr("value"), kimcartoonAPI) }
servers.apmap { servers.apmap {
app.get(it).document.select("#my_video_1").attr("src").let { iframe -> app.get(it).document.select("#my_video_1").attr("src").let { iframe ->
@ -704,7 +706,8 @@ object SoraExtractor : SoraStream() {
callback: (ExtractorLink) -> Unit, callback: (ExtractorLink) -> Unit,
) { ) {
val results = val results =
app.get("$soraBackupAPI/api/search?keyword=$title").parsedSafe<ChillSearch>()?.data?.results app.get("$soraBackupAPI/api/search?keyword=$title")
.parsedSafe<ChillSearch>()?.data?.results
val media = if (results?.size == 1) { val media = if (results?.size == 1) {
results.firstOrNull() results.firstOrNull()
} else { } else {
@ -729,11 +732,15 @@ object SoraExtractor : SoraStream() {
} }
} ?: return } ?: return
val episodeId = app.get("$soraBackupAPI/api/detail?id=${media.id}&category=${media.domainType}").parsedSafe<Load>()?.data?.episodeVo?.find { val episodeId =
app.get("$soraBackupAPI/api/detail?id=${media.id}&category=${media.domainType}")
.parsedSafe<Load>()?.data?.episodeVo?.find {
it.seriesNo == (episode ?: 0) it.seriesNo == (episode ?: 0)
}?.id ?: return }?.id ?: return
val sources = app.get("$soraBackupAPI/api/episode?id=${media.id}&category=${media.domainType}&episode=$episodeId").parsedSafe<ChillSources>()?.data val sources =
app.get("$soraBackupAPI/api/episode?id=${media.id}&category=${media.domainType}&episode=$episodeId")
.parsedSafe<ChillSources>()?.data
sources?.qualities?.map { source -> sources?.qualities?.map { source ->
callback.invoke( callback.invoke(
@ -751,7 +758,8 @@ object SoraExtractor : SoraStream() {
sources?.subtitles?.map { sub -> sources?.subtitles?.map { sub ->
subtitleCallback.invoke( subtitleCallback.invoke(
SubtitleFile( SubtitleFile(
getVipLanguage(sub.lang ?: return@map), sub.url?.substringAfter("?url=") ?: return@map getVipLanguage(sub.lang ?: return@map),
sub.url?.substringAfter("?url=") ?: return@map
) )
) )
} }
@ -1000,17 +1008,14 @@ object SoraExtractor : SoraStream() {
val searchQuaery = val searchQuaery =
"""$allanimeAPI/allanimeapi?variables={"search":{"query":"${aniDetail?.title?.romaji ?: return}","allowAdult":false,"allowUnknown":false},"limit":26,"page":1,"translationType":"sub","countryOrigin":"ALL"}&extensions={"persistedQuery":{"version":1,"sha256Hash":"$searchHash"}}""" """$allanimeAPI/allanimeapi?variables={"search":{"query":"${aniDetail?.title?.romaji ?: return}","allowAdult":false,"allowUnknown":false},"limit":26,"page":1,"translationType":"sub","countryOrigin":"ALL"}&extensions={"persistedQuery":{"version":1,"sha256Hash":"$searchHash"}}"""
val id = app.get(searchQuaery) val id = app.get(searchQuaery)
.parsedSafe<AllanimeResponses>()?.data?.shows?.edges?.let { media -> .parsedSafe<AllanimeResponses>()?.data?.shows?.edges?.find {
media.find { it.thumbnail == aniDetail.cover || it.thumbnail == aniDetail.image } it.thumbnail == aniDetail.cover || it.thumbnail == aniDetail.image || ((it.name?.equals(
?: media.find {
(it.name?.equals(
aniDetail.title.romaji, aniDetail.title.romaji,
true true
) == true || it.englishName?.equals( ) == true || it.englishName?.equals(
aniDetail.title.romaji, aniDetail.title.romaji,
true true
) == true) && it.airedStart?.year == aniDetail.releaseDate ) == true) && it.airedStart?.year == aniDetail.releaseDate)
}
}?._id }?._id
listOf( listOf(
@ -1023,7 +1028,7 @@ object SoraExtractor : SoraStream() {
.parsedSafe<AllanimeResponses>()?.data?.episode?.sourceUrls?.find { it.sourceName == "Ac" } .parsedSafe<AllanimeResponses>()?.data?.episode?.sourceUrls?.find { it.sourceName == "Ac" }
val serverUrl = fixUrl( val serverUrl = fixUrl(
server?.sourceUrl?.replace("/clock", "/clock.json") ?: return@apmap, server?.sourceUrl?.replace("/clock", "/clock.json") ?: return@apmap,
"https://allanimenews.com" if(tl == "sub") "https://allanimenews.com" else "https://mblog.allanimenews.com"
) )
app.get(serverUrl) app.get(serverUrl)
.parsedSafe<AllanimeLinks>()?.links?.forEach { link -> .parsedSafe<AllanimeLinks>()?.links?.forEach { link ->
@ -1320,7 +1325,10 @@ object SoraExtractor : SoraStream() {
} }
sources.apmap { (quality, link) -> sources.apmap { (quality, link) ->
val driveLink = if(link?.contains("driveleech") == true) bypassDriveleech(link) else bypassTechmny(link ?: return@apmap) val driveLink =
if (link?.contains("driveleech") == true) bypassDriveleech(link) else bypassTechmny(
link ?: return@apmap
)
val base = getBaseUrl(driveLink ?: return@apmap) 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")
@ -2791,7 +2799,8 @@ object SoraExtractor : SoraStream() {
} }
val sid = "9k9iupt5sebbnfajrc6ti3ht7l" val sid = "9k9iupt5sebbnfajrc6ti3ht7l"
val sec = "1974bc4a902c4d69fcbab261dcec69094a9b8164" val sec = "1974bc4a902c4d69fcbab261dcec69094a9b8164"
val url = "$monsterMainUrl/$playSlug?mid=1&sid=$sid&sec=$sec&t=${System.currentTimeMillis()}" val url =
"$monsterMainUrl/$playSlug?mid=1&sid=$sid&sec=$sec&t=${System.currentTimeMillis()}"
val res = app.get(url).document val res = app.get(url).document
val script = res.selectFirst("script:containsData(window['show_storage'])")?.data() val script = res.selectFirst("script:containsData(window['show_storage'])")?.data()
val hash = Regex("hash:\\s*['\"](\\S+)['\"],").find(script ?: return)?.groupValues?.get(1) val hash = Regex("hash:\\s*['\"](\\S+)['\"],").find(script ?: return)?.groupValues?.get(1)
@ -2966,7 +2975,8 @@ object SoraExtractor : SoraStream() {
imdbId: String? = null, imdbId: String? = null,
callback: (ExtractorLink) -> Unit callback: (ExtractorLink) -> Unit
) { ) {
app.get("$cryMoviesAPI/stream/movie/$imdbId.json").parsedSafe<CryMoviesResponse>()?.streams?.map { stream -> app.get("$cryMoviesAPI/stream/movie/$imdbId.json")
.parsedSafe<CryMoviesResponse>()?.streams?.map { stream ->
val quality = getIndexQuality(stream.title) val quality = getIndexQuality(stream.title)
val tags = getIndexQualityTags(stream.title) val tags = getIndexQualityTags(stream.title)
val size = stream.title?.substringAfter("\uD83D\uDCBE")?.trim() val size = stream.title?.substringAfter("\uD83D\uDCBE")?.trim()