forked from AlmightyHak/extensions-source
[AnimeOwl] fix: Video list + Episode list (#856)
This commit is contained in:
parent
a64dae4b23
commit
955fbed018
4 changed files with 32 additions and 22 deletions
|
@ -1,7 +1,7 @@
|
||||||
ext {
|
ext {
|
||||||
extName = 'AnimeOwl'
|
extName = 'AnimeOwl'
|
||||||
extClass = '.AnimeOwl'
|
extClass = '.AnimeOwl'
|
||||||
extVersionCode = 22
|
extVersionCode = 23
|
||||||
}
|
}
|
||||||
|
|
||||||
apply from: "$rootDir/common.gradle"
|
apply from: "$rootDir/common.gradle"
|
||||||
|
|
|
@ -129,20 +129,20 @@ class AnimeOwl : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
|
||||||
val document = response.asJsoup()
|
val document = response.asJsoup()
|
||||||
val sub = document.select("#anime-cover-sub-content .episode-node").mapIndexed { idx, it ->
|
val sub = document.select("#anime-cover-sub-content .episode-node").mapIndexed { idx, it ->
|
||||||
EpisodeResponse.Episode(
|
EpisodeResponse.Episode(
|
||||||
id = it.text().toDouble(),
|
id = it.attr("title").toDoubleOrNull(),
|
||||||
episodeIndex = idx.toString(),
|
episodeIndex = idx.toString(),
|
||||||
name = it.text(),
|
name = it.attr("title"),
|
||||||
lang = "Sub",
|
lang = "Sub",
|
||||||
href = it.attr("abs:href"),
|
href = it.absUrl("href"),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
val dub = document.select("#anime-cover-dub-content .episode-node").mapIndexed { idx, it ->
|
val dub = document.select("#anime-cover-dub-content .episode-node").mapIndexed { idx, it ->
|
||||||
EpisodeResponse.Episode(
|
EpisodeResponse.Episode(
|
||||||
id = it.text().toDouble(),
|
id = it.attr("title").toDoubleOrNull(),
|
||||||
episodeIndex = idx.toString(),
|
episodeIndex = idx.toString(),
|
||||||
name = it.text(),
|
name = it.attr("title"),
|
||||||
lang = "Dub",
|
lang = "Dub",
|
||||||
href = it.attr("abs:href"),
|
href = it.absUrl("href"),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -53,12 +53,13 @@ data class Link(
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
data class OwlServers(
|
data class OwlServers(
|
||||||
val kaido: String? = null,
|
val kaido: List<Stream>? = null,
|
||||||
val luffy: String? = null,
|
val luffy: List<Stream>? = null,
|
||||||
val zoro: String? = null,
|
val zoro: List<Stream>? = null,
|
||||||
)
|
)
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
data class Stream(
|
data class Stream(
|
||||||
val url: String,
|
val url: String,
|
||||||
|
val resolution: String?,
|
||||||
)
|
)
|
||||||
|
|
|
@ -45,23 +45,32 @@ class OwlExtractor(private val client: OkHttpClient, private val baseUrl: String
|
||||||
coroutineScope {
|
coroutineScope {
|
||||||
val lufDeferred = async {
|
val lufDeferred = async {
|
||||||
servers.luffy?.let { luffy ->
|
servers.luffy?.let { luffy ->
|
||||||
noRedirectClient.newCall(GET("${luffy}$jwt")).execute()
|
luffy.forEach { stream ->
|
||||||
.use { it.headers["Location"] }
|
noRedirectClient.newCall(GET("${stream.url}$jwt")).execute()
|
||||||
?.let { videoList.add(Video(it, "${link.lang} Luffy:1080p", it)) }
|
.use { it.headers["Location"] }?.let {
|
||||||
|
videoList.add(
|
||||||
|
Video(it, "${link.lang} Luffy:${stream.resolution}", it),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
val kaiDeferred = async {
|
val kaiDeferred = async {
|
||||||
servers.kaido?.let {
|
servers.kaido?.let { kaido ->
|
||||||
videoList.addAll(
|
kaido.forEach { stream ->
|
||||||
getHLS("${it}$jwt", "Kaido", link.lang),
|
videoList.addAll(
|
||||||
)
|
getHLS("${stream.url}$jwt", "Kaido", link.lang),
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
val zorDeferred = async {
|
val zorDeferred = async {
|
||||||
servers.zoro?.let {
|
servers.zoro?.let { zoro ->
|
||||||
videoList.addAll(
|
zoro.forEach { stream ->
|
||||||
getHLS("${it}$jwt", "Boa", link.lang),
|
videoList.addAll(
|
||||||
)
|
getHLS("${stream.url}$jwt", "Boa", link.lang),
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,7 +80,7 @@ class OwlExtractor(private val client: OkHttpClient, private val baseUrl: String
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getHLS(url: String, server: String, lang: String): List<Video> {
|
private fun getHLS(url: String, server: String, lang: String): List<Video> {
|
||||||
return client.newCall(GET(url)).execute().let {
|
return client.newCall(GET(url)).execute().let { it ->
|
||||||
if (it.isSuccessful) {
|
if (it.isSuccessful) {
|
||||||
it.parseAs<Stream>().url.let {
|
it.parseAs<Stream>().url.let {
|
||||||
playlistUtils.extractFromHls(it, videoNameGen = { qty -> "$lang $server:$qty" })
|
playlistUtils.extractFromHls(it, videoNameGen = { qty -> "$lang $server:$qty" })
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue