diff --git a/multisrc/overrides/dooplay/multimovies/src/extractors/AutoEmbedExtractor.kt b/multisrc/overrides/dooplay/multimovies/src/extractors/AutoEmbedExtractor.kt index 6ce61541fa..9baf130424 100644 --- a/multisrc/overrides/dooplay/multimovies/src/extractors/AutoEmbedExtractor.kt +++ b/multisrc/overrides/dooplay/multimovies/src/extractors/AutoEmbedExtractor.kt @@ -770,9 +770,6 @@ class AutoEmbedExtractor(private val client: OkHttpClient) { videoUrl.contains("rabbitstream") -> { RabbitStreamExtractor(client).videosFromUrl(videoUrl, headers = videoHeaders, prefix = prefix) } - videoUrl.contains("mixdrop") -> { - MixDropExtractor(client).videoFromUrl(videoUrl, prefix = prefix) - } videoUrl.contains("https://dood") -> { DoodExtractor(client).videoFromUrl(videoUrl, server.name, false) ?.let(::listOf) @@ -863,7 +860,7 @@ class AutoEmbedExtractor(private val client: OkHttpClient) { private fun getCaptchaToken(url: String, key: String): String? { return runCatching { val httpUrl = url.toHttpUrl() - val pureDomain = (httpUrl.scheme + "://" + httpUrl.host + ":443") + val pureDomain = httpUrl.scheme + "://" + httpUrl.host + ":443" val domain = Base64.encodeToString(pureDomain.encodeToByteArray(), Base64.DEFAULT) .replace("\n", "") .replace("=", ".") diff --git a/src/ar/akwam/src/eu/kanade/tachiyomi/animeextension/ar/akwam/Akwam.kt b/src/ar/akwam/src/eu/kanade/tachiyomi/animeextension/ar/akwam/Akwam.kt index 60df6b4648..271bb46cfe 100644 --- a/src/ar/akwam/src/eu/kanade/tachiyomi/animeextension/ar/akwam/Akwam.kt +++ b/src/ar/akwam/src/eu/kanade/tachiyomi/animeextension/ar/akwam/Akwam.kt @@ -86,7 +86,7 @@ class Akwam : ConfigurableAnimeSource, ParsedAnimeHttpSource() { episode.setUrlWithoutDomain(element.attr("href")) episode.name = element.text() episode.episode_number = when { - (epNum.isNotEmpty()) -> epNum.toFloat() + epNum.isNotEmpty() -> epNum.toFloatOrNull() ?: 1F else -> 1F } return episode diff --git a/src/ar/anime4up/src/eu/kanade/tachiyomi/animeextension/ar/anime4up/Anime4Up.kt b/src/ar/anime4up/src/eu/kanade/tachiyomi/animeextension/ar/anime4up/Anime4Up.kt index 129b5a993a..d528ef2a80 100644 --- a/src/ar/anime4up/src/eu/kanade/tachiyomi/animeextension/ar/anime4up/Anime4Up.kt +++ b/src/ar/anime4up/src/eu/kanade/tachiyomi/animeextension/ar/anime4up/Anime4Up.kt @@ -97,7 +97,7 @@ class Anime4Up : ConfigurableAnimeSource, ParsedAnimeHttpSource() { episode.setUrlWithoutDomain(element.select("div.episodes-card-container div.episodes-card div.ehover6 h3 a").attr("href")) // episode.episode_number = element.select("span:nth-child(3)").text().replace(" - ", "").toFloat() episode.episode_number = when { - (epNum.isNotEmpty()) -> epNum.toFloat() + epNum.isNotEmpty() -> epNum.toFloatOrNull() ?: 1F else -> 1F } episode.name = element.select("div.episodes-card-container div.episodes-card div.ehover6 h3 a").text() diff --git a/src/ar/animeblkom/src/eu/kanade/tachiyomi/animeextension/ar/animeblkom/AnimeBlkom.kt b/src/ar/animeblkom/src/eu/kanade/tachiyomi/animeextension/ar/animeblkom/AnimeBlkom.kt index cff5dea4bd..58f7cce6d9 100644 --- a/src/ar/animeblkom/src/eu/kanade/tachiyomi/animeextension/ar/animeblkom/AnimeBlkom.kt +++ b/src/ar/animeblkom/src/eu/kanade/tachiyomi/animeextension/ar/animeblkom/AnimeBlkom.kt @@ -131,7 +131,7 @@ class AnimeBlkom : ConfigurableAnimeSource, ParsedAnimeHttpSource() { val eptitle = element.selectFirst("span:nth-child(3)")!!.text() val epNum = eptitle.filter { it.isDigit() } episode_number = when { - (epNum.isNotEmpty()) -> epNum.toFloatOrNull() ?: 1F + epNum.isNotEmpty() -> epNum.toFloatOrNull() ?: 1F else -> 1F } name = eptitle + " :" + element.selectFirst("span:nth-child(1)")!!.text() diff --git a/src/ar/animelek/src/eu/kanade/tachiyomi/animeextension/ar/animelek/AnimeLek.kt b/src/ar/animelek/src/eu/kanade/tachiyomi/animeextension/ar/animelek/AnimeLek.kt index 11056d27e2..580d0889c9 100644 --- a/src/ar/animelek/src/eu/kanade/tachiyomi/animeextension/ar/animelek/AnimeLek.kt +++ b/src/ar/animelek/src/eu/kanade/tachiyomi/animeextension/ar/animelek/AnimeLek.kt @@ -68,7 +68,7 @@ class AnimeLek : ConfigurableAnimeSource, ParsedAnimeHttpSource() { name = text val epNum = text.filter { it.isDigit() } episode_number = when { - (epNum.isNotEmpty()) -> epNum.toFloatOrNull() ?: 1F + epNum.isNotEmpty() -> epNum.toFloatOrNull() ?: 1F else -> 1F } } diff --git a/src/ar/mycima/src/eu/kanade/tachiyomi/animeextension/ar/mycima/MyCima.kt b/src/ar/mycima/src/eu/kanade/tachiyomi/animeextension/ar/mycima/MyCima.kt index f7b3f7ae8e..99fff327ae 100644 --- a/src/ar/mycima/src/eu/kanade/tachiyomi/animeextension/ar/mycima/MyCima.kt +++ b/src/ar/mycima/src/eu/kanade/tachiyomi/animeextension/ar/mycima/MyCima.kt @@ -102,7 +102,7 @@ class MyCima : ConfigurableAnimeSource, ParsedAnimeHttpSource() { episode.setUrlWithoutDomain(if (type == "mSeries") element.select("a").attr("href") else element.attr("abs:href")) if (type == "series") { episode.episode_number = when { - (epNum.isNotEmpty()) -> epNum.toFloat() + epNum.isNotEmpty() -> epNum.toFloatOrNull() ?: 1F else -> 1F } } diff --git a/src/ar/okanime/src/eu/kanade/tachiyomi/animeextension/ar/okanime/Okanime.kt b/src/ar/okanime/src/eu/kanade/tachiyomi/animeextension/ar/okanime/Okanime.kt index fdc893adb4..4188ff235c 100644 --- a/src/ar/okanime/src/eu/kanade/tachiyomi/animeextension/ar/okanime/Okanime.kt +++ b/src/ar/okanime/src/eu/kanade/tachiyomi/animeextension/ar/okanime/Okanime.kt @@ -86,7 +86,7 @@ class Okanime : ConfigurableAnimeSource, ParsedAnimeHttpSource() { } override fun searchAnimeRequest(page: Int, query: String, filters: AnimeFilterList) = - ("$baseUrl/search/?s=$query") + "$baseUrl/search/?s=$query" .let { if (page > 1) "$it&page=$page" else it } .let(::GET) diff --git a/src/ar/xsanime/src/eu/kanade/tachiyomi/animeextension/ar/xsanime/XsAnime.kt b/src/ar/xsanime/src/eu/kanade/tachiyomi/animeextension/ar/xsanime/XsAnime.kt index 5a6c7b1118..10babd4c58 100644 --- a/src/ar/xsanime/src/eu/kanade/tachiyomi/animeextension/ar/xsanime/XsAnime.kt +++ b/src/ar/xsanime/src/eu/kanade/tachiyomi/animeextension/ar/xsanime/XsAnime.kt @@ -64,7 +64,7 @@ class XsAnime : ConfigurableAnimeSource, ParsedAnimeHttpSource() { episode.setUrlWithoutDomain(element.attr("abs:href")) episode.name = element.select("a > em").text() episode.episode_number = when { - (epNum.isNotEmpty()) -> epNum.toFloat() + epNum.isNotEmpty() -> epNum.toFloatOrNull() ?: 1F else -> 1F } diff --git a/src/de/filmpalast/src/eu/kanade/tachiyomi/animeextension/de/filmpalast/extractors/JsUnpacker.kt b/src/de/filmpalast/src/eu/kanade/tachiyomi/animeextension/de/filmpalast/extractors/JsUnpacker.kt index 82c29799a3..b30a838e1c 100644 --- a/src/de/filmpalast/src/eu/kanade/tachiyomi/animeextension/de/filmpalast/extractors/JsUnpacker.kt +++ b/src/de/filmpalast/src/eu/kanade/tachiyomi/animeextension/de/filmpalast/extractors/JsUnpacker.kt @@ -26,7 +26,7 @@ class JsUnpacker(packedJS: String?) { */ fun unpack(): String? { val js = packedJS - try { + runCatching { var p = Pattern.compile("""\}\s*\('(.*)',\s*(.*?),\s*(\d+),\s*'(.*?)'\.split\('\|'\)""", Pattern.DOTALL) var m = p.matcher(js) @@ -35,16 +35,8 @@ class JsUnpacker(packedJS: String?) { val radixStr = m.group(2) val countStr = m.group(3) val symtab = m.group(4).split("\\|".toRegex()).toTypedArray() - var radix = 36 - var count = 0 - try { - radix = radixStr.toInt() - } catch (e: Exception) { - } - try { - count = countStr.toInt() - } catch (e: Exception) { - } + val radix = radixStr.toIntOrNull() ?: 36 + val count = countStr.toIntOrNull() ?: 0 if (symtab.size != count) { throw Exception("Unknown p.a.c.k.e.r. encoding") } @@ -67,7 +59,6 @@ class JsUnpacker(packedJS: String?) { } return decoded.toString() } - } catch (e: Exception) { } return null } diff --git a/src/de/kool/src/eu/kanade/tachiyomi/animeextension/de/kool/extractors/JsUnpacker.kt b/src/de/kool/src/eu/kanade/tachiyomi/animeextension/de/kool/extractors/JsUnpacker.kt index 84d55feb37..287d1cb607 100644 --- a/src/de/kool/src/eu/kanade/tachiyomi/animeextension/de/kool/extractors/JsUnpacker.kt +++ b/src/de/kool/src/eu/kanade/tachiyomi/animeextension/de/kool/extractors/JsUnpacker.kt @@ -26,7 +26,7 @@ class JsUnpacker(packedJS: String?) { */ fun unpack(): String? { val js = packedJS - try { + runCatching { var p = Pattern.compile("""\}\s*\('(.*)',\s*(.*?),\s*(\d+),\s*'(.*?)'\.split\('\|'\)""", Pattern.DOTALL) var m = p.matcher(js) @@ -35,16 +35,8 @@ class JsUnpacker(packedJS: String?) { val radixStr = m.group(2) val countStr = m.group(3) val symtab = m.group(4).split("\\|".toRegex()).toTypedArray() - var radix = 36 - var count = 0 - try { - radix = radixStr.toInt() - } catch (e: Exception) { - } - try { - count = countStr.toInt() - } catch (e: Exception) { - } + val radix = radixStr.toIntOrNull() ?: 36 + val count = countStr.toIntOrNull() ?: 0 if (symtab.size != count) { throw Exception("Unknown p.a.c.k.e.r. encoding") } @@ -67,7 +59,6 @@ class JsUnpacker(packedJS: String?) { } return decoded.toString() } - } catch (e: Exception) { } return null } diff --git a/src/de/streamcloud/src/eu/kanade/tachiyomi/animeextension/de/streamcloud/StreamCloud.kt b/src/de/streamcloud/src/eu/kanade/tachiyomi/animeextension/de/streamcloud/StreamCloud.kt index 4265483e62..d2aa199e3c 100644 --- a/src/de/streamcloud/src/eu/kanade/tachiyomi/animeextension/de/streamcloud/StreamCloud.kt +++ b/src/de/streamcloud/src/eu/kanade/tachiyomi/animeextension/de/streamcloud/StreamCloud.kt @@ -96,7 +96,7 @@ class StreamCloud : ConfigurableAnimeSource, ParsedAnimeHttpSource() { when { li.text().contains("streamtape.com") && hosterSelection?.contains("stape") == true -> { val url = li.attr("data-link") - try { + runCatching { with( client.newCall(GET(url, headers = Headers.headersOf("Referer", baseUrl, "Cookie", "Fuck Streamtape because they add concatenation to fuck up scrapers"))) .execute().asJsoup(), @@ -108,7 +108,6 @@ class StreamCloud : ConfigurableAnimeSource, ParsedAnimeHttpSource() { videoList.add(Video(videoUrl, quality, videoUrl)) } } - } catch (e: Exception) { } } diff --git a/src/en/allanime/src/eu/kanade/tachiyomi/animeextension/en/allanime/AllAnime.kt b/src/en/allanime/src/eu/kanade/tachiyomi/animeextension/en/allanime/AllAnime.kt index 322eed5634..a91e1cb905 100644 --- a/src/en/allanime/src/eu/kanade/tachiyomi/animeextension/en/allanime/AllAnime.kt +++ b/src/en/allanime/src/eu/kanade/tachiyomi/animeextension/en/allanime/AllAnime.kt @@ -430,7 +430,9 @@ class AllAnime : ConfigurableAnimeSource, AnimeHttpSource() { .toByteArray().map { (it.toInt() xor 56).toChar() }.joinToString("") - } else this + } else { + this + } } private fun prioritySort(pList: List>): List