From 01d2a86968ddf43eb9240067438526e7a7db7a27 Mon Sep 17 00:00:00 2001 From: Claudemirovsky <63046606+Claudemirovsky@users.noreply.github.com> Date: Wed, 14 Feb 2024 17:39:23 -0300 Subject: [PATCH 1/5] fix(search): Update search endpoint --- .../tachiyomi/animeextension/pt/animesvision/AnimesVision.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pt/animesvision/src/eu/kanade/tachiyomi/animeextension/pt/animesvision/AnimesVision.kt b/src/pt/animesvision/src/eu/kanade/tachiyomi/animeextension/pt/animesvision/AnimesVision.kt index 1a6f134403..2c12de4046 100644 --- a/src/pt/animesvision/src/eu/kanade/tachiyomi/animeextension/pt/animesvision/AnimesVision.kt +++ b/src/pt/animesvision/src/eu/kanade/tachiyomi/animeextension/pt/animesvision/AnimesVision.kt @@ -106,7 +106,7 @@ class AnimesVision : ConfigurableAnimeSource, ParsedAnimeHttpSource() { override fun searchAnimeRequest(page: Int, query: String, filters: AnimeFilterList): Request { val params = AVFilters.getSearchParameters(filters) - val url = "$baseUrl/search?".toHttpUrl().newBuilder() + val url = "$baseUrl/search-anime".toHttpUrl().newBuilder() .addQueryParameter("page", page.toString()) .addQueryParameter("nome", query) .addQueryParameter("tipo", params.type) @@ -122,7 +122,7 @@ class AnimesVision : ConfigurableAnimeSource, ParsedAnimeHttpSource() { .addQueryParameter("generos", params.genres) .build() - return GET(url.toString(), headers) + return GET(url, headers) } override fun searchAnimeSelector() = "div.film_list-wrap div.film-poster" From ac631fda8c0ab5a0ad4c40041cb9573f5a2e241b Mon Sep 17 00:00:00 2001 From: Claudemirovsky <63046606+Claudemirovsky@users.noreply.github.com> Date: Wed, 14 Feb 2024 17:41:54 -0300 Subject: [PATCH 2/5] fix: Fix crash in url intent handler --- .../pt/animesvision/AnimesVision.kt | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/pt/animesvision/src/eu/kanade/tachiyomi/animeextension/pt/animesvision/AnimesVision.kt b/src/pt/animesvision/src/eu/kanade/tachiyomi/animeextension/pt/animesvision/AnimesVision.kt index 2c12de4046..d76acdabe0 100644 --- a/src/pt/animesvision/src/eu/kanade/tachiyomi/animeextension/pt/animesvision/AnimesVision.kt +++ b/src/pt/animesvision/src/eu/kanade/tachiyomi/animeextension/pt/animesvision/AnimesVision.kt @@ -139,6 +139,7 @@ class AnimesVision : ConfigurableAnimeSource, ParsedAnimeHttpSource() { // =========================== Anime Details ============================ override fun animeDetailsParse(document: Document) = SAnime.create().apply { val doc = getRealDoc(document) + setUrlWithoutDomain(doc.location()) val content = doc.selectFirst("div#ani_detail div.anis-content")!! val detail = content.selectFirst("div.anisc-detail")!! @@ -152,13 +153,13 @@ class AnimesVision : ConfigurableAnimeSource, ParsedAnimeHttpSource() { status = parseStatus(infos.getInfo("Status")) description = buildString { - append(infos.getInfo("Sinopse") + "\n") - infos.getInfo("Inglês")?.also { append("\nTítulo em inglês: $it") } - infos.getInfo("Japonês")?.also { append("\nTítulo em japonês: $it") } - infos.getInfo("Foi ao ar em")?.also { append("\nFoi ao ar em: $it") } - infos.getInfo("Temporada")?.also { append("\nTemporada: $it") } - infos.getInfo("Duração")?.also { append("\nDuração: $it") } - infos.getInfo("Fansub")?.also { append("\nFansub: $it") } + appendLine(infos.getInfo("Sinopse")) + infos.getInfo("Inglês")?.also { append("\nTítulo em inglês: ", it) } + infos.getInfo("Japonês")?.also { append("\nTítulo em japonês: ", it) } + infos.getInfo("Foi ao ar em")?.also { append("\nFoi ao ar em: ", it) } + infos.getInfo("Temporada")?.also { append("\nTemporada: ", it) } + infos.getInfo("Duração")?.also { append("\nDuração: ", it) } + infos.getInfo("Fansub")?.also { append("\nFansub: ", it) } } } From 3bc33fdf0a7daa680754246150fe54728b940707 Mon Sep 17 00:00:00 2001 From: Claudemirovsky <63046606+Claudemirovsky@users.noreply.github.com> Date: Wed, 14 Feb 2024 18:11:50 -0300 Subject: [PATCH 3/5] fix: Fix native video extractor + remove external extractors --- src/pt/animesvision/build.gradle | 6 -- .../pt/animesvision/AnimesVision.kt | 76 ++----------------- .../extractors/AnimesVisionExtractor.kt | 16 ++++ .../extractors/GlobalVisionExtractor.kt | 18 ----- .../pt/animesvision/extractors/JsDecoder.kt | 40 ++++++++++ 5 files changed, 62 insertions(+), 94 deletions(-) create mode 100644 src/pt/animesvision/src/eu/kanade/tachiyomi/animeextension/pt/animesvision/extractors/AnimesVisionExtractor.kt delete mode 100644 src/pt/animesvision/src/eu/kanade/tachiyomi/animeextension/pt/animesvision/extractors/GlobalVisionExtractor.kt create mode 100644 src/pt/animesvision/src/eu/kanade/tachiyomi/animeextension/pt/animesvision/extractors/JsDecoder.kt diff --git a/src/pt/animesvision/build.gradle b/src/pt/animesvision/build.gradle index ab1c301a1b..8efabbb99c 100644 --- a/src/pt/animesvision/build.gradle +++ b/src/pt/animesvision/build.gradle @@ -5,9 +5,3 @@ ext { } apply from: "$rootDir/common.gradle" - -dependencies { - implementation(project(':lib:voe-extractor')) - implementation(project(':lib:streamtape-extractor')) - implementation(project(':lib:dood-extractor')) -} \ No newline at end of file diff --git a/src/pt/animesvision/src/eu/kanade/tachiyomi/animeextension/pt/animesvision/AnimesVision.kt b/src/pt/animesvision/src/eu/kanade/tachiyomi/animeextension/pt/animesvision/AnimesVision.kt index d76acdabe0..23a6b19a15 100644 --- a/src/pt/animesvision/src/eu/kanade/tachiyomi/animeextension/pt/animesvision/AnimesVision.kt +++ b/src/pt/animesvision/src/eu/kanade/tachiyomi/animeextension/pt/animesvision/AnimesVision.kt @@ -3,10 +3,7 @@ package eu.kanade.tachiyomi.animeextension.pt.animesvision import android.app.Application import androidx.preference.ListPreference import androidx.preference.PreferenceScreen -import eu.kanade.tachiyomi.animeextension.pt.animesvision.dto.AVResponseDto -import eu.kanade.tachiyomi.animeextension.pt.animesvision.dto.PayloadData -import eu.kanade.tachiyomi.animeextension.pt.animesvision.dto.PayloadItem -import eu.kanade.tachiyomi.animeextension.pt.animesvision.extractors.GlobalVisionExtractor +import eu.kanade.tachiyomi.animeextension.pt.animesvision.extractors.AnimesVisionExtractor import eu.kanade.tachiyomi.animesource.ConfigurableAnimeSource import eu.kanade.tachiyomi.animesource.model.AnimeFilterList import eu.kanade.tachiyomi.animesource.model.AnimesPage @@ -14,27 +11,17 @@ import eu.kanade.tachiyomi.animesource.model.SAnime 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.doodextractor.DoodExtractor -import eu.kanade.tachiyomi.lib.streamtapeextractor.StreamTapeExtractor -import eu.kanade.tachiyomi.lib.voeextractor.VoeExtractor import eu.kanade.tachiyomi.network.GET -import eu.kanade.tachiyomi.network.POST -import eu.kanade.tachiyomi.network.await import eu.kanade.tachiyomi.network.awaitSuccess import eu.kanade.tachiyomi.util.asJsoup -import eu.kanade.tachiyomi.util.parallelFlatMapBlocking -import kotlinx.serialization.encodeToString -import kotlinx.serialization.json.Json import okhttp3.HttpUrl.Companion.toHttpUrl import okhttp3.Interceptor import okhttp3.Request -import okhttp3.RequestBody.Companion.toRequestBody import okhttp3.Response import org.jsoup.nodes.Document import org.jsoup.nodes.Element import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get -import uy.kohesive.injekt.injectLazy import java.io.IOException class AnimesVision : ConfigurableAnimeSource, ParsedAnimeHttpSource() { @@ -51,8 +38,6 @@ class AnimesVision : ConfigurableAnimeSource, ParsedAnimeHttpSource() { .addInterceptor(::loginInterceptor) .build() - private val json: Json by injectLazy() - private val preferences by lazy { Injekt.get().getSharedPreferences("source_$id", 0x0000) } @@ -194,62 +179,13 @@ class AnimesVision : ConfigurableAnimeSource, ParsedAnimeHttpSource() { // ============================ Video Links ============================= override fun videoListParse(response: Response): List