[animeowl] fix: Quality preference match (#880)
All checks were successful
CI / Prepare job (push) Successful in 1m28s
CI / Build individual modules (push) Successful in 7m43s
CI / Publish repo (push) Successful in 1m57s

Checklist:

- [x] Updated `extVersionCode` value in `build.gradle` for individual extensions
- [ ] Updated `overrideVersionCode` or `baseVersionCode` as needed for all multisrc extensions
- [ ] Referenced all related issues in the PR body (e.g. "Closes #xyz")
- [ ] Added the `isNsfw = true` flag in `build.gradle` when appropriate
- [x] Have not changed source names
- [ ] Have explicitly kept the `id` if a source's name or language were changed
- [x] Have tested the modifications by compiling and running the extension through Android Studio
- [ ] Have removed `web_hi_res_512.png` when adding a new extension
- [ ] Have made sure all the icons are in png format

Co-authored-by: Khaled <spkhalad@gmail.com>
Reviewed-on: #880
Co-authored-by: Ghost <>
Co-committed-by: Ghost <>
This commit is contained in:
Ghost 2025-06-19 19:08:09 -05:00 committed by AlmightyHak
parent aecb565aeb
commit f84834770d
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()