@ -1,8 +0,0 @@
|
|||||||
ext {
|
|
||||||
extName = 'DragonTranslation.net'
|
|
||||||
extClass = '.DragonTranslationNet'
|
|
||||||
extVersionCode = 40
|
|
||||||
isNsfw = true
|
|
||||||
}
|
|
||||||
|
|
||||||
apply from: "$rootDir/common.gradle"
|
|
Before Width: | Height: | Size: 8.5 KiB |
Before Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 41 KiB |
@ -1,119 +0,0 @@
|
|||||||
package eu.kanade.tachiyomi.extension.es.dragontranslationnet
|
|
||||||
|
|
||||||
import eu.kanade.tachiyomi.network.GET
|
|
||||||
import eu.kanade.tachiyomi.source.model.FilterList
|
|
||||||
import eu.kanade.tachiyomi.source.model.MangasPage
|
|
||||||
import eu.kanade.tachiyomi.source.model.Page
|
|
||||||
import eu.kanade.tachiyomi.source.model.SChapter
|
|
||||||
import eu.kanade.tachiyomi.source.model.SManga
|
|
||||||
import eu.kanade.tachiyomi.source.online.HttpSource
|
|
||||||
import eu.kanade.tachiyomi.util.asJsoup
|
|
||||||
import okhttp3.HttpUrl.Companion.toHttpUrl
|
|
||||||
import okhttp3.Request
|
|
||||||
import okhttp3.Response
|
|
||||||
import org.jsoup.nodes.Element
|
|
||||||
|
|
||||||
open class DragonTranslationNet : HttpSource() {
|
|
||||||
|
|
||||||
override val name = "DragonTranslation.net"
|
|
||||||
|
|
||||||
override val baseUrl = "https://dragontranslation.net"
|
|
||||||
|
|
||||||
override val lang = "es"
|
|
||||||
|
|
||||||
override val supportsLatest = true
|
|
||||||
|
|
||||||
// Popular
|
|
||||||
|
|
||||||
override fun popularMangaRequest(page: Int): Request {
|
|
||||||
return GET("$baseUrl/mangas?page=$page", headers)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun popularMangaParse(response: Response): MangasPage {
|
|
||||||
val document = response.asJsoup()
|
|
||||||
val entries = document.select("article.card").map {
|
|
||||||
SManga.create().apply {
|
|
||||||
setUrlWithoutDomain(it.selectFirst("a.lanzador")!!.attr("href"))
|
|
||||||
thumbnail_url = it.selectFirst("img")?.attr("abs:src")
|
|
||||||
title = it.selectFirst("h2")!!.text()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
val hasNextPage = document.selectFirst("li.page-item a[rel=next]") != null
|
|
||||||
return MangasPage(entries, hasNextPage)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Latest
|
|
||||||
|
|
||||||
override fun latestUpdatesRequest(page: Int): Request {
|
|
||||||
return GET(baseUrl, headers)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun latestUpdatesParse(response: Response): MangasPage {
|
|
||||||
val document = response.asJsoup()
|
|
||||||
val mangaList = document.select("div#pills-home:lt(1) article").map {
|
|
||||||
SManga.create().apply {
|
|
||||||
setUrlWithoutDomain(it.selectFirst("a[rel=bookmark]")!!.attr("href"))
|
|
||||||
title = it.selectFirst("h2")!!.text()
|
|
||||||
thumbnail_url = it.selectFirst("img")?.attr("abs:src")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return MangasPage(mangaList, false)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Search
|
|
||||||
|
|
||||||
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
|
|
||||||
val url = baseUrl.toHttpUrl().newBuilder().addPathSegment("mangas")
|
|
||||||
.addQueryParameter("buscar", query).addQueryParameter("page", page.toString())
|
|
||||||
return GET(url.build(), headers)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun searchMangaParse(response: Response): MangasPage = popularMangaParse(response)
|
|
||||||
|
|
||||||
// Chapters
|
|
||||||
|
|
||||||
override fun chapterListParse(response: Response): List<SChapter> {
|
|
||||||
val document = response.asJsoup()
|
|
||||||
return document.select("ul.list-group a").map {
|
|
||||||
SChapter.create().apply {
|
|
||||||
name = it.selectFirst("li")!!.text()
|
|
||||||
setUrlWithoutDomain(it.attr("abs:href"))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Details
|
|
||||||
|
|
||||||
override fun mangaDetailsParse(response: Response): SManga {
|
|
||||||
val document = response.asJsoup()
|
|
||||||
val infoRow = document.selectFirst("div.section-main > div.row")
|
|
||||||
return SManga.create().apply {
|
|
||||||
description = infoRow?.selectFirst("> :eq(1)")?.ownText()
|
|
||||||
status = infoRow?.selectFirst("p:contains(Status) > a").parseStatus()
|
|
||||||
genre = infoRow?.select("p:contains(Tag(s)) a")?.joinToString { it.text() }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Pages
|
|
||||||
|
|
||||||
override fun pageListParse(response: Response): List<Page> {
|
|
||||||
val document = response.asJsoup()
|
|
||||||
return document.select("div#chapter_imgs img").mapIndexed { index, element ->
|
|
||||||
Page(
|
|
||||||
index,
|
|
||||||
document.location(),
|
|
||||||
element.attr("abs:src"),
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun imageUrlParse(response: Response): String = throw UnsupportedOperationException()
|
|
||||||
|
|
||||||
// Helpers
|
|
||||||
|
|
||||||
private fun Element?.parseStatus(): Int = when (this?.text()?.lowercase()) {
|
|
||||||
"publishing", "ongoing" -> SManga.ONGOING
|
|
||||||
"ended" -> SManga.COMPLETED
|
|
||||||
else -> SManga.UNKNOWN
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,8 +0,0 @@
|
|||||||
ext {
|
|
||||||
extName = 'Manhwas.net'
|
|
||||||
extClass = '.ManhwasNet'
|
|
||||||
extVersionCode = 12
|
|
||||||
isNsfw = true
|
|
||||||
}
|
|
||||||
|
|
||||||
apply from: "$rootDir/common.gradle"
|
|
Before Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 7.9 KiB |
Before Width: | Height: | Size: 11 KiB |
@ -1,153 +0,0 @@
|
|||||||
package eu.kanade.tachiyomi.extension.es.manhwasnet
|
|
||||||
|
|
||||||
import eu.kanade.tachiyomi.network.GET
|
|
||||||
import eu.kanade.tachiyomi.network.interceptor.rateLimitHost
|
|
||||||
import eu.kanade.tachiyomi.source.model.Filter
|
|
||||||
import eu.kanade.tachiyomi.source.model.FilterList
|
|
||||||
import eu.kanade.tachiyomi.source.model.Page
|
|
||||||
import eu.kanade.tachiyomi.source.model.SChapter
|
|
||||||
import eu.kanade.tachiyomi.source.model.SManga
|
|
||||||
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
|
|
||||||
import okhttp3.HttpUrl.Companion.toHttpUrl
|
|
||||||
import okhttp3.Request
|
|
||||||
import org.jsoup.nodes.Document
|
|
||||||
import org.jsoup.nodes.Element
|
|
||||||
import java.util.Calendar
|
|
||||||
import java.util.concurrent.TimeUnit
|
|
||||||
|
|
||||||
class ManhwasNet : ParsedHttpSource() {
|
|
||||||
|
|
||||||
override val baseUrl: String = "https://manhwas.net"
|
|
||||||
override val lang: String = "es"
|
|
||||||
override val name: String = "Manhwas.net"
|
|
||||||
override val supportsLatest: Boolean = true
|
|
||||||
|
|
||||||
override val client = network.cloudflareClient.newBuilder()
|
|
||||||
.rateLimitHost(baseUrl.toHttpUrl(), 3, 1, TimeUnit.SECONDS)
|
|
||||||
.build()
|
|
||||||
|
|
||||||
override fun headersBuilder() = super.headersBuilder()
|
|
||||||
.set("Referer", "$baseUrl/")
|
|
||||||
|
|
||||||
override fun popularMangaRequest(page: Int): Request {
|
|
||||||
val url = "$baseUrl/biblioteca".toHttpUrl().newBuilder()
|
|
||||||
url.addQueryParameter("page", page.toString())
|
|
||||||
return GET(url.build(), headers)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun popularMangaSelector() = "ul > li > article.anime"
|
|
||||||
|
|
||||||
override fun popularMangaNextPageSelector() = "ul.pagination a.page-link[rel=next]"
|
|
||||||
|
|
||||||
override fun popularMangaFromElement(element: Element) = SManga.create().apply {
|
|
||||||
setUrlWithoutDomain(element.selectFirst("a")!!.attr("href"))
|
|
||||||
title = element.selectFirst(".title")!!.text()
|
|
||||||
thumbnail_url = element.selectFirst("img")!!.attr("abs:src")
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun latestUpdatesRequest(page: Int): Request {
|
|
||||||
return GET(baseUrl, headers)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun latestUpdatesSelector() = popularMangaSelector()
|
|
||||||
|
|
||||||
override fun latestUpdatesNextPageSelector() = null
|
|
||||||
|
|
||||||
override fun latestUpdatesFromElement(element: Element) = SManga.create().apply {
|
|
||||||
setUrlWithoutDomain(element.select("a").last()!!.attr("abs:href"))
|
|
||||||
title = element.selectFirst(".title")!!.text()
|
|
||||||
thumbnail_url = element.selectFirst("img")!!.attr("abs:src")
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
|
|
||||||
val url = "$baseUrl/biblioteca".toHttpUrl().newBuilder()
|
|
||||||
if (query.isNotEmpty()) {
|
|
||||||
url.addQueryParameter("buscar", query)
|
|
||||||
} else {
|
|
||||||
filters.forEach { filter ->
|
|
||||||
when (filter) {
|
|
||||||
is GenreFilter -> {
|
|
||||||
url.addQueryParameter("genero", filter.toUriPart())
|
|
||||||
}
|
|
||||||
is OrderFilter -> {
|
|
||||||
url.addQueryParameter("estado", filter.toUriPart())
|
|
||||||
}
|
|
||||||
|
|
||||||
else -> {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
url.addQueryParameter("page", page.toString())
|
|
||||||
return GET(url.build(), headers)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun searchMangaSelector() = popularMangaSelector()
|
|
||||||
|
|
||||||
override fun searchMangaNextPageSelector() = popularMangaNextPageSelector()
|
|
||||||
|
|
||||||
override fun searchMangaFromElement(element: Element) = popularMangaFromElement(element)
|
|
||||||
|
|
||||||
override fun mangaDetailsParse(document: Document): SManga {
|
|
||||||
val profileManga = document.selectFirst(".anime-single")!!
|
|
||||||
return SManga.create().apply {
|
|
||||||
title = profileManga.selectFirst(".title")!!.text()
|
|
||||||
thumbnail_url = profileManga.selectFirst("img")!!.attr("abs:src")
|
|
||||||
description = profileManga.selectFirst(".sinopsis")!!.text()
|
|
||||||
status = parseStatus(profileManga.select("span.anime-type-peli").last()!!.text())
|
|
||||||
genre = profileManga.select("p.genres > span").joinToString { it.text() }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun chapterListSelector() = "ul.episodes-list > li"
|
|
||||||
|
|
||||||
override fun chapterFromElement(element: Element) = SChapter.create().apply {
|
|
||||||
setUrlWithoutDomain(element.selectFirst("a")!!.attr("abs:href"))
|
|
||||||
name = element.selectFirst("a > div > p > span")!!.text()
|
|
||||||
date_upload = parseRelativeDate(element.selectFirst("a > div > span")!!.text())
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun pageListParse(document: Document): List<Page> {
|
|
||||||
return document.select("#chapter_imgs img[src][src!=\"\"]").mapIndexed { i, img ->
|
|
||||||
val url = img.attr("abs:src")
|
|
||||||
Page(i, imageUrl = url)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun imageUrlParse(document: Document) = throw UnsupportedOperationException()
|
|
||||||
|
|
||||||
override fun getFilterList() = FilterList(
|
|
||||||
Filter.Header("Los filtros no se pueden combinar:"),
|
|
||||||
Filter.Header("Prioridad: Texto > Géneros > Estado"),
|
|
||||||
Filter.Separator(),
|
|
||||||
GenreFilter(),
|
|
||||||
OrderFilter(),
|
|
||||||
)
|
|
||||||
|
|
||||||
private fun parseStatus(status: String): Int = when (status) {
|
|
||||||
"Publicándose" -> SManga.ONGOING
|
|
||||||
"Finalizado" -> SManga.COMPLETED
|
|
||||||
"Cancelado" -> SManga.CANCELLED
|
|
||||||
"Pausado" -> SManga.ON_HIATUS
|
|
||||||
else -> SManga.UNKNOWN
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun parseRelativeDate(date: String): Long {
|
|
||||||
val number = Regex("""(\d+)""").find(date)?.value?.toIntOrNull() ?: return 0
|
|
||||||
val cal = Calendar.getInstance()
|
|
||||||
|
|
||||||
return when {
|
|
||||||
WordSet("segundo").anyWordIn(date) -> cal.apply { add(Calendar.SECOND, -number) }.timeInMillis
|
|
||||||
WordSet("minuto").anyWordIn(date) -> cal.apply { add(Calendar.MINUTE, -number) }.timeInMillis
|
|
||||||
WordSet("hora").anyWordIn(date) -> cal.apply { add(Calendar.HOUR, -number) }.timeInMillis
|
|
||||||
WordSet("día").anyWordIn(date) -> cal.apply { add(Calendar.DAY_OF_MONTH, -number) }.timeInMillis
|
|
||||||
WordSet("semana").anyWordIn(date) -> cal.apply { add(Calendar.DAY_OF_MONTH, -number * 7) }.timeInMillis
|
|
||||||
WordSet("mes").anyWordIn(date) -> cal.apply { add(Calendar.MONTH, -number) }.timeInMillis
|
|
||||||
WordSet("año").anyWordIn(date) -> cal.apply { add(Calendar.YEAR, -number) }.timeInMillis
|
|
||||||
else -> 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class WordSet(private vararg val words: String) {
|
|
||||||
fun anyWordIn(dateString: String): Boolean = words.any { dateString.contains(it, ignoreCase = true) }
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,84 +0,0 @@
|
|||||||
package eu.kanade.tachiyomi.extension.es.manhwasnet
|
|
||||||
|
|
||||||
import eu.kanade.tachiyomi.source.model.Filter
|
|
||||||
|
|
||||||
class GenreFilter() : UriPartFilter(
|
|
||||||
"Género",
|
|
||||||
arrayOf(
|
|
||||||
Pair("Acción", "accion"),
|
|
||||||
Pair("Aventura", "aventura"),
|
|
||||||
Pair("Comedia", "comedia"),
|
|
||||||
Pair("Recuentos de la vida", "recuentos-de-la-vida"),
|
|
||||||
Pair("Ecchi", "ecchi"),
|
|
||||||
Pair("Fantasia", "fantasia"),
|
|
||||||
Pair("Magia", "magia"),
|
|
||||||
Pair("Sobrenatural", "sobrenatural"),
|
|
||||||
Pair("Horror", "horror"),
|
|
||||||
Pair("Misterio", "misterio"),
|
|
||||||
Pair("Psicológico", "psicologico"),
|
|
||||||
Pair("Romance", "romance"),
|
|
||||||
Pair("Ciencia Ficción", "ciencia-ficcion"),
|
|
||||||
Pair("Thriller", "thriller"),
|
|
||||||
Pair("Deporte", "deporte"),
|
|
||||||
Pair("Girls Love", "girls-love"),
|
|
||||||
Pair("Boys Love", "boys-love"),
|
|
||||||
Pair("Harem", "harem"),
|
|
||||||
Pair("Mecha", "mecha"),
|
|
||||||
Pair("Supervivencia", "supervivencia"),
|
|
||||||
Pair("Reencarnación", "reencarnacion"),
|
|
||||||
Pair("Gore", "gore"),
|
|
||||||
Pair("Apocalíptico", "apocaliptico"),
|
|
||||||
Pair("Tragedia", "tragedia"),
|
|
||||||
Pair("Vida Escolar", "vida-escolar"),
|
|
||||||
Pair("Historia", "historia"),
|
|
||||||
Pair("Policiaco", "policiaco"),
|
|
||||||
Pair("Crimen", "crimen"),
|
|
||||||
Pair("Superpoderes", "superpoderes"),
|
|
||||||
Pair("Vampiros", "vampiros"),
|
|
||||||
Pair("Artes Marciales", "artes-marcialos"),
|
|
||||||
Pair("Samurái", "samurai"),
|
|
||||||
Pair("Género Bender", "genero-bender"),
|
|
||||||
Pair("Realidad Virtual", "realidad-virtual"),
|
|
||||||
Pair("Ciberpunk", "ciberpunk"),
|
|
||||||
Pair("Musica", "musica"),
|
|
||||||
Pair("Parodia", "parodia"),
|
|
||||||
Pair("Animación", "animacion"),
|
|
||||||
Pair("Demonios", "demonios"),
|
|
||||||
Pair("Familia", "familia"),
|
|
||||||
Pair("Extranjero", "extranjero"),
|
|
||||||
Pair("Niños", "ninos"),
|
|
||||||
Pair("Realidad", "realidad"),
|
|
||||||
Pair("Telenovela", "telenovela"),
|
|
||||||
Pair("Guerra", "guerra"),
|
|
||||||
Pair("Oeste", "oeste"),
|
|
||||||
Pair("Ahegao", "Ahegao"),
|
|
||||||
Pair("Anal", "Anal"),
|
|
||||||
Pair("Big Ass", "Big Ass"),
|
|
||||||
Pair("Bondage", "Bondage"),
|
|
||||||
Pair("Chantaje", "Chantaje"),
|
|
||||||
Pair("Colegiala", "Colegiala"),
|
|
||||||
Pair("Incesto", "incesto"),
|
|
||||||
Pair("Juguetes Sexuales", "Juguetes Sexuales"),
|
|
||||||
Pair("Nympho", "Nympho"),
|
|
||||||
Pair("Netorare", "Netorare"),
|
|
||||||
Pair("Cheating", " Cheating"),
|
|
||||||
Pair("Schoolgirl Uniform", "schoolgirl uniform"),
|
|
||||||
Pair("Rape", "rape"),
|
|
||||||
Pair("Lolicon", "Lolicon"),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
||||||
class OrderFilter() : UriPartFilter(
|
|
||||||
"Estado",
|
|
||||||
arrayOf(
|
|
||||||
Pair("Publicándose", "publishing"),
|
|
||||||
Pair("Finalizado", "ended"),
|
|
||||||
Pair("Cancelado", "cancelled"),
|
|
||||||
Pair("Pausado", "on_hold"),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
||||||
open class UriPartFilter(displayName: String, val vals: Array<Pair<String, String>>) :
|
|
||||||
Filter.Select<String>(displayName, vals.map { it.first }.toTypedArray()) {
|
|
||||||
fun toUriPart() = vals[state].second
|
|
||||||
}
|
|