From c9962e50054015f0d8613392a51c98f22be7189c Mon Sep 17 00:00:00 2001 From: Blue cat <42893969+BlueCat300@users.noreply.github.com> Date: Mon, 5 Apr 2021 00:23:56 +0300 Subject: [PATCH] [RU] ReadManga / MintManga / AllHentai: Added Scanlator, Data upload, Author (#6402) (cherry picked from commit 0a2a5103a461c6db1f3ef9196ec68cfaa2e42af7) --- src/ru/allhentai/build.gradle | 2 +- .../extension/ru/allhentai/AllHentai.kt | 21 +++++++++++++++---- src/ru/mintmanga/build.gradle | 2 +- .../extension/ru/mintmanga/Mintmanga.kt | 17 +++++++++++++-- src/ru/readmanga/build.gradle | 2 +- .../extension/ru/readmanga/Readmanga.kt | 15 ++++++++++++- 6 files changed, 49 insertions(+), 10 deletions(-) diff --git a/src/ru/allhentai/build.gradle b/src/ru/allhentai/build.gradle index 08eaad66d..e7f6bf81a 100644 --- a/src/ru/allhentai/build.gradle +++ b/src/ru/allhentai/build.gradle @@ -5,7 +5,7 @@ ext { extName = 'AllHentai' pkgNameSuffix = 'ru.allhentai' extClass = '.AllHentai' - extVersionCode = 2 + extVersionCode = 3 libVersion = '1.2' containsNsfw = true } diff --git a/src/ru/allhentai/src/eu/kanade/tachiyomi/extension/ru/allhentai/AllHentai.kt b/src/ru/allhentai/src/eu/kanade/tachiyomi/extension/ru/allhentai/AllHentai.kt index 951df499f..7bc154e6f 100644 --- a/src/ru/allhentai/src/eu/kanade/tachiyomi/extension/ru/allhentai/AllHentai.kt +++ b/src/ru/allhentai/src/eu/kanade/tachiyomi/extension/ru/allhentai/AllHentai.kt @@ -99,7 +99,11 @@ class AllHentai : ParsedHttpSource() { } val manga = SManga.create() - manga.author = infoElement.select("span.elem_author").first()?.text() + var authorElement = infoElement.select("span.elem_author").first()?.text() + if (authorElement == null) { + authorElement = infoElement.select("span.elem_screenwriter").first()?.text() + } + manga.author = authorElement manga.artist = infoElement.select("span.elem_illustrator").first()?.text() manga.genre = infoElement.select("span.elem_genre").text().split(",").plusElement(category).joinToString { it.trim() } manga.description = infoElement.select("div.manga-description").text() @@ -141,6 +145,15 @@ class AllHentai : ParsedHttpSource() { val chapter = SChapter.create() chapter.setUrlWithoutDomain(urlElement.attr("href") + "?mtr=1") + var translators = "" + val translatorElement = urlElement.attr("title") + if (!translatorElement.isNullOrBlank()) { + translators = translatorElement + .replace("(Переводчик),", "&") + .removeSuffix(" (Переводчик)") + } + chapter.scanlator = translators + chapter.name = urlText.removeSuffix(" новое").trim() if (manga.title.length > 25) { for (word in manga.title.split(' ')) { @@ -154,11 +167,11 @@ class AllHentai : ParsedHttpSource() { chapter.name = chapter.name.substringAfter("…").trim() } - chapter.date_upload = element.select("td.hidden-xxs").last()?.text()?.let { + chapter.date_upload = element.select("td.d-none").last()?.text()?.let { try { - SimpleDateFormat("dd.MM.yy", Locale.US).parse(it).time + SimpleDateFormat("dd.MM.yy", Locale.US).parse(it)?.time ?: 0L } catch (e: ParseException) { - SimpleDateFormat("dd/MM/yy", Locale.US).parse(it).time + SimpleDateFormat("dd/MM/yy", Locale.US).parse(it)?.time ?: 0L } } ?: 0 return chapter diff --git a/src/ru/mintmanga/build.gradle b/src/ru/mintmanga/build.gradle index 83095117b..505530596 100644 --- a/src/ru/mintmanga/build.gradle +++ b/src/ru/mintmanga/build.gradle @@ -5,7 +5,7 @@ ext { extName = 'Mintmanga' pkgNameSuffix = 'ru.mintmanga' extClass = '.Mintmanga' - extVersionCode = 24 + extVersionCode = 25 libVersion = '1.2' } diff --git a/src/ru/mintmanga/src/eu/kanade/tachiyomi/extension/ru/mintmanga/Mintmanga.kt b/src/ru/mintmanga/src/eu/kanade/tachiyomi/extension/ru/mintmanga/Mintmanga.kt index b51384c75..dc0879dab 100644 --- a/src/ru/mintmanga/src/eu/kanade/tachiyomi/extension/ru/mintmanga/Mintmanga.kt +++ b/src/ru/mintmanga/src/eu/kanade/tachiyomi/extension/ru/mintmanga/Mintmanga.kt @@ -106,7 +106,11 @@ class Mintmanga : ParsedHttpSource() { } val manga = SManga.create() - manga.author = infoElement.select("span.elem_author").first()?.text() + var authorElement = infoElement.select("span.elem_author").first()?.text() + if (authorElement == null) { + authorElement = infoElement.select("span.elem_screenwriter").first()?.text() + } + manga.author = authorElement manga.artist = infoElement.select("span.elem_illustrator").first()?.text() manga.genre = infoElement.select("span.elem_genre").text().split(",").plusElement(category).joinToString { it.trim() } manga.description = infoElement.select("div.manga-description").text() @@ -148,6 +152,15 @@ class Mintmanga : ParsedHttpSource() { val chapter = SChapter.create() chapter.setUrlWithoutDomain(urlElement.attr("href") + "?mtr=1") + var translators = "" + val translatorElement = urlElement.attr("title") + if (!translatorElement.isNullOrBlank()) { + translators = translatorElement + .replace("(Переводчик),", "&") + .removeSuffix(" (Переводчик)") + } + chapter.scanlator = translators + chapter.name = urlText.removeSuffix(" новое").trim() if (manga.title.length > 25) { for (word in manga.title.split(' ')) { @@ -161,7 +174,7 @@ class Mintmanga : ParsedHttpSource() { chapter.name = chapter.name.substringAfter("…").trim() } - chapter.date_upload = element.select("td.hidden-xxs").last()?.text()?.let { + chapter.date_upload = element.select("td.d-none").last()?.text()?.let { try { SimpleDateFormat("dd.MM.yy", Locale.US).parse(it)?.time ?: 0L } catch (e: ParseException) { diff --git a/src/ru/readmanga/build.gradle b/src/ru/readmanga/build.gradle index abb35d1d4..f058b9b8e 100644 --- a/src/ru/readmanga/build.gradle +++ b/src/ru/readmanga/build.gradle @@ -5,7 +5,7 @@ ext { extName = 'Readmanga' pkgNameSuffix = 'ru.readmanga' extClass = '.Readmanga' - extVersionCode = 22 + extVersionCode = 23 libVersion = '1.2' } diff --git a/src/ru/readmanga/src/eu/kanade/tachiyomi/extension/ru/readmanga/Readmanga.kt b/src/ru/readmanga/src/eu/kanade/tachiyomi/extension/ru/readmanga/Readmanga.kt index a5f9427ad..f75d0d48d 100644 --- a/src/ru/readmanga/src/eu/kanade/tachiyomi/extension/ru/readmanga/Readmanga.kt +++ b/src/ru/readmanga/src/eu/kanade/tachiyomi/extension/ru/readmanga/Readmanga.kt @@ -106,7 +106,11 @@ class Readmanga : ParsedHttpSource() { } val manga = SManga.create() - manga.author = infoElement.select("span.elem_author").first()?.text() + var authorElement = infoElement.select("span.elem_author").first()?.text() + if (authorElement == null) { + authorElement = infoElement.select("span.elem_screenwriter").first()?.text() + } + manga.author = authorElement manga.artist = infoElement.select("span.elem_illustrator").first()?.text() manga.genre = infoElement.select("span.elem_genre").text().split(",").plusElement(category).joinToString { it.trim() } manga.description = infoElement.select("div.manga-description").text() @@ -148,6 +152,15 @@ class Readmanga : ParsedHttpSource() { val chapter = SChapter.create() chapter.setUrlWithoutDomain(urlElement.attr("href") + "?mtr=1") + var translators = "" + val translatorElement = urlElement.attr("title") + if (!translatorElement.isNullOrBlank()) { + translators = translatorElement + .replace("(Переводчик),", "&") + .removeSuffix(" (Переводчик)") + } + chapter.scanlator = translators + chapter.name = urlText.removeSuffix(" новое").trim() if (manga.title.length > 25) { for (word in manga.title.split(' ')) {