From 25b1fd6997042fc0a95019c11cf6bf22146d0b28 Mon Sep 17 00:00:00 2001 From: Eugene <35057681+e-shl@users.noreply.github.com> Date: Mon, 10 May 2021 16:47:26 +0500 Subject: [PATCH] fixed the title without authorization, the cover from the mirror (#6948) --- src/ru/libmanga/build.gradle | 2 +- .../eu/kanade/tachiyomi/extension/ru/libmanga/LibManga.kt | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ru/libmanga/build.gradle b/src/ru/libmanga/build.gradle index f38acc768..ea4191ead 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 = 43 + extVersionCode = 44 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 097dbbb29..a0eeb71a4 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 @@ -56,6 +56,7 @@ class LibManga : ConfigurableSource, HttpSource() { // The mirror is used because the main site "mangalib.me" in application returns error 403 override val baseUrl: String = "https://mangalib.org" + private val baseOrigUrl: String = "https://mangalib.me" override fun headersBuilder() = Headers.Builder().apply { add("User-Agent", "Mozilla/5.0 (Windows NT 6.3; WOW64)") @@ -86,7 +87,7 @@ class LibManga : ConfigurableSource, HttpSource() { element.select("a").first().let { link -> manga.setUrlWithoutDomain(link.attr("href")) - manga.title = element.select(".updates__name_rus").first().text() + manga.title = if (element.select(".updates__name_rus").isNullOrEmpty()) { element.select("h4").first().text() } else element.select(".updates__name_rus").first().text() } return manga } @@ -172,7 +173,7 @@ class LibManga : ConfigurableSource, HttpSource() { val genres = document.select(".media-tags > a").map { it.text() } manga.title = document.select(".media-name__alt").text() - manga.thumbnail_url = document.select(".media-sidebar__cover > img").attr("src") + manga.thumbnail_url = baseUrl + document.select(".media-sidebar__cover > img").attr("src").substringAfter(baseOrigUrl) manga.author = body.select("div.media-info-list__title:contains(Автор) + div").text() manga.artist = body.select("div.media-info-list__title:contains(Художник) + div").text() manga.status = when (