mirror of
https://github.com/recloudstream/cloudstream-extensions.git
synced 2024-08-15 03:03:54 +00:00
parent
97a17c0729
commit
b1a9851fc0
2 changed files with 48 additions and 20 deletions
|
@ -1,5 +1,5 @@
|
|||
// use an integer for version numbers
|
||||
version = 8
|
||||
version = 9
|
||||
|
||||
|
||||
cloudstream {
|
||||
|
|
|
@ -360,11 +360,23 @@ class AllAnimeProvider : MainAPI() {
|
|||
return false
|
||||
}
|
||||
|
||||
private data class Stream(
|
||||
@JsonProperty("format") val format: String? = null,
|
||||
@JsonProperty("audio_lang") val audio_lang: String? = null,
|
||||
@JsonProperty("hardsub_lang") val hardsub_lang: String? = null,
|
||||
@JsonProperty("url") val url: String? = null,
|
||||
)
|
||||
|
||||
private data class PortData(
|
||||
@JsonProperty("streams") val streams: ArrayList<Stream>? = arrayListOf(),
|
||||
)
|
||||
|
||||
private data class Links(
|
||||
@JsonProperty("link") val link: String,
|
||||
@JsonProperty("hls") val hls: Boolean?,
|
||||
@JsonProperty("resolutionStr") val resolutionStr: String,
|
||||
@JsonProperty("src") val src: String?
|
||||
@JsonProperty("src") val src: String?,
|
||||
@JsonProperty("portData") val portData: PortData? = null,
|
||||
)
|
||||
|
||||
private data class AllAnimeVideoApiResponse(
|
||||
|
@ -394,6 +406,16 @@ class AllAnimeProvider : MainAPI() {
|
|||
val episode: Int
|
||||
)
|
||||
|
||||
private suspend fun PortData.extractAcSources(callback: (ExtractorLink) -> Unit) {
|
||||
this.streams?.filter { it.format == "adaptive_hls" && it.hardsub_lang == "en-US" }?.map { source ->
|
||||
M3u8Helper.generateM3u8(
|
||||
"Crunchyroll",
|
||||
source.url ?: return@map,
|
||||
"https://static.crunchyroll.com/",
|
||||
).forEach(callback)
|
||||
}
|
||||
}
|
||||
|
||||
override suspend fun loadLinks(
|
||||
data: String,
|
||||
isCasting: Boolean,
|
||||
|
@ -436,7 +458,11 @@ class AllAnimeProvider : MainAPI() {
|
|||
val links = app.get(fixedLink).parsedSafe<AllAnimeVideoApiResponse>()?.links
|
||||
?: emptyList()
|
||||
links.forEach { server ->
|
||||
if (server.hls != null && server.hls) {
|
||||
when {
|
||||
source.sourceName == "Ac" -> {
|
||||
server.portData?.extractAcSources(callback)
|
||||
}
|
||||
server.hls != null && server.hls -> {
|
||||
getM3u8Qualities(
|
||||
server.link,
|
||||
"$apiEndPoint/player?uri=" + (if (URI(server.link).host.isNotEmpty()) server.link else apiEndPoint + URI(
|
||||
|
@ -444,7 +470,8 @@ class AllAnimeProvider : MainAPI() {
|
|||
).path),
|
||||
server.resolutionStr
|
||||
).forEach(callback)
|
||||
} else {
|
||||
}
|
||||
else -> {
|
||||
callback(
|
||||
ExtractorLink(
|
||||
"AllAnime - " + URI(server.link).host,
|
||||
|
@ -462,6 +489,7 @@ class AllAnimeProvider : MainAPI() {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue