This commit is contained in:
Khaled 2025-05-12 21:21:50 +07:00 committed by GitHub
commit 3a16deac88
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 13 additions and 5 deletions

View file

@ -129,7 +129,7 @@ class AnimeOwl : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
val document = response.asJsoup()
val sub = document.select("#anime-cover-sub-content .episode-node").mapIndexed { idx, it ->
EpisodeResponse.Episode(
id = it.attr("title").toDoubleOrNull(),
id = idx.toDouble(),
episodeIndex = idx.toString(),
name = it.attr("title"),
lang = "Sub",
@ -138,7 +138,7 @@ class AnimeOwl : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
}
val dub = document.select("#anime-cover-dub-content .episode-node").mapIndexed { idx, it ->
EpisodeResponse.Episode(
id = it.attr("title").toDoubleOrNull(),
id = idx.toDouble(),
episodeIndex = idx.toString(),
name = it.attr("title"),
lang = "Dub",
@ -301,6 +301,6 @@ class AnimeOwl : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
private const val PREF_QUALITY_KEY = "preferred_quality"
private const val PREF_QUALITY_TITLE = "Preferred quality"
private const val PREF_QUALITY_DEFAULT = "1080p"
private val PREF_QUALITY_LIST = arrayOf("1080p", "720p", "480p", "360p")
private val PREF_QUALITY_LIST = arrayOf("2K", "1080p", "720p", "480p", "360p")
}
}

View file

@ -48,8 +48,13 @@ class OwlExtractor(private val client: OkHttpClient, private val baseUrl: String
luffy.forEach { stream ->
noRedirectClient.newCall(GET("${stream.url}$jwt")).execute()
.use { it.headers["Location"] }?.let {
val resolution = when {
stream.resolution?.endsWith("0") == true -> "${stream.resolution}p"
else -> stream.resolution
}
videoList.add(
Video(it, "${link.lang} Luffy:${stream.resolution}", it),
Video(it, "${link.lang} Luffy:${resolution ?: "Unknown"}", it),
)
}
}
@ -83,7 +88,10 @@ class OwlExtractor(private val client: OkHttpClient, private val baseUrl: String
return client.newCall(GET(url)).execute().let { it ->
if (it.isSuccessful) {
it.parseAs<Stream>().url.let {
playlistUtils.extractFromHls(it, videoNameGen = { qty -> "$lang $server:$qty" })
playlistUtils.extractFromHls(
it,
videoNameGen = { qty -> "$lang $server:$qty" },
)
}
} else {
emptyList()