Remove LerMangaOnline (#3547)
This commit is contained in:
parent
6b09f203d7
commit
837d6b515f
|
@ -1,22 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
|
|
||||||
<application>
|
|
||||||
<activity
|
|
||||||
android:name=".pt.lermangaonline.LerMangaOnlineUrlActivity"
|
|
||||||
android:excludeFromRecents="true"
|
|
||||||
android:exported="true"
|
|
||||||
android:theme="@android:style/Theme.NoDisplay">
|
|
||||||
<intent-filter>
|
|
||||||
<action android:name="android.intent.action.VIEW" />
|
|
||||||
|
|
||||||
<category android:name="android.intent.category.DEFAULT" />
|
|
||||||
<category android:name="android.intent.category.BROWSABLE" />
|
|
||||||
|
|
||||||
<data android:host="lermangaonline.com.br" />
|
|
||||||
<data android:scheme="https" />
|
|
||||||
<data android:pathPattern="/..*" />
|
|
||||||
</intent-filter>
|
|
||||||
</activity>
|
|
||||||
</application>
|
|
||||||
</manifest>
|
|
|
@ -1,8 +0,0 @@
|
||||||
ext {
|
|
||||||
extName = 'Ler Mangá Online'
|
|
||||||
extClass = '.LerMangaOnline'
|
|
||||||
extVersionCode = 1
|
|
||||||
isNsfw = true
|
|
||||||
}
|
|
||||||
|
|
||||||
apply from: "$rootDir/common.gradle"
|
|
Binary file not shown.
Before Width: | Height: | Size: 5.5 KiB |
Binary file not shown.
Before Width: | Height: | Size: 2.8 KiB |
Binary file not shown.
Before Width: | Height: | Size: 8.0 KiB |
Binary file not shown.
Before Width: | Height: | Size: 15 KiB |
Binary file not shown.
Before Width: | Height: | Size: 22 KiB |
|
@ -1,139 +0,0 @@
|
||||||
package eu.kanade.tachiyomi.extension.pt.lermangaonline
|
|
||||||
|
|
||||||
import eu.kanade.tachiyomi.extension.pt.lermangaonline.LerMangaOnlineFilters.GenresFilter
|
|
||||||
import eu.kanade.tachiyomi.network.GET
|
|
||||||
import eu.kanade.tachiyomi.network.asObservableSuccess
|
|
||||||
import eu.kanade.tachiyomi.network.interceptor.rateLimitHost
|
|
||||||
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.ParsedHttpSource
|
|
||||||
import eu.kanade.tachiyomi.util.asJsoup
|
|
||||||
import okhttp3.HttpUrl.Companion.toHttpUrl
|
|
||||||
import okhttp3.OkHttpClient
|
|
||||||
import okhttp3.Request
|
|
||||||
import okhttp3.Response
|
|
||||||
import org.jsoup.nodes.Document
|
|
||||||
import org.jsoup.nodes.Element
|
|
||||||
import rx.Observable
|
|
||||||
import java.text.SimpleDateFormat
|
|
||||||
import java.util.Locale
|
|
||||||
import java.util.concurrent.TimeUnit
|
|
||||||
|
|
||||||
class LerMangaOnline : ParsedHttpSource() {
|
|
||||||
override val name = "Ler Mangá Online"
|
|
||||||
|
|
||||||
override val baseUrl = "https://lermangaonline.com.br"
|
|
||||||
|
|
||||||
override val lang = "pt-BR"
|
|
||||||
|
|
||||||
override val supportsLatest = true
|
|
||||||
|
|
||||||
override val client: OkHttpClient = network.cloudflareClient.newBuilder()
|
|
||||||
.rateLimitHost(baseUrl.toHttpUrl(), 1, 1, TimeUnit.SECONDS)
|
|
||||||
.build()
|
|
||||||
|
|
||||||
override fun chapterFromElement(element: Element) = SChapter.create().apply {
|
|
||||||
name = element.selectFirst("div.capitulo")!!.ownText()
|
|
||||||
date_upload = (element.selectFirst("span")?.text() ?: "").toDate()
|
|
||||||
setUrlWithoutDomain(element.absUrl("href"))
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun chapterListSelector() = "div.capitulos a"
|
|
||||||
|
|
||||||
override fun imageUrlParse(document: Document) = ""
|
|
||||||
|
|
||||||
override fun latestUpdatesFromElement(element: Element) = SManga.create().apply {
|
|
||||||
title = element.selectFirst("section h3")!!.text()
|
|
||||||
thumbnail_url = element.selectFirst("div.poster img")?.absUrl("src")
|
|
||||||
setUrlWithoutDomain(element.selectFirst("div.poster a")!!.absUrl("href"))
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun latestUpdatesNextPageSelector() = "div.wp-pagenavi [aria-current] + a"
|
|
||||||
|
|
||||||
override fun latestUpdatesRequest(page: Int): Request {
|
|
||||||
val url = "$baseUrl/capitulo/page/$page".toHttpUrl().newBuilder()
|
|
||||||
.build()
|
|
||||||
return GET(url, headers)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun latestUpdatesSelector() = "div.box-indx section.materias article"
|
|
||||||
|
|
||||||
override fun mangaDetailsParse(document: Document) = SManga.create().apply {
|
|
||||||
val info = document.selectFirst("div.box-flex")
|
|
||||||
title = info!!.selectFirst("div.sinopse a")!!.text()
|
|
||||||
description = info.selectFirst("div.sinopse div:nth-child(2)")?.text()
|
|
||||||
thumbnail_url = info.selectFirst("div.poster img")?.srcAttr()
|
|
||||||
genre = document.select("div.categorias-blog a").joinToString { it.text() }
|
|
||||||
status = SManga.UNKNOWN
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun pageListParse(document: Document): List<Page> {
|
|
||||||
val elements = document.select("div.images img")
|
|
||||||
return elements.mapIndexed { i, el ->
|
|
||||||
Page(i, imageUrl = el.srcAttr())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun popularMangaFromElement(element: Element) = latestUpdatesFromElement(element)
|
|
||||||
|
|
||||||
override fun popularMangaNextPageSelector() = latestUpdatesNextPageSelector()
|
|
||||||
|
|
||||||
override fun popularMangaRequest(page: Int): Request {
|
|
||||||
val url = "$baseUrl/page/$page".toHttpUrl().newBuilder()
|
|
||||||
.build()
|
|
||||||
return GET(url, headers)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun popularMangaSelector() = latestUpdatesSelector()
|
|
||||||
|
|
||||||
override fun searchMangaFromElement(element: Element) = latestUpdatesFromElement(element)
|
|
||||||
|
|
||||||
override fun searchMangaNextPageSelector() = latestUpdatesNextPageSelector()
|
|
||||||
|
|
||||||
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
|
|
||||||
val filter = filters.first() as GenreFilter<*>
|
|
||||||
val genre = filter.selected
|
|
||||||
val url = "$baseUrl/${if (genre.isGlobal()) "" else genre.slug + "/"}page/$page".toHttpUrl().newBuilder()
|
|
||||||
.addQueryParameter("s", query)
|
|
||||||
.build()
|
|
||||||
return GET(url, headers)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun fetchSearchManga(page: Int, query: String, filters: FilterList): Observable<MangasPage> {
|
|
||||||
return if (query.startsWith(PREFIX_SLUG_SEARCH)) {
|
|
||||||
val slug = query.removePrefix(PREFIX_SLUG_SEARCH)
|
|
||||||
client.newCall(GET("$baseUrl/$slug", headers))
|
|
||||||
.asObservableSuccess()
|
|
||||||
.map(::searchMangaBySlugParse)
|
|
||||||
} else {
|
|
||||||
super.fetchSearchManga(page, query, filters)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun searchMangaBySlugParse(response: Response): MangasPage =
|
|
||||||
MangasPage(listOf(mangaDetailsParse(response.asJsoup())), false)
|
|
||||||
|
|
||||||
override fun getFilterList(): FilterList = FilterList(GenresFilter)
|
|
||||||
|
|
||||||
override fun searchMangaSelector() = latestUpdatesSelector()
|
|
||||||
|
|
||||||
private fun Element.srcAttr(): String = when {
|
|
||||||
hasAttr("data-src") -> absUrl("data-src")
|
|
||||||
else -> absUrl("src")
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun String.toDate(): Long {
|
|
||||||
return runCatching { DATE_FORMATTER.parse(trim())?.time }
|
|
||||||
.getOrNull() ?: 0L
|
|
||||||
}
|
|
||||||
|
|
||||||
companion object {
|
|
||||||
const val PREFIX_SLUG_SEARCH = "slug:"
|
|
||||||
private val DATE_FORMATTER by lazy {
|
|
||||||
SimpleDateFormat("dd-MM-yyyy", Locale("pt", "BR"))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,96 +0,0 @@
|
||||||
package eu.kanade.tachiyomi.extension.pt.lermangaonline
|
|
||||||
|
|
||||||
import eu.kanade.tachiyomi.source.model.Filter
|
|
||||||
|
|
||||||
open class Genre(val name: String, val slug: String) {
|
|
||||||
fun isGlobal() = Global.slug == slug
|
|
||||||
override fun toString() = name
|
|
||||||
|
|
||||||
companion object {
|
|
||||||
val Global = Genre("Global", "global")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
open class GenreFilter<String>(name: String, values: Array<Genre>) : Filter.Select<Genre>(name.toString(), values) {
|
|
||||||
val selected
|
|
||||||
get() = values[state]
|
|
||||||
}
|
|
||||||
|
|
||||||
object LerMangaOnlineFilters {
|
|
||||||
val GenresFilter = GenreFilter(
|
|
||||||
"Categorias",
|
|
||||||
arrayOf(
|
|
||||||
Genre.Global,
|
|
||||||
Genre("Ação", "acao"),
|
|
||||||
Genre("Action", "action"),
|
|
||||||
Genre("Adulto", "adulto"),
|
|
||||||
Genre("Adulto (18+)", "adulto-18"),
|
|
||||||
Genre("Adulto (YAOI)", "adulto-yaoi"),
|
|
||||||
Genre("Artes Marciais", "artes-marciais"),
|
|
||||||
Genre("Ativo", "ativo"),
|
|
||||||
Genre("Aventura", "aventura"),
|
|
||||||
Genre("Comédia", "comedia"),
|
|
||||||
Genre("Comedy", "comedy"),
|
|
||||||
Genre("Demência", "demencia"),
|
|
||||||
Genre("Demônios", "demonios"),
|
|
||||||
Genre("Doujinshi", "doujinshi"),
|
|
||||||
Genre("Drama", "drama"),
|
|
||||||
Genre("Ecchi", "ecchi"),
|
|
||||||
Genre("Escolar", "escolar"),
|
|
||||||
Genre("Espacial", "espacial"),
|
|
||||||
Genre("Esportes", "esportes"),
|
|
||||||
Genre("Fantasia", "fantasia"),
|
|
||||||
Genre("Fantasy", "fantasy"),
|
|
||||||
Genre("Ficção", "ficcão"),
|
|
||||||
Genre("Ficção Científica", "ficcão-científica"),
|
|
||||||
Genre("FullColor", "fullcolor"),
|
|
||||||
Genre("Gender Bender", "gender-bender"),
|
|
||||||
Genre("Harém", "harem"),
|
|
||||||
Genre("Hentai", "hentai"),
|
|
||||||
Genre("Histórico", "historico"),
|
|
||||||
Genre("Horror", "horror"),
|
|
||||||
Genre("Isekai", "isekai"),
|
|
||||||
Genre("Jogos", "jogos"),
|
|
||||||
Genre("Josei", "josei"),
|
|
||||||
Genre("LongStrip", "longstrip"),
|
|
||||||
Genre("Maduro", "maduro"),
|
|
||||||
Genre("Mafia", "mafia"),
|
|
||||||
Genre("Magia", "magia"),
|
|
||||||
Genre("Mangás", "mangas"),
|
|
||||||
Genre("Manhwa", "manhwa"),
|
|
||||||
Genre("MartialArts", "martialarts"),
|
|
||||||
Genre("Mechas", "mechas"),
|
|
||||||
Genre("Militar", "militar"),
|
|
||||||
Genre("Mistério", "mistério"),
|
|
||||||
Genre("Monstros", "monstros"),
|
|
||||||
Genre("Música", "música"),
|
|
||||||
Genre("One Shot", "One Shot"),
|
|
||||||
Genre("Paródia", "parodia"),
|
|
||||||
Genre("Psicológico", "psicologico"),
|
|
||||||
Genre("Romance", "romance"),
|
|
||||||
Genre("SchoolLife", "schoollife"),
|
|
||||||
Genre("Sci-Fi", "sci-fi"),
|
|
||||||
Genre("Seinen", "seinen"),
|
|
||||||
Genre("Shonen", "shonen"),
|
|
||||||
Genre("Shoujo", "shoujo"),
|
|
||||||
Genre("Shoujo Ai", "shoujo-ai"),
|
|
||||||
Genre("Shounen", "shounen"),
|
|
||||||
Genre("Shounen Ai", "shounen-ai"),
|
|
||||||
Genre("Slice of Life", "slice-of-life"),
|
|
||||||
Genre("Sobrenatural", "sobrenatural"),
|
|
||||||
Genre("Sports", "sports"),
|
|
||||||
Genre("Super Poderes", "super-poderes"),
|
|
||||||
Genre("Thriller", "thriller"),
|
|
||||||
Genre("TimeTravel", "timeTravel"),
|
|
||||||
Genre("Tragédia", "tragedia"),
|
|
||||||
Genre("UserCreated", "usercreated"),
|
|
||||||
Genre("Vampiros", "vampiros"),
|
|
||||||
Genre("Vida Escolar", "vida-escolar"),
|
|
||||||
Genre("VideoGames", "videogames"),
|
|
||||||
Genre("WebComic", "webComic"),
|
|
||||||
Genre("Webtoon", "webtoon"),
|
|
||||||
Genre("Yaoi", "yaoi"),
|
|
||||||
Genre("Yuri", "yuri"),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
}
|
|
|
@ -1,36 +0,0 @@
|
||||||
package eu.kanade.tachiyomi.extension.pt.lermangaonline
|
|
||||||
|
|
||||||
import android.app.Activity
|
|
||||||
import android.content.ActivityNotFoundException
|
|
||||||
import android.content.Intent
|
|
||||||
import android.os.Bundle
|
|
||||||
import android.util.Log
|
|
||||||
import kotlin.system.exitProcess
|
|
||||||
|
|
||||||
class LerMangaOnlineUrlActivity : Activity() {
|
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
|
||||||
super.onCreate(savedInstanceState)
|
|
||||||
val pathSegments = intent?.data?.pathSegments
|
|
||||||
|
|
||||||
if (pathSegments != null && pathSegments.size > 1) {
|
|
||||||
val slug = pathSegments[1]
|
|
||||||
val intent = Intent().apply {
|
|
||||||
action = "eu.kanade.tachiyomi.SEARCH"
|
|
||||||
putExtra("query", "${LerMangaOnline.PREFIX_SLUG_SEARCH}$slug")
|
|
||||||
putExtra("filter", packageName)
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
startActivity(intent)
|
|
||||||
} catch (e: ActivityNotFoundException) {
|
|
||||||
Log.e("LerMangaOnlineUrlActivity", e.toString())
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
Log.e("LerMangaOnlineUrlActivity", "Could not parse URI from intent $intent")
|
|
||||||
}
|
|
||||||
|
|
||||||
finish()
|
|
||||||
exitProcess(0)
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue