From 6997ca9c51ec643c6103b3ac28a7a0b7d5a1f374 Mon Sep 17 00:00:00 2001 From: imper1aldev Date: Sat, 6 Jan 2024 23:26:46 -0600 Subject: [PATCH 1/2] TioAnime updates --- src/es/tioanime/build.gradle | 3 +- .../animeextension/es/tioanimeh/TioanimeH.kt | 116 +++++++++------- .../tioanimeh/extractors/VidGuardExtractor.kt | 124 ++++++++++++++++++ 3 files changed, 195 insertions(+), 48 deletions(-) create mode 100644 src/es/tioanime/src/eu/kanade/tachiyomi/animeextension/es/tioanimeh/extractors/VidGuardExtractor.kt diff --git a/src/es/tioanime/build.gradle b/src/es/tioanime/build.gradle index 82fd1e3fa4..0867330496 100644 --- a/src/es/tioanime/build.gradle +++ b/src/es/tioanime/build.gradle @@ -5,13 +5,14 @@ ext { extName = 'TioanimeH' pkgNameSuffix = 'es.tioanimeh' extClass = '.TioanimeHFactory' - extVersionCode = 13 + extVersionCode = 14 libVersion = '13' } dependencies { implementation(project(':lib-yourupload-extractor')) implementation(project(':lib-okru-extractor')) + implementation(project(':lib-voe-extractor')) } diff --git a/src/es/tioanime/src/eu/kanade/tachiyomi/animeextension/es/tioanimeh/TioanimeH.kt b/src/es/tioanime/src/eu/kanade/tachiyomi/animeextension/es/tioanimeh/TioanimeH.kt index eee6918ff6..32cc04a672 100644 --- a/src/es/tioanime/src/eu/kanade/tachiyomi/animeextension/es/tioanimeh/TioanimeH.kt +++ b/src/es/tioanime/src/eu/kanade/tachiyomi/animeextension/es/tioanimeh/TioanimeH.kt @@ -4,6 +4,7 @@ import android.app.Application import android.content.SharedPreferences import androidx.preference.ListPreference import androidx.preference.PreferenceScreen +import eu.kanade.tachiyomi.animeextension.es.tioanimeh.extractors.VidGuardExtractor import eu.kanade.tachiyomi.animesource.ConfigurableAnimeSource import eu.kanade.tachiyomi.animesource.model.AnimeFilter import eu.kanade.tachiyomi.animesource.model.AnimeFilterList @@ -12,6 +13,7 @@ import eu.kanade.tachiyomi.animesource.model.SEpisode import eu.kanade.tachiyomi.animesource.model.Video import eu.kanade.tachiyomi.animesource.online.ParsedAnimeHttpSource import eu.kanade.tachiyomi.lib.okruextractor.OkruExtractor +import eu.kanade.tachiyomi.lib.voeextractor.VoeExtractor import eu.kanade.tachiyomi.lib.youruploadextractor.YourUploadExtractor import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.util.asJsoup @@ -28,7 +30,7 @@ open class TioanimeH(override val name: String, override val baseUrl: String) : override val lang = "es" - override val supportsLatest = false + override val supportsLatest = true override val client: OkHttpClient = network.cloudflareClient @@ -36,6 +38,21 @@ open class TioanimeH(override val name: String, override val baseUrl: String) : Injekt.get().getSharedPreferences("source_$id", 0x0000) } + companion object { + private const val PREF_QUALITY_KEY = "preferred_quality" + private const val PREF_QUALITY_DEFAULT = "1080" + private val QUALITY_LIST = arrayOf("1080", "720", "480", "360") + + private const val PREF_SERVER_KEY = "preferred_server" + private const val PREF_SERVER_DEFAULT = "Voe" + private val SERVER_LIST = arrayOf( + "YourUpload", + "Voe", + "VidGuard", + "Okru", + ) + } + override fun popularAnimeSelector(): String = "ul.animes.list-unstyled.row li.col-6.col-sm-4.col-md-3.col-xl-2" override fun popularAnimeRequest(page: Int): Request = GET("$baseUrl/directorio?p=$page") @@ -84,14 +101,10 @@ open class TioanimeH(override val name: String, override val baseUrl: String) : val serverName = servers[0] val serverUrl = servers[1].replace("\\/", "/") when (serverName.lowercase()) { - "okru" -> { - OkruExtractor(client).videosFromUrl(serverUrl).map { vid -> videoList.add(vid) } - } - "yourupload" -> { - videoList.addAll( - YourUploadExtractor(client).videoFromUrl(serverUrl, headers = headers), - ) - } + "voe" -> VoeExtractor(client).videosFromUrl(serverUrl).let(videoList::addAll) + "vidguard" -> VidGuardExtractor(client).videosFromUrl(serverUrl).let(videoList::addAll) + "okru" -> OkruExtractor(client).videosFromUrl(serverUrl).let(videoList::addAll) + "yourupload" -> YourUploadExtractor(client).videoFromUrl(serverUrl, headers = headers).let(videoList::addAll) } } @@ -105,24 +118,15 @@ open class TioanimeH(override val name: String, override val baseUrl: String) : override fun videoFromElement(element: Element) = throw Exception("not used") override fun List