From aae8b2095d3e868212a155411df4a858eb3169fd Mon Sep 17 00:00:00 2001 From: Ejan <35057681+e-shl@users.noreply.github.com> Date: Tue, 12 Jul 2022 03:42:11 +0500 Subject: [PATCH] [RU]LibGroup new auth-layout for 18+ (#12534) * [RU]LibGroup new auth-layout for 18+ * sign-in button --- .../eu/kanade/tachiyomi/multisrc/libgroup/LibGenerator.kt | 2 +- .../eu/kanade/tachiyomi/multisrc/libgroup/LibGroup.kt | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/libgroup/LibGenerator.kt b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/libgroup/LibGenerator.kt index 665c5752b..7a0c45089 100644 --- a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/libgroup/LibGenerator.kt +++ b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/libgroup/LibGenerator.kt @@ -9,7 +9,7 @@ class LibGenerator: ThemeSourceGenerator { override val themeClass = "LibGroup" - override val baseVersionCode: Int = 8 + override val baseVersionCode: Int = 9 override val sources = listOf( SingleLang("MangaLib", "https://mangalib.me", "ru", overrideVersionCode = 74), diff --git a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/libgroup/LibGroup.kt b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/libgroup/LibGroup.kt index c70180f45..344fca5d5 100644 --- a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/libgroup/LibGroup.kt +++ b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/libgroup/LibGroup.kt @@ -280,7 +280,7 @@ abstract class LibGroup( return client.newCall(mangaDetailsRequest(manga)) .asObservable().doOnNext { response -> if (!response.isSuccessful) { - if (response.code == 404 && response.asJsoup().select("#show-login-button").isNotEmpty()) throw Exception("HTTP error ${response.code}. Для просмотра 18+ контента необходима авторизация через WebView") else throw Exception("HTTP error ${response.code}") + if (response.code == 404 && response.asJsoup().select(".m-menu__sign-in").isNotEmpty()) throw Exception("HTTP error ${response.code}. Для просмотра 18+ контента необходима авторизация через WebView") else throw Exception("HTTP error ${response.code}") } } .map { response -> @@ -291,7 +291,7 @@ abstract class LibGroup( override fun chapterListParse(response: Response): List { val document = response.asJsoup() val rawAgeStop = document.select(".media-short-info .media-short-info__item[data-caution]").text() - if (rawAgeStop == "18+" && document.select("#show-login-button").isNotEmpty()) + if (rawAgeStop == "18+" && document.select(".m-menu__sign-in").isNotEmpty()) throw Exception("Для просмотра 18+ контента необходима авторизация через WebView") val redirect = document.html() if (redirect.contains("paper empty section")) { @@ -325,7 +325,7 @@ abstract class LibGroup( return client.newCall(mangaDetailsRequest(manga)) .asObservable().doOnNext { response -> if (!response.isSuccessful) { - if (response.code == 404 && response.asJsoup().select("#show-login-button").isNotEmpty()) throw Exception("HTTP error ${response.code}. Для просмотра 18+ контента необходима авторизация через WebView") else throw Exception("HTTP error ${response.code}") + if (response.code == 404 && response.asJsoup().select(".m-menu__sign-in").isNotEmpty()) throw Exception("HTTP error ${response.code}. Для просмотра 18+ контента необходима авторизация через WebView") else throw Exception("HTTP error ${response.code}") } } .map { response -> @@ -420,7 +420,7 @@ abstract class LibGroup( //redirect Регистрация 18+ val redirect = document.html() if (!redirect.contains("window.__info")) { - if (redirect.contains("hold-transition login-page")) { + if (redirect.contains("auth-layout")) { throw Exception("Для просмотра 18+ контента необходима авторизация через WebView") } }