Fix MangaATrend
Add LerManga Remove ReaperScansPt.kt
parent
f5f2854f36
commit
d8c32047d0
@ -1,13 +0,0 @@
|
|||||||
package org.koitharu.kotatsu.parsers.site.heancms.pt
|
|
||||||
|
|
||||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
|
||||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
|
||||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
|
||||||
import org.koitharu.kotatsu.parsers.model.MangaSource
|
|
||||||
import org.koitharu.kotatsu.parsers.site.heancms.HeanCms
|
|
||||||
|
|
||||||
@MangaSourceParser("REAPERSCANSPT", "ReaperScans.net", "pt")
|
|
||||||
internal class ReaperScansPt(context: MangaLoaderContext) :
|
|
||||||
HeanCms(context, MangaSource.REAPERSCANSPT, "reaperscans.net") {
|
|
||||||
override val configKeyDomain = ConfigKey.Domain("reaperscans.net", "reaperbr.online")
|
|
||||||
}
|
|
||||||
@ -1,10 +0,0 @@
|
|||||||
package org.koitharu.kotatsu.parsers.site.mangareader.ar
|
|
||||||
|
|
||||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
|
||||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
|
||||||
import org.koitharu.kotatsu.parsers.model.MangaSource
|
|
||||||
import org.koitharu.kotatsu.parsers.site.mangareader.MangaReaderParser
|
|
||||||
|
|
||||||
@MangaSourceParser("MANGAATREND", "Manga A Trend", "ar")
|
|
||||||
internal class Mangaatrend(context: MangaLoaderContext) :
|
|
||||||
MangaReaderParser(context, MangaSource.MANGAATREND, "mangaatrend.net", pageSize = 40, searchPageSize = 20)
|
|
||||||
@ -0,0 +1,144 @@
|
|||||||
|
package org.koitharu.kotatsu.parsers.site.pt
|
||||||
|
|
||||||
|
import org.koitharu.kotatsu.parsers.ErrorMessages
|
||||||
|
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||||
|
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||||
|
import org.koitharu.kotatsu.parsers.PagedMangaParser
|
||||||
|
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||||
|
import org.koitharu.kotatsu.parsers.model.*
|
||||||
|
import org.koitharu.kotatsu.parsers.util.*
|
||||||
|
import java.text.SimpleDateFormat
|
||||||
|
import java.util.*
|
||||||
|
|
||||||
|
@MangaSourceParser("LERMANGA", "LerManga", "pt")
|
||||||
|
class LerManga(context: MangaLoaderContext) : PagedMangaParser(context, MangaSource.LERMANGA, 24) {
|
||||||
|
|
||||||
|
override val availableSortOrders: Set<SortOrder> =
|
||||||
|
EnumSet.of(SortOrder.UPDATED, SortOrder.POPULARITY, SortOrder.ALPHABETICAL, SortOrder.RATING)
|
||||||
|
|
||||||
|
override val configKeyDomain = ConfigKey.Domain("lermanga.org")
|
||||||
|
|
||||||
|
override val isMultipleTagsSupported = false
|
||||||
|
|
||||||
|
override suspend fun getListPage(page: Int, filter: MangaListFilter?): List<Manga> {
|
||||||
|
|
||||||
|
val url = buildString {
|
||||||
|
append("https://")
|
||||||
|
append(domain)
|
||||||
|
append("/mangas")
|
||||||
|
|
||||||
|
if (page > 1) {
|
||||||
|
append("/page/")
|
||||||
|
append(page.toString())
|
||||||
|
}
|
||||||
|
|
||||||
|
when (filter) {
|
||||||
|
|
||||||
|
is MangaListFilter.Search -> {
|
||||||
|
throw IllegalArgumentException(ErrorMessages.SEARCH_NOT_SUPPORTED)
|
||||||
|
}
|
||||||
|
|
||||||
|
is MangaListFilter.Advanced -> {
|
||||||
|
if (filter.tags.isNotEmpty()) {
|
||||||
|
filter.tags.oneOrThrowIfMany()?.let {
|
||||||
|
append("/genero/")
|
||||||
|
append(it.key)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
append("/?orderby=")
|
||||||
|
append(
|
||||||
|
when (filter.sortOrder) {
|
||||||
|
SortOrder.UPDATED -> "modified&order=desc"
|
||||||
|
SortOrder.POPULARITY -> "views&order=desc"
|
||||||
|
SortOrder.ALPHABETICAL -> "title&order=asc"
|
||||||
|
SortOrder.RATING -> "rating&order=desc"
|
||||||
|
else -> "modified&order=desc"
|
||||||
|
},
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
null -> append("/?orderby=modified&order=desc")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
val doc = webClient.httpGet(url).parseHtml()
|
||||||
|
return doc.select(".tab-content .flw-item").map { div ->
|
||||||
|
val a = div.selectFirstOrThrow("a.film-poster-ahref")
|
||||||
|
val href = a.attrAsAbsoluteUrl("href")
|
||||||
|
Manga(
|
||||||
|
id = generateUid(href),
|
||||||
|
url = href,
|
||||||
|
publicUrl = href,
|
||||||
|
title = div.selectLastOrThrow("h3.film-name").text(),
|
||||||
|
coverUrl = div.selectFirst("img.film-poster-img")?.src().orEmpty(),
|
||||||
|
altTitle = null,
|
||||||
|
rating = div.selectFirst(".item__rating")?.ownText()?.toFloatOrNull()?.div(5f) ?: RATING_UNKNOWN,
|
||||||
|
tags = emptySet(),
|
||||||
|
description = null,
|
||||||
|
state = null,
|
||||||
|
author = null,
|
||||||
|
isNsfw = div.selectFirst(".tick-itemadult") != null,
|
||||||
|
source = source,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override suspend fun getAvailableTags(): Set<MangaTag> {
|
||||||
|
val doc = webClient.httpGet("https://$domain").parseHtml().requireElementById("menu-header")
|
||||||
|
return doc.select("#menu-item:contains(GÊNERO) ul li a").mapNotNullToSet { a ->
|
||||||
|
MangaTag(
|
||||||
|
key = a.attr("href").removeSuffix("/").substringAfterLast("/"),
|
||||||
|
title = a.text(),
|
||||||
|
source = source,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override suspend fun getDetails(manga: Manga): Manga {
|
||||||
|
val doc = webClient.httpGet(manga.url.toAbsoluteUrl(domain)).parseHtml()
|
||||||
|
val dateFormat = SimpleDateFormat("dd-MM-yyyy", sourceLocale)
|
||||||
|
return manga.copy(
|
||||||
|
description = doc.selectFirstOrThrow("div.boxAnimeSobreLast p").html(),
|
||||||
|
tags = doc.selectFirst("ul.genre-list")?.select("li a")?.mapNotNullToSet { a ->
|
||||||
|
MangaTag(
|
||||||
|
key = a.attr("href").removeSuffix("/").substringAfterLast("/"),
|
||||||
|
title = a.text(),
|
||||||
|
source = source,
|
||||||
|
)
|
||||||
|
}.orEmpty(),
|
||||||
|
isNsfw = doc.select("ul.genre-list li").text().contains("Adulto"),
|
||||||
|
chapters = doc.select("div.manga-chapters div.single-chapter").mapChapters(reversed = true) { i, div ->
|
||||||
|
val a = div.selectFirstOrThrow("a")
|
||||||
|
val href = a.attrAsAbsoluteUrl("href")
|
||||||
|
MangaChapter(
|
||||||
|
id = generateUid(href),
|
||||||
|
name = a.text(),
|
||||||
|
number = i + 1,
|
||||||
|
url = href,
|
||||||
|
scanlator = null,
|
||||||
|
uploadDate = dateFormat.tryParse(div.selectFirstOrThrow("small small").text()),
|
||||||
|
branch = null,
|
||||||
|
source = source,
|
||||||
|
)
|
||||||
|
},
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
override suspend fun getPages(chapter: MangaChapter): List<MangaPage> {
|
||||||
|
val fullUrl = chapter.url.toAbsoluteUrl(domain)
|
||||||
|
val doc = webClient.httpGet(fullUrl).parseHtml()
|
||||||
|
val script = doc.selectFirstOrThrow(".heading-header + script").attr("src")
|
||||||
|
val data = Base64.getDecoder().decode(script.replace("data:text/javascript;base64,", "")).decodeToString()
|
||||||
|
val images =
|
||||||
|
data.substringAfter("var imagens_cap=[").substringBeforeLast("]").replace("\\", "").replace("\"", "")
|
||||||
|
.split(",")
|
||||||
|
return images.map { img ->
|
||||||
|
MangaPage(
|
||||||
|
id = generateUid(img),
|
||||||
|
url = img,
|
||||||
|
preview = null,
|
||||||
|
source = source,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,12 @@
|
|||||||
|
package org.koitharu.kotatsu.parsers.site.zeistmanga.ar
|
||||||
|
|
||||||
|
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||||
|
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||||
|
import org.koitharu.kotatsu.parsers.model.MangaSource
|
||||||
|
import org.koitharu.kotatsu.parsers.site.zeistmanga.ZeistMangaParser
|
||||||
|
|
||||||
|
@MangaSourceParser("MANGAATREND", "MangaATrend", "ar")
|
||||||
|
internal class Mangaatrend(context: MangaLoaderContext) :
|
||||||
|
ZeistMangaParser(context, MangaSource.MANGAATREND, "mangaatrend.net") {
|
||||||
|
override val selectPage = "#seoneurons-target img"
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue