MNS: Show message on error (#3516)

* message

* check on all pages
This commit is contained in:
bapeey 2024-06-12 05:37:42 -05:00 committed by Draff
parent 29624cca71
commit 6617b33598
No known key found for this signature in database
GPG Key ID: E8A89F3211677653
2 changed files with 4 additions and 1 deletions

View File

@ -3,7 +3,7 @@ ext {
extClass = '.MangasNoSekai' extClass = '.MangasNoSekai'
themePkg = 'madara' themePkg = 'madara'
baseUrl = 'https://mangasnosekai.com' baseUrl = 'https://mangasnosekai.com'
overrideVersionCode = 14 overrideVersionCode = 15
} }
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"

View File

@ -231,6 +231,9 @@ class MangasNoSekai : Madara(
do { do {
val xhrRequest = altChapterRequest(url, mangaId, page, objects) val xhrRequest = altChapterRequest(url, mangaId, page, objects)
val xhrResponse = client.newCall(xhrRequest).execute() val xhrResponse = client.newCall(xhrRequest).execute()
if (!xhrResponse.isSuccessful) {
throw Exception("HTTP ${xhrResponse.code}: Intente iniciar sesión en WebView")
}
val xhrBody = xhrResponse.body.string() val xhrBody = xhrResponse.body.string()
if (xhrBody.startsWith("{")) { if (xhrBody.startsWith("{")) {
return chaptersFromJson(xhrBody, mangaSlug) return chaptersFromJson(xhrBody, mangaSlug)