fix(id/oploverz): Video list is empty (#2879)
This commit is contained in:
@ -1,7 +1,7 @@
|
|||||||
ext {
|
ext {
|
||||||
extName = 'Oploverz'
|
extName = 'Oploverz'
|
||||||
extClass = '.Oploverz'
|
extClass = '.Oploverz'
|
||||||
extVersionCode = 23
|
extVersionCode = 24
|
||||||
}
|
}
|
||||||
|
|
||||||
apply from: "$rootDir/common.gradle"
|
apply from: "$rootDir/common.gradle"
|
||||||
|
@ -28,7 +28,7 @@ import java.util.Locale
|
|||||||
|
|
||||||
class Oploverz : ConfigurableAnimeSource, AnimeHttpSource() {
|
class Oploverz : ConfigurableAnimeSource, AnimeHttpSource() {
|
||||||
override val name: String = "Oploverz"
|
override val name: String = "Oploverz"
|
||||||
override val baseUrl: String = "https://oploverz.guru"
|
override val baseUrl: String = "https://oploverz.plus"
|
||||||
override val lang: String = "id"
|
override val lang: String = "id"
|
||||||
override val supportsLatest: Boolean = true
|
override val supportsLatest: Boolean = true
|
||||||
|
|
||||||
@ -103,9 +103,11 @@ class Oploverz : ConfigurableAnimeSource, AnimeHttpSource() {
|
|||||||
|
|
||||||
override fun videoListParse(response: Response): List<Video> {
|
override fun videoListParse(response: Response): List<Video> {
|
||||||
val doc = response.asJsoup()
|
val doc = response.asJsoup()
|
||||||
|
val parseUrl = response.request.url.toUrl()
|
||||||
|
val url = "${parseUrl.protocol}://${parseUrl.host}"
|
||||||
return doc.select("#server > ul > li > div.east_player_option")
|
return doc.select("#server > ul > li > div.east_player_option")
|
||||||
.parallelMapNotNullBlocking {
|
.parallelMapNotNullBlocking {
|
||||||
runCatching { getEmbedLinks(it) }.getOrNull()
|
runCatching { getEmbedLinks(url, it) }.getOrNull()
|
||||||
}
|
}
|
||||||
.parallelCatchingFlatMapBlocking {
|
.parallelCatchingFlatMapBlocking {
|
||||||
getVideosFromEmbed(it.first)
|
getVideosFromEmbed(it.first)
|
||||||
@ -162,14 +164,14 @@ class Oploverz : ConfigurableAnimeSource, AnimeHttpSource() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getEmbedLinks(element: Element): Pair<String, String> {
|
private fun getEmbedLinks(url: String, element: Element): Pair<String, String> {
|
||||||
val form = FormBody.Builder().apply {
|
val form = FormBody.Builder().apply {
|
||||||
add("action", "player_ajax")
|
add("action", "player_ajax")
|
||||||
add("post", element.attr("data-post"))
|
add("post", element.attr("data-post"))
|
||||||
add("nume", element.attr("data-nume"))
|
add("nume", element.attr("data-nume"))
|
||||||
add("type", element.attr("data-type"))
|
add("type", element.attr("data-type"))
|
||||||
}.build()
|
}.build()
|
||||||
return client.newCall(POST("$baseUrl/wp-admin/admin-ajax.php", body = form))
|
return client.newCall(POST("$url/wp-admin/admin-ajax.php", body = form))
|
||||||
.execute()
|
.execute()
|
||||||
.let { Pair(it.asJsoup().selectFirst(".playeriframe")!!.attr("src"), "") }
|
.let { Pair(it.asJsoup().selectFirst(".playeriframe")!!.attr("src"), "") }
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user