From 0f551203f1b525a3dd1588935ddbfd9773b713c6 Mon Sep 17 00:00:00 2001 From: scb261 <65343233+scb261@users.noreply.github.com> Date: Wed, 3 Mar 2021 15:56:32 +0200 Subject: [PATCH] MangaLib: notify user when manga redirects to home page (#6026) --- src/ru/libmanga/build.gradle | 2 +- .../src/eu/kanade/tachiyomi/extension/ru/libmanga/LibManga.kt | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ru/libmanga/build.gradle b/src/ru/libmanga/build.gradle index 4175b2230..543cb18ab 100644 --- a/src/ru/libmanga/build.gradle +++ b/src/ru/libmanga/build.gradle @@ -5,7 +5,7 @@ ext { extName = 'MangaLib' pkgNameSuffix = 'ru.libmanga' extClass = '.LibManga' - extVersionCode = 33 + extVersionCode = 34 libVersion = '1.2' } diff --git a/src/ru/libmanga/src/eu/kanade/tachiyomi/extension/ru/libmanga/LibManga.kt b/src/ru/libmanga/src/eu/kanade/tachiyomi/extension/ru/libmanga/LibManga.kt index 3236e79d6..61f767c69 100644 --- a/src/ru/libmanga/src/eu/kanade/tachiyomi/extension/ru/libmanga/LibManga.kt +++ b/src/ru/libmanga/src/eu/kanade/tachiyomi/extension/ru/libmanga/LibManga.kt @@ -146,6 +146,10 @@ class LibManga : ConfigurableSource, HttpSource() { override fun mangaDetailsParse(response: Response): SManga { val document = response.asJsoup() + + if (document.select("body[data-page=home]").isNotEmpty()) + throw Exception("Can't open manga. Try log in via WebView") + val manga = SManga.create() if (document.html().contains("Манга удалена по просьбе правообладателей")) {