extension fix

This commit is contained in:
Finnley Somdahl 2023-10-18 15:43:17 -05:00
parent 3007e7d86e
commit dbe573131e
3 changed files with 11 additions and 6 deletions

View file

@ -137,4 +137,4 @@ private val ERROR_CODES = listOf(403, 503)
private val SERVER_CHECK = arrayOf("cloudflare-nginx", "cloudflare") private val SERVER_CHECK = arrayOf("cloudflare-nginx", "cloudflare")
private val COOKIE_NAMES = listOf("cf_clearance") private val COOKIE_NAMES = listOf("cf_clearance")
private class CloudflareBypassException : Exception() class CloudflareBypassException : Exception()

View file

@ -1,8 +1,11 @@
package ani.dantotsu.parsers package ani.dantotsu.parsers
import android.widget.Toast
import ani.dantotsu.FileUrl import ani.dantotsu.FileUrl
import ani.dantotsu.aniyomi.anime.model.AnimeExtension import ani.dantotsu.aniyomi.anime.model.AnimeExtension
import ani.dantotsu.aniyomi.animesource.AnimeCatalogueSource import ani.dantotsu.aniyomi.animesource.AnimeCatalogueSource
import ani.dantotsu.aniyomi.util.network.interceptor.CloudflareBypassException
import ani.dantotsu.currContext
import ani.dantotsu.logger import ani.dantotsu.logger
import eu.kanade.tachiyomi.animesource.model.SEpisode import eu.kanade.tachiyomi.animesource.model.SEpisode
import eu.kanade.tachiyomi.animesource.model.AnimeFilterList import eu.kanade.tachiyomi.animesource.model.AnimeFilterList
@ -73,11 +76,13 @@ class DynamicAnimeParser(extension: AnimeExtension.Installed) : AnimeParser() {
var res: AnimesPage? = null var res: AnimesPage? = null
try { try {
res = source.fetchSearchAnime(0, query, AnimeFilterList()).toBlocking().first() res = source.fetchSearchAnime(1, query, AnimeFilterList()).toBlocking().first()
println("res: $res") logger("res observable: $res")
} }
catch (e: Exception) { catch (e: CloudflareBypassException) {
logger("Exception: $e") logger("Exception in search: $e")
//toast
Toast.makeText(currContext(), "Failed to bypass Cloudflare", Toast.LENGTH_SHORT).show()
} }
val conv = convertAnimesPageToShowResponse(res!!) val conv = convertAnimesPageToShowResponse(res!!)

View file

@ -497,7 +497,7 @@ OS Version: $CODENAME $RELEASE ($SDK_INT)
title = "Enjoying the App?" title = "Enjoying the App?"
addView(TextView(this@SettingsActivity).apply { addView(TextView(this@SettingsActivity).apply {
text = text =
"Consider donating!\nOnce we reach the goal of $1000 (60%+ already reached!), Get ready to get an Offline Player & Manga Downloads!" "Consider donating!r"
}) })
setNegativeButton("no moners :(") { setNegativeButton("no moners :(") {