AllAnime: New server (#1510)
This commit is contained in:
@ -9,6 +9,8 @@ class OkruExtractor(private val client: OkHttpClient) {
|
|||||||
|
|
||||||
private fun fixQuality(quality: String): String {
|
private fun fixQuality(quality: String): String {
|
||||||
val qualities = listOf(
|
val qualities = listOf(
|
||||||
|
Pair("ultra", "2160p"),
|
||||||
|
Pair("quad", "1440p"),
|
||||||
Pair("full", "1080p"),
|
Pair("full", "1080p"),
|
||||||
Pair("hd", "720p"),
|
Pair("hd", "720p"),
|
||||||
Pair("sd", "480p"),
|
Pair("sd", "480p"),
|
||||||
|
@ -6,7 +6,7 @@ ext {
|
|||||||
extName = 'AllAnime'
|
extName = 'AllAnime'
|
||||||
pkgNameSuffix = 'en.allanime'
|
pkgNameSuffix = 'en.allanime'
|
||||||
extClass = '.AllAnime'
|
extClass = '.AllAnime'
|
||||||
extVersionCode = 16
|
extVersionCode = 17
|
||||||
libVersion = '13'
|
libVersion = '13'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -363,6 +363,7 @@ class AllAnime : ConfigurableAnimeSource, AnimeHttpSource() {
|
|||||||
video.sourceUrl.startsWith("/apivtwo/") && (
|
video.sourceUrl.startsWith("/apivtwo/") && (
|
||||||
(hosterSelection.contains("default") && video.sourceName.lowercase().contains("default")) ||
|
(hosterSelection.contains("default") && video.sourceName.lowercase().contains("default")) ||
|
||||||
(hosterSelection.contains("ac") && video.sourceName.lowercase().contains("ac")) ||
|
(hosterSelection.contains("ac") && video.sourceName.lowercase().contains("ac")) ||
|
||||||
|
(hosterSelection.contains("ak") && video.sourceName.lowercase().contains("ak")) ||
|
||||||
(hosterSelection.contains("luf-mp4") && video.sourceName.lowercase().contains("luf-mp4")) ||
|
(hosterSelection.contains("luf-mp4") && video.sourceName.lowercase().contains("luf-mp4")) ||
|
||||||
(hosterSelection.contains("si-hls") && video.sourceName.lowercase().contains("si-hls")) ||
|
(hosterSelection.contains("si-hls") && video.sourceName.lowercase().contains("si-hls")) ||
|
||||||
(hosterSelection.contains("s-mp4") && video.sourceName.lowercase().contains("s-mp4")) ||
|
(hosterSelection.contains("s-mp4") && video.sourceName.lowercase().contains("s-mp4")) ||
|
||||||
@ -370,7 +371,7 @@ class AllAnime : ConfigurableAnimeSource, AnimeHttpSource() {
|
|||||||
(hosterSelection.contains("uv-mp4") && video.sourceName.lowercase().contains("uv-mp4")) ||
|
(hosterSelection.contains("uv-mp4") && video.sourceName.lowercase().contains("uv-mp4")) ||
|
||||||
(hosterSelection.contains("pn-hls") && video.sourceName.lowercase().contains("pn-hls"))
|
(hosterSelection.contains("pn-hls") && video.sourceName.lowercase().contains("pn-hls"))
|
||||||
) -> {
|
) -> {
|
||||||
serverList.add(Server(video.sourceUrl, "internal", video.priority))
|
serverList.add(Server(video.sourceUrl, "internal ${video.sourceName}", video.priority))
|
||||||
}
|
}
|
||||||
altHosterSelection.contains("player") && video.type == "player" -> {
|
altHosterSelection.contains("player") && video.type == "player" -> {
|
||||||
serverList.add(Server(video.sourceUrl, "player", video.priority))
|
serverList.add(Server(video.sourceUrl, "player", video.priority))
|
||||||
@ -402,8 +403,9 @@ class AllAnime : ConfigurableAnimeSource, AnimeHttpSource() {
|
|||||||
videoList.addAll(
|
videoList.addAll(
|
||||||
serverList.parallelMap { server ->
|
serverList.parallelMap { server ->
|
||||||
runCatching {
|
runCatching {
|
||||||
when (server.sourceName) {
|
val sName = server.sourceName
|
||||||
"internal" -> {
|
when {
|
||||||
|
sName.startsWith("internal ") -> {
|
||||||
val extractor = AllAnimeExtractor(client)
|
val extractor = AllAnimeExtractor(client)
|
||||||
val videos = runCatching {
|
val videos = runCatching {
|
||||||
extractor.videoFromUrl(server.sourceUrl, server.sourceName)
|
extractor.videoFromUrl(server.sourceUrl, server.sourceName)
|
||||||
@ -412,7 +414,7 @@ class AllAnime : ConfigurableAnimeSource, AnimeHttpSource() {
|
|||||||
Pair(it, server.priority)
|
Pair(it, server.priority)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"player" -> {
|
sName == "player" -> {
|
||||||
listOf(
|
listOf(
|
||||||
Pair(
|
Pair(
|
||||||
Video(
|
Video(
|
||||||
@ -424,7 +426,7 @@ class AllAnime : ConfigurableAnimeSource, AnimeHttpSource() {
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
"streamsb" -> {
|
sName == "streamsb" -> {
|
||||||
val extractor = StreamSBExtractor(client)
|
val extractor = StreamSBExtractor(client)
|
||||||
val videos = runCatching {
|
val videos = runCatching {
|
||||||
extractor.videosFromUrl(server.sourceUrl, headers)
|
extractor.videosFromUrl(server.sourceUrl, headers)
|
||||||
@ -433,7 +435,7 @@ class AllAnime : ConfigurableAnimeSource, AnimeHttpSource() {
|
|||||||
Pair(it, server.priority)
|
Pair(it, server.priority)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"gogo" -> {
|
sName == "gogo" -> {
|
||||||
val extractor = VidstreamingExtractor(client, json)
|
val extractor = VidstreamingExtractor(client, json)
|
||||||
val videos = runCatching {
|
val videos = runCatching {
|
||||||
extractor.videosFromUrl(server.sourceUrl.replace(Regex("^//"), "https://"))
|
extractor.videosFromUrl(server.sourceUrl.replace(Regex("^//"), "https://"))
|
||||||
@ -442,7 +444,7 @@ class AllAnime : ConfigurableAnimeSource, AnimeHttpSource() {
|
|||||||
Pair(it, server.priority)
|
Pair(it, server.priority)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"dood" -> {
|
sName == "dood" -> {
|
||||||
val extractor = DoodExtractor(client)
|
val extractor = DoodExtractor(client)
|
||||||
val videos = runCatching {
|
val videos = runCatching {
|
||||||
extractor.videosFromUrl(server.sourceUrl)
|
extractor.videosFromUrl(server.sourceUrl)
|
||||||
@ -451,7 +453,7 @@ class AllAnime : ConfigurableAnimeSource, AnimeHttpSource() {
|
|||||||
Pair(it, server.priority)
|
Pair(it, server.priority)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"okru" -> {
|
sName == "okru" -> {
|
||||||
val extractor = OkruExtractor(client)
|
val extractor = OkruExtractor(client)
|
||||||
val videos = runCatching {
|
val videos = runCatching {
|
||||||
extractor.videosFromUrl(server.sourceUrl)
|
extractor.videosFromUrl(server.sourceUrl)
|
||||||
@ -460,7 +462,7 @@ class AllAnime : ConfigurableAnimeSource, AnimeHttpSource() {
|
|||||||
Pair(it, server.priority)
|
Pair(it, server.priority)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"mp4upload" -> {
|
sName == "mp4upload" -> {
|
||||||
val headers = headers.newBuilder().set("referer", "https://mp4upload.com/").build()
|
val headers = headers.newBuilder().set("referer", "https://mp4upload.com/").build()
|
||||||
val videos = runCatching {
|
val videos = runCatching {
|
||||||
Mp4uploadExtractor(client).getVideoFromUrl(server.sourceUrl, headers)
|
Mp4uploadExtractor(client).getVideoFromUrl(server.sourceUrl, headers)
|
||||||
@ -469,7 +471,7 @@ class AllAnime : ConfigurableAnimeSource, AnimeHttpSource() {
|
|||||||
Pair(it, server.priority)
|
Pair(it, server.priority)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"streamlare" -> {
|
sName == "streamlare" -> {
|
||||||
val extractor = StreamlareExtractor(client)
|
val extractor = StreamlareExtractor(client)
|
||||||
val videos = runCatching {
|
val videos = runCatching {
|
||||||
extractor.videosFromUrl(server.sourceUrl)
|
extractor.videosFromUrl(server.sourceUrl)
|
||||||
@ -573,9 +575,9 @@ class AllAnime : ConfigurableAnimeSource, AnimeHttpSource() {
|
|||||||
val hostSelection = MultiSelectListPreference(screen.context).apply {
|
val hostSelection = MultiSelectListPreference(screen.context).apply {
|
||||||
key = "hoster_selection"
|
key = "hoster_selection"
|
||||||
title = "Enable/Disable Hosts"
|
title = "Enable/Disable Hosts"
|
||||||
entries = arrayOf("Default", "Ac", "Luf-mp4", "Si-Hls", "S-mp4", "Ac-Hls", "Uv-mp4", "Pn-Hls")
|
entries = arrayOf("Default", "Ac", "Ak", "Luf-mp4", "Si-Hls", "S-mp4", "Ac-Hls", "Uv-mp4", "Pn-Hls")
|
||||||
entryValues = arrayOf("default", "ac", "luf-mp4", "si-hls", "s-mp4", "ac-hls", "uv-mp4", "pn-hls")
|
entryValues = arrayOf("default", "ac", "ak", "luf-mp4", "si-hls", "s-mp4", "ac-hls", "uv-mp4", "pn-hls")
|
||||||
setDefaultValue(setOf("default", "ac", "luf-mp4", "si-hls", "s-mp4", "ac-hls"))
|
setDefaultValue(setOf("default", "ac", "ak", "luf-mp4", "si-hls", "s-mp4", "ac-hls"))
|
||||||
|
|
||||||
setOnPreferenceChangeListener { _, newValue ->
|
setOnPreferenceChangeListener { _, newValue ->
|
||||||
preferences.edit().putStringSet(key, newValue as Set<String>).commit()
|
preferences.edit().putStringSet(key, newValue as Set<String>).commit()
|
||||||
@ -597,8 +599,8 @@ class AllAnime : ConfigurableAnimeSource, AnimeHttpSource() {
|
|||||||
val videoQualityPref = ListPreference(screen.context).apply {
|
val videoQualityPref = ListPreference(screen.context).apply {
|
||||||
key = "preferred_quality"
|
key = "preferred_quality"
|
||||||
title = "Preferred quality"
|
title = "Preferred quality"
|
||||||
entries = arrayOf("1080p", "720p", "480p", "360p", "240p", "80p")
|
entries = arrayOf("1080p", "720p", "480p", "360p", "240p", "80p", "1440p (okru only)", "2160p (okru only)")
|
||||||
entryValues = arrayOf("1080", "720", "480", "360", "240", "80")
|
entryValues = arrayOf("1080", "720", "480", "360", "240", "80", "1440", "2160")
|
||||||
setDefaultValue("1080")
|
setDefaultValue("1080")
|
||||||
summary = "%s"
|
summary = "%s"
|
||||||
|
|
||||||
|
@ -21,9 +21,11 @@ data class VideoLink(
|
|||||||
val link: String,
|
val link: String,
|
||||||
val hls: Boolean? = null,
|
val hls: Boolean? = null,
|
||||||
val mp4: Boolean? = null,
|
val mp4: Boolean? = null,
|
||||||
|
val dash: Boolean? = null,
|
||||||
val crIframe: Boolean? = null,
|
val crIframe: Boolean? = null,
|
||||||
val resolutionStr: String,
|
val resolutionStr: String,
|
||||||
val subtitles: List<Subtitles>? = null,
|
val subtitles: List<Subtitles>? = null,
|
||||||
|
val rawUrls: RawUrl? = null,
|
||||||
val portData: Stream? = null,
|
val portData: Stream? = null,
|
||||||
) {
|
) {
|
||||||
@Serializable
|
@Serializable
|
||||||
@ -45,6 +47,19 @@ data class VideoLink(
|
|||||||
val hardsub_lang: String,
|
val hardsub_lang: String,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Serializable
|
||||||
|
data class RawUrl(
|
||||||
|
val vids: List<DashStreamObject>? = null,
|
||||||
|
val audios: List<DashStreamObject>? = null,
|
||||||
|
) {
|
||||||
|
@Serializable
|
||||||
|
data class DashStreamObject(
|
||||||
|
val bandwidth: Long,
|
||||||
|
val height: Int,
|
||||||
|
val url: String,
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -52,7 +67,7 @@ class AllAnimeExtractor(private val client: OkHttpClient) {
|
|||||||
|
|
||||||
private val json: Json by injectLazy()
|
private val json: Json by injectLazy()
|
||||||
|
|
||||||
private fun bytesIntoHumanReadable(bytes: Long): String? {
|
private fun bytesIntoHumanReadable(bytes: Long): String {
|
||||||
val kilobyte: Long = 1000
|
val kilobyte: Long = 1000
|
||||||
val megabyte = kilobyte * 1000
|
val megabyte = kilobyte * 1000
|
||||||
val gigabyte = megabyte * 1000
|
val gigabyte = megabyte * 1000
|
||||||
@ -234,6 +249,20 @@ class AllAnimeExtractor(private val client: OkHttpClient) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else if (link.dash == true) {
|
||||||
|
val audioList = link.rawUrls?.audios?.map {
|
||||||
|
Track(it.url, bytesIntoHumanReadable(it.bandwidth))
|
||||||
|
}
|
||||||
|
val videos = link.rawUrls?.vids?.map {
|
||||||
|
if (audioList == null) {
|
||||||
|
Video(it.url, "$name - ${it.height} ${bytesIntoHumanReadable(it.bandwidth)}", it.url, subtitleTracks = subtitles)
|
||||||
|
} else {
|
||||||
|
Video(it.url, "$name - ${it.height} ${bytesIntoHumanReadable(it.bandwidth)}", it.url, audioTracks = audioList, subtitleTracks = subtitles)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (videos != null) {
|
||||||
|
videoList.addAll(videos)
|
||||||
|
}
|
||||||
} else {}
|
} else {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ class StreamlareExtractor(private val client: OkHttpClient) {
|
|||||||
|
|
||||||
val separator = "#EXT-X-STREAM-INF"
|
val separator = "#EXT-X-STREAM-INF"
|
||||||
masterPlaylist.substringAfter(separator).split(separator).map {
|
masterPlaylist.substringAfter(separator).split(separator).map {
|
||||||
val quality = it.substringAfter("RESOLUTION=").substringAfter("x").substringBefore(",") + "p"
|
val quality = it.substringAfter("RESOLUTION=").substringAfter("x").substringBefore("\n").substringBefore(",") + "p"
|
||||||
var videoUrl = it.substringAfter("\n").substringBefore("\n")
|
var videoUrl = it.substringAfter("\n").substringBefore("\n")
|
||||||
if (!videoUrl.startsWith("http")) videoUrl = "${masterPlaylistUrl.substringBefore("master.m3u8")}$videoUrl"
|
if (!videoUrl.startsWith("http")) videoUrl = "${masterPlaylistUrl.substringBefore("master.m3u8")}$videoUrl"
|
||||||
videoList.add(Video(videoUrl, "$quality (Streamlare)", videoUrl))
|
videoList.add(Video(videoUrl, "$quality (Streamlare)", videoUrl))
|
||||||
|
Reference in New Issue
Block a user