Elarc Toon: Skip responses that do not start with "text/html" (#2462)

* Elarc Toon: Skip responses that do not start with "text/html"

* Update build.gradle

* format
This commit is contained in:
lamaxama 2024-04-18 01:37:34 +08:00 committed by Draff
parent 4c13971c15
commit 597f1ad8d1
2 changed files with 7 additions and 1 deletions

View File

@ -3,7 +3,7 @@ ext {
extClass = '.ElarcPage' extClass = '.ElarcPage'
themePkg = 'mangathemesia' themePkg = 'mangathemesia'
baseUrl = 'https://elarctoons.com' baseUrl = 'https://elarctoons.com'
overrideVersionCode = 5 overrideVersionCode = 6
isNsfw = false isNsfw = false
} }

View File

@ -52,6 +52,12 @@ class ElarcPage : MangaThemesia(
// Always update URL // Always update URL
val response = chain.proceed(request) val response = chain.proceed(request)
// Skip responses that do not start with "text/html"
if (response.header("content-type")?.startsWith("text/html") != true) {
return response
}
val document = Jsoup.parse( val document = Jsoup.parse(
response.peekBody(Long.MAX_VALUE).string(), response.peekBody(Long.MAX_VALUE).string(),
request.url.toString(), request.url.toString(),