[RU]Mangalib fix qualitative cover & change destroy list chapter (#7872)

This commit is contained in:
Eugene 2021-06-25 21:58:45 +05:00 committed by GitHub
parent 64c29c5fd3
commit 794ba6ab9a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 19 deletions

View File

@ -5,7 +5,7 @@ ext {
extName = 'MangaLib' extName = 'MangaLib'
pkgNameSuffix = 'ru.libmanga' pkgNameSuffix = 'ru.libmanga'
extClass = '.LibManga' extClass = '.LibManga'
extVersionCode = 52 extVersionCode = 53
libVersion = '1.2' libVersion = '1.2'
} }

View File

@ -88,7 +88,7 @@ class LibManga : ConfigurableSource, HttpSource() {
val manga = SManga.create() val manga = SManga.create()
element.select("div.cover").first().let { img -> element.select("div.cover").first().let { img ->
manga.thumbnail_url = baseUrl + img.attr("data-src").substringAfter(baseUrl) manga.thumbnail_url = baseUrl + img.attr("data-src").substringAfter(baseUrl)
.replace("cover_thumb", "cover_250x350") .replace("_thumb", "_250x350")
} }
element.select("a").first().let { link -> element.select("a").first().let { link ->
@ -161,13 +161,6 @@ class LibManga : ConfigurableSource, HttpSource() {
val manga = SManga.create() val manga = SManga.create()
if (document.html().contains("Манга удалена по просьбе правообладателей") ||
document.html().contains("Данный тайтл лицензирован на территории РФ.")
) {
manga.status = SManga.LICENSED
return manga
}
val body = document.select("div.media-info-list").first() val body = document.select("div.media-info-list").first()
val rawCategory = body.select("div.media-info-list__title:contains(Тип) + div").text() val rawCategory = body.select("div.media-info-list__title:contains(Тип) + div").text()
val category = when { val category = when {
@ -200,15 +193,20 @@ class LibManga : ConfigurableSource, HttpSource() {
manga.thumbnail_url = baseUrl + document.select(".media-sidebar__cover > img").attr("src").substringAfter(baseOrig) manga.thumbnail_url = baseUrl + document.select(".media-sidebar__cover > img").attr("src").substringAfter(baseOrig)
manga.author = body.select("div.media-info-list__title:contains(Автор) + div").text() 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.artist = body.select("div.media-info-list__title:contains(Художник) + div").text()
manga.status = when ( manga.status = if (document.html().contains("Манга удалена по просьбе правообладателей") ||
body.select("div.media-info-list__title:contains(Статус перевода) + div") document.html().contains("Данный тайтл лицензирован на территории РФ.")
.text()
.toLowerCase(Locale.ROOT)
) { ) {
"продолжается" -> SManga.ONGOING SManga.LICENSED
"завершен" -> SManga.COMPLETED } else
else -> SManga.UNKNOWN when (
} body.select("div.media-info-list__title:contains(Статус перевода) + div")
.text()
.toLowerCase(Locale.ROOT)
) {
"продолжается" -> SManga.ONGOING
"завершен" -> SManga.COMPLETED
else -> SManga.UNKNOWN
}
manga.genre = genres.plusElement(category).plusElement(rawAgeStop).joinToString { it.trim() } manga.genre = genres.plusElement(category).plusElement(rawAgeStop).joinToString { it.trim() }
val altSelector = document.select(".media-info-list__item_alt-names .media-info-list__value div") val altSelector = document.select(".media-info-list__item_alt-names .media-info-list__value div")
var altName = "" var altName = ""
@ -220,8 +218,13 @@ class LibManga : ConfigurableSource, HttpSource() {
} }
override fun chapterListParse(response: Response): List<SChapter> { override fun chapterListParse(response: Response): List<SChapter> {
val dataStr = response val document = response.asJsoup()
.asJsoup() if (document.html().contains("Манга удалена по просьбе правообладателей") ||
document.html().contains("Данный тайтл лицензирован на территории РФ.")
) {
return emptyList()
}
val dataStr = document
.toString() .toString()
.substringAfter("window.__DATA__ = ") .substringAfter("window.__DATA__ = ")
.substringBefore("window._SITE_COLOR_") .substringBefore("window._SITE_COLOR_")