mirror of
https://github.com/rebelonion/Dantotsu.git
synced 2026-01-18 11:23:56 +00:00
extension fix
This commit is contained in:
@@ -137,4 +137,4 @@ private val ERROR_CODES = listOf(403, 503)
|
||||
private val SERVER_CHECK = arrayOf("cloudflare-nginx", "cloudflare")
|
||||
private val COOKIE_NAMES = listOf("cf_clearance")
|
||||
|
||||
private class CloudflareBypassException : Exception()
|
||||
class CloudflareBypassException : Exception()
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
package ani.dantotsu.parsers
|
||||
|
||||
import android.widget.Toast
|
||||
import ani.dantotsu.FileUrl
|
||||
import ani.dantotsu.aniyomi.anime.model.AnimeExtension
|
||||
import ani.dantotsu.aniyomi.animesource.AnimeCatalogueSource
|
||||
import ani.dantotsu.aniyomi.util.network.interceptor.CloudflareBypassException
|
||||
import ani.dantotsu.currContext
|
||||
import ani.dantotsu.logger
|
||||
import eu.kanade.tachiyomi.animesource.model.SEpisode
|
||||
import eu.kanade.tachiyomi.animesource.model.AnimeFilterList
|
||||
@@ -73,11 +76,13 @@ class DynamicAnimeParser(extension: AnimeExtension.Installed) : AnimeParser() {
|
||||
|
||||
var res: AnimesPage? = null
|
||||
try {
|
||||
res = source.fetchSearchAnime(0, query, AnimeFilterList()).toBlocking().first()
|
||||
println("res: $res")
|
||||
res = source.fetchSearchAnime(1, query, AnimeFilterList()).toBlocking().first()
|
||||
logger("res observable: $res")
|
||||
}
|
||||
catch (e: Exception) {
|
||||
logger("Exception: $e")
|
||||
catch (e: CloudflareBypassException) {
|
||||
logger("Exception in search: $e")
|
||||
//toast
|
||||
Toast.makeText(currContext(), "Failed to bypass Cloudflare", Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
|
||||
val conv = convertAnimesPageToShowResponse(res!!)
|
||||
|
||||
@@ -497,7 +497,7 @@ OS Version: $CODENAME $RELEASE ($SDK_INT)
|
||||
title = "Enjoying the App?"
|
||||
addView(TextView(this@SettingsActivity).apply {
|
||||
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 :(") {
|
||||
|
||||
Reference in New Issue
Block a user