fix(pt/animeshouse): Fix video extractors (#2608)
This commit is contained in:
parent
cbc63acfcf
commit
dadd535639
@ -5,7 +5,6 @@ import eu.kanade.tachiyomi.lib.okruextractor.OkruExtractor
|
|||||||
import eu.kanade.tachiyomi.lib.sendvidextractor.SendvidExtractor
|
import eu.kanade.tachiyomi.lib.sendvidextractor.SendvidExtractor
|
||||||
import eu.kanade.tachiyomi.lib.streamtapeextractor.StreamTapeExtractor
|
import eu.kanade.tachiyomi.lib.streamtapeextractor.StreamTapeExtractor
|
||||||
import eu.kanade.tachiyomi.multisrc.animestream.AnimeStream
|
import eu.kanade.tachiyomi.multisrc.animestream.AnimeStream
|
||||||
import eu.kanade.tachiyomi.network.GET
|
|
||||||
|
|
||||||
class AnimeYTES : AnimeStream(
|
class AnimeYTES : AnimeStream(
|
||||||
"es",
|
"es",
|
||||||
|
@ -1,14 +1,11 @@
|
|||||||
package eu.kanade.tachiyomi.animeextension.es.tiodonghua
|
package eu.kanade.tachiyomi.animeextension.es.tiodonghua
|
||||||
|
|
||||||
import androidx.preference.ListPreference
|
|
||||||
import androidx.preference.PreferenceScreen
|
|
||||||
import eu.kanade.tachiyomi.animesource.model.Video
|
import eu.kanade.tachiyomi.animesource.model.Video
|
||||||
import eu.kanade.tachiyomi.lib.mixdropextractor.MixDropExtractor
|
import eu.kanade.tachiyomi.lib.mixdropextractor.MixDropExtractor
|
||||||
import eu.kanade.tachiyomi.lib.okruextractor.OkruExtractor
|
import eu.kanade.tachiyomi.lib.okruextractor.OkruExtractor
|
||||||
import eu.kanade.tachiyomi.lib.voeextractor.VoeExtractor
|
import eu.kanade.tachiyomi.lib.voeextractor.VoeExtractor
|
||||||
import eu.kanade.tachiyomi.lib.youruploadextractor.YourUploadExtractor
|
import eu.kanade.tachiyomi.lib.youruploadextractor.YourUploadExtractor
|
||||||
import eu.kanade.tachiyomi.multisrc.animestream.AnimeStream
|
import eu.kanade.tachiyomi.multisrc.animestream.AnimeStream
|
||||||
import eu.kanade.tachiyomi.network.GET
|
|
||||||
|
|
||||||
class Tiodonghua : AnimeStream(
|
class Tiodonghua : AnimeStream(
|
||||||
"es",
|
"es",
|
||||||
@ -16,7 +13,6 @@ class Tiodonghua : AnimeStream(
|
|||||||
"https://anime.tiodonghua.com",
|
"https://anime.tiodonghua.com",
|
||||||
) {
|
) {
|
||||||
|
|
||||||
|
|
||||||
// ============================ Video Links =============================
|
// ============================ Video Links =============================
|
||||||
private val okruExtractor by lazy { OkruExtractor(client) }
|
private val okruExtractor by lazy { OkruExtractor(client) }
|
||||||
private val voeExtractor by lazy { VoeExtractor(client) }
|
private val voeExtractor by lazy { VoeExtractor(client) }
|
||||||
@ -35,5 +31,4 @@ class Tiodonghua : AnimeStream(
|
|||||||
|
|
||||||
override val fetchFilters: Boolean
|
override val fetchFilters: Boolean
|
||||||
get() = false
|
get() = false
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -33,6 +33,8 @@ class AnimesHouse : DooPlay(
|
|||||||
override fun latestUpdatesNextPageSelector(): String = "div.resppages > a > span.icon-chevron-right"
|
override fun latestUpdatesNextPageSelector(): String = "div.resppages > a > span.icon-chevron-right"
|
||||||
|
|
||||||
// ============================ Video Links =============================
|
// ============================ Video Links =============================
|
||||||
|
private val redplayBypasser by lazy { RedplayBypasser(client, headers) }
|
||||||
|
|
||||||
private fun getPlayerUrl(player: Element): String {
|
private fun getPlayerUrl(player: Element): String {
|
||||||
val body = FormBody.Builder()
|
val body = FormBody.Builder()
|
||||||
.add("action", "doo_player_ajax")
|
.add("action", "doo_player_ajax")
|
||||||
@ -45,8 +47,10 @@ class AnimesHouse : DooPlay(
|
|||||||
.use { it.asJsoup().selectFirst("iframe")!!.attr("src") }
|
.use { it.asJsoup().selectFirst("iframe")!!.attr("src") }
|
||||||
.let {
|
.let {
|
||||||
when {
|
when {
|
||||||
it.startsWith("/redplay") ->
|
it.contains("/redplay") -> {
|
||||||
RedplayBypasser(client, headers).fromUrl(baseUrl + it)
|
val url = if (it.startsWith("/")) baseUrl + it else it
|
||||||
|
redplayBypasser.fromUrl(url)
|
||||||
|
}
|
||||||
else -> it
|
else -> it
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -62,6 +66,12 @@ class AnimesHouse : DooPlay(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private val embedExtractor by lazy { EmbedExtractor(headers) }
|
||||||
|
private val edifierExtractor by lazy { EdifierExtractor(client, headers) }
|
||||||
|
private val mp4dooExtractor by lazy { MpFourDooExtractor(client, headers) }
|
||||||
|
private val genericExtractor by lazy { GenericExtractor(client, headers) }
|
||||||
|
private val mcpExtractor by lazy { McpExtractor(client, headers) }
|
||||||
|
|
||||||
private fun getPlayerVideos(url: String): List<Video> {
|
private fun getPlayerVideos(url: String): List<Video> {
|
||||||
val iframeBody = client.newCall(GET(url, headers)).execute()
|
val iframeBody = client.newCall(GET(url, headers)).execute()
|
||||||
.use { it.body.string() }
|
.use { it.body.string() }
|
||||||
@ -69,17 +79,23 @@ class AnimesHouse : DooPlay(
|
|||||||
val unpackedBody = JsUnpacker.unpack(iframeBody)
|
val unpackedBody = JsUnpacker.unpack(iframeBody)
|
||||||
|
|
||||||
return when {
|
return when {
|
||||||
"embed.php?" in url ->
|
"embed.php?" in url -> embedExtractor.getVideoList(url, iframeBody)
|
||||||
EmbedExtractor(headers).getVideoList(url, iframeBody)
|
"edifier" in url -> edifierExtractor.getVideoList(url)
|
||||||
"edifier" in url ->
|
"mp4doo" in url || "doomp4" in url -> mp4dooExtractor.getVideoList(unpackedBody)
|
||||||
EdifierExtractor(client, headers).getVideoList(url)
|
"clp-new" in url || "gcloud" in url -> genericExtractor.getVideoList(url, unpackedBody)
|
||||||
"mp4doo" in url ->
|
"mcp_comm" in unpackedBody -> mcpExtractor.getVideoList(unpackedBody)
|
||||||
MpFourDooExtractor(client, headers).getVideoList(unpackedBody)
|
"cloudg" in url -> {
|
||||||
"clp-new" in url || "gcloud" in url ->
|
unpackedBody.substringAfter("sources:[").substringBefore(']')
|
||||||
GenericExtractor(client, headers).getVideoList(url, unpackedBody)
|
.split('{')
|
||||||
"mcp_comm" in unpackedBody ->
|
.drop(1)
|
||||||
McpExtractor(client, headers).getVideoList(unpackedBody)
|
.mapNotNull {
|
||||||
else -> emptyList<Video>()
|
val videoUrl = it.substringAfter("\"file\":\"").substringBefore('"')
|
||||||
|
.takeUnless(String::isBlank) ?: return@mapNotNull null
|
||||||
|
val label = it.substringAfter("\"label\":\"").substringBefore('"')
|
||||||
|
Video(videoUrl, "CloudG - $label", videoUrl, headers)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else -> emptyList()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ class DooPlayGenerator : ThemeSourceGenerator {
|
|||||||
SingleLang("AnimePlayer", "https://animeplayer.com.br", "pt-BR", isNsfw = true, overrideVersionCode = 2),
|
SingleLang("AnimePlayer", "https://animeplayer.com.br", "pt-BR", isNsfw = true, overrideVersionCode = 2),
|
||||||
SingleLang("AnimeSAGA", "https://www.animesaga.in", "hi", isNsfw = false, overrideVersionCode = 8),
|
SingleLang("AnimeSAGA", "https://www.animesaga.in", "hi", isNsfw = false, overrideVersionCode = 8),
|
||||||
SingleLang("AnimesFox BR", "https://animesfox.net", "pt-BR", isNsfw = false, overrideVersionCode = 2),
|
SingleLang("AnimesFox BR", "https://animesfox.net", "pt-BR", isNsfw = false, overrideVersionCode = 2),
|
||||||
SingleLang("Animes House", "https://animeshouse.net", "pt-BR", isNsfw = false, overrideVersionCode = 7),
|
SingleLang("Animes House", "https://animeshouse.net", "pt-BR", isNsfw = false, overrideVersionCode = 8),
|
||||||
SingleLang("Cinemathek", "https://cinemathek.net", "de", isNsfw = true, overrideVersionCode = 17),
|
SingleLang("Cinemathek", "https://cinemathek.net", "de", isNsfw = true, overrideVersionCode = 17),
|
||||||
SingleLang("DonghuaX", "https://donghuax.com", "pt-BR", isNsfw = false, overrideVersionCode = 1),
|
SingleLang("DonghuaX", "https://donghuax.com", "pt-BR", isNsfw = false, overrideVersionCode = 1),
|
||||||
SingleLang("GoAnimes", "https://goanimes.net", "pt-BR", isNsfw = true, overrideVersionCode = 5),
|
SingleLang("GoAnimes", "https://goanimes.net", "pt-BR", isNsfw = true, overrideVersionCode = 5),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user