Merge pull request #229 from davvarrr/master
Add template FoolSlideParser ands sources
commit
10aaae1ca8
@ -0,0 +1,172 @@
|
|||||||
|
package org.koitharu.kotatsu.parsers.site.foolslide
|
||||||
|
|
||||||
|
import kotlinx.coroutines.coroutineScope
|
||||||
|
import org.json.JSONArray
|
||||||
|
import org.jsoup.nodes.Document
|
||||||
|
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||||
|
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.*
|
||||||
|
|
||||||
|
internal abstract class FoolSlideParser(
|
||||||
|
context: MangaLoaderContext,
|
||||||
|
source: MangaSource,
|
||||||
|
domain: String,
|
||||||
|
pageSize: Int = 25,
|
||||||
|
) : PagedMangaParser(context, source, pageSize) {
|
||||||
|
|
||||||
|
override val configKeyDomain = ConfigKey.Domain(domain)
|
||||||
|
|
||||||
|
override val sortOrders: Set<SortOrder> = EnumSet.of(SortOrder.ALPHABETICAL)
|
||||||
|
|
||||||
|
protected open val listUrl = "directory/"
|
||||||
|
protected open val searchUrl = "search/"
|
||||||
|
protected open val pagination = true // false if the manga list has no pages
|
||||||
|
protected open val datePattern = "yyyy.MM.dd"
|
||||||
|
|
||||||
|
init {
|
||||||
|
paginator.firstPage = 1
|
||||||
|
searchPaginator.firstPage = 1
|
||||||
|
}
|
||||||
|
|
||||||
|
override suspend fun getListPage(
|
||||||
|
page: Int,
|
||||||
|
query: String?,
|
||||||
|
tags: Set<MangaTag>?,
|
||||||
|
sortOrder: SortOrder,
|
||||||
|
): List<Manga> {
|
||||||
|
|
||||||
|
val doc = if (!query.isNullOrEmpty()) {
|
||||||
|
|
||||||
|
val url = buildString {
|
||||||
|
append("https://$domain/$searchUrl")
|
||||||
|
|
||||||
|
if (page > 1) {
|
||||||
|
return emptyList()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
val q = query.urlEncoded()
|
||||||
|
webClient.httpPost(url, "search=$q").parseHtml()
|
||||||
|
} else {
|
||||||
|
val url = buildString {
|
||||||
|
append("https://$domain/$listUrl")
|
||||||
|
// For some sites that don't have enough manga and page 2 links to page 1
|
||||||
|
if (!pagination) {
|
||||||
|
if (page > 1) {
|
||||||
|
return emptyList()
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
append(page.toString())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
webClient.httpGet(url).parseHtml()
|
||||||
|
}
|
||||||
|
|
||||||
|
return doc.select("div.list div.group").map { div ->
|
||||||
|
val href = div.selectFirstOrThrow("a").attrAsRelativeUrl("href")
|
||||||
|
Manga(
|
||||||
|
id = generateUid(href),
|
||||||
|
url = href,
|
||||||
|
publicUrl = href.toAbsoluteUrl(div.host ?: domain),
|
||||||
|
coverUrl = div.selectFirst("img")?.src().orEmpty(),// in search no img
|
||||||
|
title = div.selectFirstOrThrow(".title").text().orEmpty(),
|
||||||
|
altTitle = null,
|
||||||
|
rating = RATING_UNKNOWN,
|
||||||
|
tags = emptySet(),
|
||||||
|
author = null,
|
||||||
|
state = null,
|
||||||
|
source = source,
|
||||||
|
isNsfw = isNsfwSource,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
override suspend fun getTags(): Set<MangaTag> = emptySet()
|
||||||
|
|
||||||
|
protected open val selectInfo = "div.info"
|
||||||
|
|
||||||
|
override suspend fun getDetails(manga: Manga): Manga = coroutineScope {
|
||||||
|
val fullUrl = manga.url.toAbsoluteUrl(domain)
|
||||||
|
val testAdultPage = webClient.httpGet(fullUrl).parseHtml()
|
||||||
|
|
||||||
|
val doc = if (testAdultPage.selectFirst("div.info form") != null) {
|
||||||
|
webClient.httpPost(fullUrl, "adult=true").parseHtml()
|
||||||
|
} else {
|
||||||
|
testAdultPage
|
||||||
|
}
|
||||||
|
val chapters = getChapters(manga, doc)
|
||||||
|
|
||||||
|
val desc = if (doc.selectFirstOrThrow(selectInfo).html().contains("</b>")) {
|
||||||
|
doc.selectFirstOrThrow(selectInfo).text().substringAfterLast(": ")
|
||||||
|
} else {
|
||||||
|
doc.selectFirstOrThrow(selectInfo).text()
|
||||||
|
}
|
||||||
|
|
||||||
|
val author = if (doc.selectFirstOrThrow(selectInfo).html().contains("</b>")) {
|
||||||
|
doc.selectFirstOrThrow(selectInfo).text().substringAfter(": ").substringBefore("Art")
|
||||||
|
} else {
|
||||||
|
null
|
||||||
|
}
|
||||||
|
|
||||||
|
manga.copy(
|
||||||
|
tags = emptySet(),
|
||||||
|
coverUrl = doc.selectFirst(".thumbnail img")?.src().orEmpty(),// for manga result on search
|
||||||
|
description = desc,
|
||||||
|
altTitle = null,
|
||||||
|
author = author,
|
||||||
|
state = null,
|
||||||
|
chapters = chapters,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
protected open val selectDate = ".meta_r"
|
||||||
|
protected open val selectChapter = "div.list div.element"
|
||||||
|
|
||||||
|
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, div ->
|
||||||
|
val a = div.selectFirstOrThrow(".title a")
|
||||||
|
val href = a.attrAsRelativeUrl("href")
|
||||||
|
val dateText = div.selectFirstOrThrow(selectDate).text().substringAfter(", ")
|
||||||
|
MangaChapter(
|
||||||
|
id = generateUid(href),
|
||||||
|
name = a.text(),
|
||||||
|
number = i + 1,
|
||||||
|
url = href,
|
||||||
|
uploadDate = if (div.selectFirstOrThrow(selectDate).text().contains(", ")) {
|
||||||
|
dateFormat.tryParse(dateText)
|
||||||
|
} else {
|
||||||
|
0
|
||||||
|
},
|
||||||
|
source = source,
|
||||||
|
scanlator = null,
|
||||||
|
branch = null,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override suspend fun getPages(chapter: MangaChapter): List<MangaPage> {
|
||||||
|
val fullUrl = chapter.url.toAbsoluteUrl(domain)
|
||||||
|
val doc = webClient.httpGet(fullUrl).parseHtml()
|
||||||
|
val script = doc.selectFirstOrThrow("script:containsData(var pages = )")
|
||||||
|
val images = JSONArray(script.data().substringAfterLast("var pages = ").substringBefore(';'))
|
||||||
|
val pages = ArrayList<MangaPage>(images.length())
|
||||||
|
for (i in 0 until images.length()) {
|
||||||
|
val pageTake = images.getJSONObject(i)
|
||||||
|
pages.add(
|
||||||
|
MangaPage(
|
||||||
|
id = generateUid(pageTake.getString("url")),
|
||||||
|
url = pageTake.getString("url"),
|
||||||
|
preview = null,
|
||||||
|
source = source,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
return pages
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,12 @@
|
|||||||
|
package org.koitharu.kotatsu.parsers.site.foolslide.en
|
||||||
|
|
||||||
|
|
||||||
|
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.foolslide.FoolSlideParser
|
||||||
|
|
||||||
|
|
||||||
|
@MangaSourceParser("DEATHTOLLSCANS", "Deathtollscans", "en")
|
||||||
|
internal class Deathtollscans(context: MangaLoaderContext) :
|
||||||
|
FoolSlideParser(context, MangaSource.DEATHTOLLSCANS, "reader.deathtollscans.net", 26)
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
package org.koitharu.kotatsu.parsers.site.foolslide.en
|
||||||
|
|
||||||
|
|
||||||
|
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.foolslide.FoolSlideParser
|
||||||
|
|
||||||
|
|
||||||
|
@MangaSourceParser("MANGATELLERS", "Mangatellers", "en")
|
||||||
|
internal class Mangatellers(context: MangaLoaderContext) :
|
||||||
|
FoolSlideParser(context, MangaSource.MANGATELLERS, "reader.mangatellers.gr") {
|
||||||
|
override val pagination = false
|
||||||
|
}
|
||||||
@ -0,0 +1,12 @@
|
|||||||
|
package org.koitharu.kotatsu.parsers.site.foolslide.en
|
||||||
|
|
||||||
|
|
||||||
|
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.foolslide.FoolSlideParser
|
||||||
|
|
||||||
|
|
||||||
|
@MangaSourceParser("READER_EVILFLOWERS", "Evilflowers", "en")
|
||||||
|
internal class ReaderEvilflowers(context: MangaLoaderContext) :
|
||||||
|
FoolSlideParser(context, MangaSource.READER_EVILFLOWERS, "reader.evilflowers.com")
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
package org.koitharu.kotatsu.parsers.site.foolslide.en
|
||||||
|
|
||||||
|
|
||||||
|
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.foolslide.FoolSlideParser
|
||||||
|
|
||||||
|
|
||||||
|
@MangaSourceParser("SILENTSKYSCANS", "Silent Sky Scans", "en")
|
||||||
|
internal class SilentskyScans(context: MangaLoaderContext) :
|
||||||
|
FoolSlideParser(context, MangaSource.SILENTSKYSCANS, "reader.silentsky-scans.net") {
|
||||||
|
override val pagination = false
|
||||||
|
}
|
||||||
@ -0,0 +1,15 @@
|
|||||||
|
package org.koitharu.kotatsu.parsers.site.foolslide.es
|
||||||
|
|
||||||
|
|
||||||
|
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.foolslide.FoolSlideParser
|
||||||
|
|
||||||
|
|
||||||
|
@MangaSourceParser("MENUDO_FANSUB", "Menudo Fansub", "es")
|
||||||
|
internal class MenudoFansub(context: MangaLoaderContext) :
|
||||||
|
FoolSlideParser(context, MangaSource.MENUDO_FANSUB, "www.menudo-fansub.com", 25) {
|
||||||
|
override val searchUrl = "slide/search/"
|
||||||
|
override val listUrl = "slide/directory/"
|
||||||
|
}
|
||||||
@ -0,0 +1,17 @@
|
|||||||
|
package org.koitharu.kotatsu.parsers.site.foolslide.fr
|
||||||
|
|
||||||
|
|
||||||
|
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.foolslide.FoolSlideParser
|
||||||
|
|
||||||
|
|
||||||
|
@MangaSourceParser("HNISCANTRAD", "Hni Scantrad", "fr")
|
||||||
|
internal class HniScantrad(context: MangaLoaderContext) :
|
||||||
|
FoolSlideParser(context, MangaSource.HNISCANTRAD, "hni-scantrad.com") {
|
||||||
|
|
||||||
|
override val pagination = false
|
||||||
|
override val searchUrl = "lel/search/"
|
||||||
|
override val listUrl = "lel/directory/"
|
||||||
|
}
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
package org.koitharu.kotatsu.parsers.site.foolslide.it
|
||||||
|
|
||||||
|
|
||||||
|
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.foolslide.FoolSlideParser
|
||||||
|
|
||||||
|
|
||||||
|
@MangaSourceParser("POWERMANGA", "Power Manga", "it")
|
||||||
|
internal class PowerManga(context: MangaLoaderContext) :
|
||||||
|
FoolSlideParser(context, MangaSource.POWERMANGA, "reader.powermanga.org") {
|
||||||
|
override val pagination = false
|
||||||
|
}
|
||||||
@ -0,0 +1,15 @@
|
|||||||
|
package org.koitharu.kotatsu.parsers.site.foolslide.it
|
||||||
|
|
||||||
|
|
||||||
|
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.foolslide.FoolSlideParser
|
||||||
|
|
||||||
|
|
||||||
|
@MangaSourceParser("RAMAREADER", "Rama Reader", "it")
|
||||||
|
internal class Ramareader(context: MangaLoaderContext) :
|
||||||
|
FoolSlideParser(context, MangaSource.RAMAREADER, "www.ramareader.it") {
|
||||||
|
override val searchUrl = "read/search/"
|
||||||
|
override val listUrl = "read/directory/"
|
||||||
|
}
|
||||||
@ -0,0 +1,15 @@
|
|||||||
|
package org.koitharu.kotatsu.parsers.site.foolslide.it
|
||||||
|
|
||||||
|
|
||||||
|
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.foolslide.FoolSlideParser
|
||||||
|
|
||||||
|
|
||||||
|
@MangaSourceParser("READNIFTEAM", "Read Nif Team", "it")
|
||||||
|
internal class ReadNifteam(context: MangaLoaderContext) :
|
||||||
|
FoolSlideParser(context, MangaSource.READNIFTEAM, "read-nifteam.info") {
|
||||||
|
override val searchUrl = "slide/search/"
|
||||||
|
override val listUrl = "slide/directory/"
|
||||||
|
}
|
||||||
@ -0,0 +1,12 @@
|
|||||||
|
package org.koitharu.kotatsu.parsers.site.foolslide.pl
|
||||||
|
|
||||||
|
|
||||||
|
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.foolslide.FoolSlideParser
|
||||||
|
|
||||||
|
|
||||||
|
@MangaSourceParser("ONEPIECENAKAMA", "Onepiecenakama", "pl")
|
||||||
|
internal class Onepiecenakama(context: MangaLoaderContext) :
|
||||||
|
FoolSlideParser(context, MangaSource.ONEPIECENAKAMA, "reader.onepiecenakama.pl")
|
||||||
@ -0,0 +1,16 @@
|
|||||||
|
package org.koitharu.kotatsu.parsers.site.madara.es
|
||||||
|
|
||||||
|
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.MangaSource
|
||||||
|
import org.koitharu.kotatsu.parsers.site.madara.MadaraParser
|
||||||
|
|
||||||
|
@MangaSourceParser("TEMPLESCANESP", "TempleScanEsp", "es" , ContentType.HENTAI)
|
||||||
|
internal class TempleScanEsp(context: MangaLoaderContext) :
|
||||||
|
MadaraParser(context, MangaSource.TEMPLESCANESP, "templescanesp.com") {
|
||||||
|
|
||||||
|
override val listUrl = "series/"
|
||||||
|
override val tagPrefix = "genero/"
|
||||||
|
override val datePattern = "dd.MM.yyyy"
|
||||||
|
}
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
package org.koitharu.kotatsu.parsers.site.madara.es
|
||||||
|
|
||||||
|
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.MangaSource
|
||||||
|
import org.koitharu.kotatsu.parsers.site.madara.MadaraParser
|
||||||
|
|
||||||
|
@MangaSourceParser("TENKAISCAN", "Tenkai Scan", "es" , ContentType.HENTAI)
|
||||||
|
internal class TenkaiScan(context: MangaLoaderContext) :
|
||||||
|
MadaraParser(context, MangaSource.TENKAISCAN, "tenkaiscan.net")
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
package org.koitharu.kotatsu.parsers.site.madara.pt
|
||||||
|
|
||||||
|
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.madara.MadaraParser
|
||||||
|
|
||||||
|
@MangaSourceParser("NINJASCAN", "Ninja Scan", "pt")
|
||||||
|
internal class NinjaScan(context: MangaLoaderContext) :
|
||||||
|
MadaraParser(context, MangaSource.NINJASCAN, "ninjascan.site") {
|
||||||
|
|
||||||
|
override val datePattern = "dd 'de' MMMMM 'de' yyyy"
|
||||||
|
}
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
package org.koitharu.kotatsu.parsers.site.mangareader.en
|
||||||
|
|
||||||
|
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("BIRDMANGA", "Bird Manga", "en")
|
||||||
|
internal class BirdManga(context: MangaLoaderContext) :
|
||||||
|
MangaReaderParser(context, MangaSource.BIRDMANGA, "birdmanga.com", pageSize = 20, searchPageSize = 10) {
|
||||||
|
override val encodedSrc = true
|
||||||
|
}
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
package org.koitharu.kotatsu.parsers.site.mangareader.pl
|
||||||
|
|
||||||
|
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("SKANLACJEFENIKSY", "SkanlacjeFeniksy", "pl")
|
||||||
|
internal class SkanlacjeFeniksy(context: MangaLoaderContext) :
|
||||||
|
MangaReaderParser(context, MangaSource.SKANLACJEFENIKSY, "skanlacje-feniksy.pl", pageSize = 10, searchPageSize = 10) {
|
||||||
|
|
||||||
|
override val datePattern = "d MMMM, yyyy"
|
||||||
|
}
|
||||||
@ -0,0 +1,138 @@
|
|||||||
|
package org.koitharu.kotatsu.parsers.site.vmp
|
||||||
|
|
||||||
|
import kotlinx.coroutines.coroutineScope
|
||||||
|
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||||
|
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.util.*
|
||||||
|
|
||||||
|
internal abstract class VmpParser(
|
||||||
|
context: MangaLoaderContext,
|
||||||
|
source: MangaSource,
|
||||||
|
domain: String,
|
||||||
|
pageSize: Int = 24,
|
||||||
|
) : PagedMangaParser(context, source, pageSize) {
|
||||||
|
|
||||||
|
override val configKeyDomain = ConfigKey.Domain(domain)
|
||||||
|
|
||||||
|
override val sortOrders: Set<SortOrder> = EnumSet.of(SortOrder.UPDATED)
|
||||||
|
|
||||||
|
protected open val listUrl = "xxx/"
|
||||||
|
protected open val geneUrl = "genero/"
|
||||||
|
|
||||||
|
init {
|
||||||
|
paginator.firstPage = 1
|
||||||
|
searchPaginator.firstPage = 1
|
||||||
|
}
|
||||||
|
|
||||||
|
override suspend fun getListPage(
|
||||||
|
page: Int,
|
||||||
|
query: String?,
|
||||||
|
tags: Set<MangaTag>?,
|
||||||
|
sortOrder: SortOrder,
|
||||||
|
): List<Manga> {
|
||||||
|
|
||||||
|
val url = buildString {
|
||||||
|
append("https://$domain/")
|
||||||
|
if(!tags.isNullOrEmpty())
|
||||||
|
{
|
||||||
|
append(geneUrl)
|
||||||
|
for (tag in tags) {
|
||||||
|
append(tag.key)
|
||||||
|
}
|
||||||
|
append("/page/")
|
||||||
|
append(page.toString())
|
||||||
|
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
append(listUrl)
|
||||||
|
append("/page/")
|
||||||
|
append(page.toString())
|
||||||
|
if (!query.isNullOrEmpty()) {
|
||||||
|
append("?s=")
|
||||||
|
append(query.urlEncoded())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
val doc = webClient.httpGet(url).parseHtml()
|
||||||
|
|
||||||
|
return doc.select("div.blog-list-items div.entry").map { div ->
|
||||||
|
val href = div.selectFirstOrThrow("a").attrAsRelativeUrl("href")
|
||||||
|
Manga(
|
||||||
|
id = generateUid(href),
|
||||||
|
url = href,
|
||||||
|
publicUrl = href.toAbsoluteUrl(div.host ?: domain),
|
||||||
|
coverUrl = div.selectFirst("img")?.src().orEmpty(),
|
||||||
|
title = div.selectFirstOrThrow("h2").text().orEmpty(),
|
||||||
|
altTitle = null,
|
||||||
|
rating = RATING_UNKNOWN,
|
||||||
|
tags = emptySet(),
|
||||||
|
author = null,
|
||||||
|
state = null,
|
||||||
|
source = source,
|
||||||
|
isNsfw = isNsfwSource,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
override suspend fun getTags(): Set<MangaTag> {
|
||||||
|
val doc = webClient.httpGet("https://$domain/$listUrl").parseHtml()
|
||||||
|
return doc.select("div.tagcloud a").mapNotNullToSet { a ->
|
||||||
|
MangaTag(
|
||||||
|
key = a.attr("href").removeSuffix("/").substringAfterLast(geneUrl, ""),
|
||||||
|
title = a.text().toTitleCase(),
|
||||||
|
source = source,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override suspend fun getDetails(manga: Manga): Manga = coroutineScope {
|
||||||
|
val fullUrl = manga.url.toAbsoluteUrl(domain)
|
||||||
|
val doc= webClient.httpGet(fullUrl).parseHtml()
|
||||||
|
|
||||||
|
manga.copy(
|
||||||
|
tags = doc.select("div.tax_box div.links ul:not(.post-categories) li a").mapNotNullToSet { a ->
|
||||||
|
MangaTag(
|
||||||
|
key = a.attr("href").removeSuffix("/").substringAfterLast(geneUrl, ""),
|
||||||
|
title = a.text().toTitleCase(),
|
||||||
|
source = source,
|
||||||
|
)
|
||||||
|
},
|
||||||
|
description = null,
|
||||||
|
altTitle = null,
|
||||||
|
author = null,
|
||||||
|
state = null,
|
||||||
|
chapters = listOf(
|
||||||
|
MangaChapter(
|
||||||
|
id = manga.id,
|
||||||
|
name = manga.title,
|
||||||
|
number = 1,
|
||||||
|
url = manga.url,
|
||||||
|
scanlator = null,
|
||||||
|
uploadDate = 0,
|
||||||
|
branch = null,
|
||||||
|
source = source,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
override suspend fun getPages(chapter: MangaChapter): List<MangaPage> {
|
||||||
|
val fullUrl = chapter.url.toAbsoluteUrl(domain)
|
||||||
|
val doc = webClient.httpGet(fullUrl).parseHtml()
|
||||||
|
return doc.select("div.wp-content img").map { div ->
|
||||||
|
val img = div.selectFirstOrThrow("img")
|
||||||
|
val url = img.src()?.toRelativeUrl(domain) ?: div.parseFailed("Image src not found")
|
||||||
|
MangaPage(
|
||||||
|
id = generateUid(url),
|
||||||
|
url = url,
|
||||||
|
preview = null,
|
||||||
|
source = source,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,15 @@
|
|||||||
|
package org.koitharu.kotatsu.parsers.site.vmp.es
|
||||||
|
|
||||||
|
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.MangaSource
|
||||||
|
import org.koitharu.kotatsu.parsers.site.vmp.VmpParser
|
||||||
|
|
||||||
|
// Other domain name : toonx.net
|
||||||
|
@MangaSourceParser("VERCOMICSPORNO", "VerComicsPorno", "es", ContentType.HENTAI)
|
||||||
|
internal class VerComicsPorno(context: MangaLoaderContext) :
|
||||||
|
VmpParser(context, MangaSource.VERCOMICSPORNO, "vercomicsporno.com") {
|
||||||
|
override val listUrl = "comics-porno/"
|
||||||
|
override val geneUrl = "etiquetas/"
|
||||||
|
}
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
package org.koitharu.kotatsu.parsers.site.vmp.es
|
||||||
|
|
||||||
|
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.MangaSource
|
||||||
|
import org.koitharu.kotatsu.parsers.site.vmp.VmpParser
|
||||||
|
|
||||||
|
@MangaSourceParser("VERMANGASPORNO", "VerMangasPorno", "es", ContentType.HENTAI)
|
||||||
|
internal class VerMangasPorno(context: MangaLoaderContext) :
|
||||||
|
VmpParser(context, MangaSource.VERMANGASPORNO, "vermangasporno.com")
|
||||||
Loading…
Reference in New Issue