[ResetScans] Migrate to the new website (close #1252)
This commit is contained in:
@@ -3,16 +3,15 @@ package org.koitharu.kotatsu.parsers.site.fuzzydoodle.en
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.model.ContentType
|
||||
import org.koitharu.kotatsu.parsers.model.MangaListFilterOptions
|
||||
import org.koitharu.kotatsu.parsers.model.MangaParserSource
|
||||
import org.koitharu.kotatsu.parsers.site.fuzzydoodle.FuzzyDoodleParser
|
||||
import java.util.EnumSet
|
||||
import org.koitharu.kotatsu.parsers.site.madara.MadaraParser
|
||||
import java.util.*
|
||||
|
||||
@MangaSourceParser("RESETSCANS", "ResetScans", "en")
|
||||
internal class ResetScans(context: MangaLoaderContext) :
|
||||
FuzzyDoodleParser(context, MangaParserSource.RESETSCANS, "reset-scans.xyz") {
|
||||
MadaraParser(context, MangaParserSource.RESETSCANS, domain = "rspro.xyz", pageSize = 18) {
|
||||
|
||||
override suspend fun getFilterOptions() = MangaListFilterOptions(
|
||||
override suspend fun getFilterOptions() = super.getFilterOptions().copy(
|
||||
availableContentTypes = EnumSet.of(
|
||||
ContentType.MANGA,
|
||||
ContentType.MANHWA,
|
||||
|
||||
@@ -458,7 +458,7 @@ internal abstract class MadaraParser(
|
||||
return doc.select("div.row.c-tabs-item__content").ifEmpty {
|
||||
doc.select("div.page-item-detail")
|
||||
}.map { div ->
|
||||
val href = div.selectFirst("a")?.attrAsRelativeUrlOrNull("href") ?: div.parseFailed("Link not found")
|
||||
val href = div.selectFirstOrThrow("a").attrAsRelativeUrl("href")
|
||||
val summary = div.selectFirst(".tab-summary") ?: div.selectFirst(".item-summary")
|
||||
Manga(
|
||||
id = generateUid(href),
|
||||
@@ -563,6 +563,7 @@ internal abstract class MadaraParser(
|
||||
val alt = doc.body().select(selectAlt).firstOrNull()?.tableValue()?.textOrNull()
|
||||
|
||||
manga.copy(
|
||||
title = doc.selectFirst("h1")?.textOrNull() ?: manga.title,
|
||||
url = href,
|
||||
publicUrl = href.toAbsoluteUrl(domain),
|
||||
tags = doc.body().select(selectGenre).mapToSet { a ->
|
||||
@@ -587,8 +588,8 @@ internal abstract class MadaraParser(
|
||||
protected open suspend fun getChapters(manga: Manga, doc: Document): List<MangaChapter> {
|
||||
val dateFormat = SimpleDateFormat(datePattern, sourceLocale)
|
||||
return doc.body().select(selectChapter).mapChapters(reversed = true) { i, li ->
|
||||
val a = li.selectFirst("a")
|
||||
val href = a?.attrAsRelativeUrlOrNull("href") ?: li.parseFailed("Link is missing")
|
||||
val a = li.selectFirstOrThrow("a")
|
||||
val href = a.attrAsRelativeUrl("href")
|
||||
val link = href + stylePage
|
||||
val dateText = li.selectFirst("a.c-new-tag")?.attr("title") ?: li.selectFirst(selectDate)?.text()
|
||||
val name = a.selectFirst("p")?.text() ?: a.ownText()
|
||||
@@ -621,8 +622,8 @@ internal abstract class MadaraParser(
|
||||
}
|
||||
val dateFormat = SimpleDateFormat(datePattern, sourceLocale)
|
||||
return doc.select(selectChapter).mapChapters(reversed = true) { i, li ->
|
||||
val a = li.selectFirst("a")
|
||||
val href = a?.attrAsRelativeUrlOrNull("href") ?: li.parseFailed("Link is missing")
|
||||
val a = li.selectFirstOrThrow("a")
|
||||
val href = a.attrAsRelativeUrl("href")
|
||||
val link = href + stylePage
|
||||
val dateText = li.selectFirst("a.c-new-tag")?.attr("title") ?: li.selectFirst(selectDate)?.text()
|
||||
val name = a.selectFirst("p")?.text() ?: a.ownText()
|
||||
|
||||
Reference in New Issue
Block a user