diff --git a/src/pt/lermangaonline/AndroidManifest.xml b/src/pt/lermangaonline/AndroidManifest.xml deleted file mode 100644 index ee290809e..000000000 --- a/src/pt/lermangaonline/AndroidManifest.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/src/pt/lermangaonline/build.gradle b/src/pt/lermangaonline/build.gradle deleted file mode 100644 index 25b116b75..000000000 --- a/src/pt/lermangaonline/build.gradle +++ /dev/null @@ -1,8 +0,0 @@ -ext { - extName = 'Ler Mangá Online' - extClass = '.LerMangaOnline' - extVersionCode = 1 - isNsfw = true -} - -apply from: "$rootDir/common.gradle" diff --git a/src/pt/lermangaonline/res/mipmap-hdpi/ic_launcher.png b/src/pt/lermangaonline/res/mipmap-hdpi/ic_launcher.png deleted file mode 100644 index 8b8dde477..000000000 Binary files a/src/pt/lermangaonline/res/mipmap-hdpi/ic_launcher.png and /dev/null differ diff --git a/src/pt/lermangaonline/res/mipmap-mdpi/ic_launcher.png b/src/pt/lermangaonline/res/mipmap-mdpi/ic_launcher.png deleted file mode 100644 index ff02bd0c2..000000000 Binary files a/src/pt/lermangaonline/res/mipmap-mdpi/ic_launcher.png and /dev/null differ diff --git a/src/pt/lermangaonline/res/mipmap-xhdpi/ic_launcher.png b/src/pt/lermangaonline/res/mipmap-xhdpi/ic_launcher.png deleted file mode 100644 index bd15c4b4a..000000000 Binary files a/src/pt/lermangaonline/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ diff --git a/src/pt/lermangaonline/res/mipmap-xxhdpi/ic_launcher.png b/src/pt/lermangaonline/res/mipmap-xxhdpi/ic_launcher.png deleted file mode 100644 index f13ac4d0a..000000000 Binary files a/src/pt/lermangaonline/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/src/pt/lermangaonline/res/mipmap-xxxhdpi/ic_launcher.png b/src/pt/lermangaonline/res/mipmap-xxxhdpi/ic_launcher.png deleted file mode 100644 index 65fa36cca..000000000 Binary files a/src/pt/lermangaonline/res/mipmap-xxxhdpi/ic_launcher.png and /dev/null differ diff --git a/src/pt/lermangaonline/src/eu/kanade/tachiyomi/extension/pt/lermangaonline/LerMangaOnline.kt b/src/pt/lermangaonline/src/eu/kanade/tachiyomi/extension/pt/lermangaonline/LerMangaOnline.kt deleted file mode 100644 index 9e09a71ea..000000000 --- a/src/pt/lermangaonline/src/eu/kanade/tachiyomi/extension/pt/lermangaonline/LerMangaOnline.kt +++ /dev/null @@ -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 { - 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 { - 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")) - } - } -} diff --git a/src/pt/lermangaonline/src/eu/kanade/tachiyomi/extension/pt/lermangaonline/LerMangaOnlineFilters.kt b/src/pt/lermangaonline/src/eu/kanade/tachiyomi/extension/pt/lermangaonline/LerMangaOnlineFilters.kt deleted file mode 100644 index 1b3f90fe2..000000000 --- a/src/pt/lermangaonline/src/eu/kanade/tachiyomi/extension/pt/lermangaonline/LerMangaOnlineFilters.kt +++ /dev/null @@ -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(name: String, values: Array) : Filter.Select(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"), - ), - ) -} diff --git a/src/pt/lermangaonline/src/eu/kanade/tachiyomi/extension/pt/lermangaonline/LerMangaOnlineUrlActivity.kt b/src/pt/lermangaonline/src/eu/kanade/tachiyomi/extension/pt/lermangaonline/LerMangaOnlineUrlActivity.kt deleted file mode 100644 index da4d01b3f..000000000 --- a/src/pt/lermangaonline/src/eu/kanade/tachiyomi/extension/pt/lermangaonline/LerMangaOnlineUrlActivity.kt +++ /dev/null @@ -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) - } -}