Remove "LeerCapitulo" due to cat-and-mouse game (#16255)
* Remove LeerCapitulo * Add to REMOVED_SOURCES.md
This commit is contained in:
parent
b7b77a7299
commit
16c6766c4b
|
@ -43,7 +43,7 @@ jobs:
|
|||
},
|
||||
{
|
||||
"type": "both",
|
||||
"regex": ".*(hq\\s*dragon|manga\\s*host|supermangas|superhentais|union\\s*mangas|yes\\s*mangas|manhuascan|manhwahot|leitor\\.?net|manga\\s*livre|tsuki\\s*mangas|manga\\s*yabu|mangas\\.in|mangas\\.pw|hentaikai|toptoon\\+?|colamanhua|mangadig|hitomi\\.la|copymanga|neox|1manga\\.co|mangafox\\.fun|mangahere\\.onl|mangakakalot\\.fun|manganel(?!o)|mangaonline\\.fun|mangatoday|manga\\.town|onemanga\\.info|koushoku|ksk\\.moe|comikey).*",
|
||||
"regex": ".*(hq\\s*dragon|manga\\s*host|supermangas|superhentais|union\\s*mangas|yes\\s*mangas|manhuascan|manhwahot|leitor\\.?net|manga\\s*livre|tsuki\\s*mangas|manga\\s*yabu|mangas\\.in|mangas\\.pw|hentaikai|toptoon\\+?|colamanhua|mangadig|hitomi\\.la|copymanga|neox|1manga\\.co|mangafox\\.fun|mangahere\\.onl|mangakakalot\\.fun|manganel(?!o)|mangaonline\\.fun|mangatoday|manga\\.town|onemanga\\.info|koushoku|ksk\\.moe|comikey|leercapitulo).*",
|
||||
"ignoreCase": true,
|
||||
"labels": ["invalid"],
|
||||
"message": "{match} will not be added back as it is too difficult to maintain. Read #3475 for more information."
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
- Hitomi.la https://github.com/tachiyomiorg/tachiyomi-extensions/pull/11613
|
||||
- HQ Dragon https://github.com/tachiyomiorg/tachiyomi-extensions/pull/7065
|
||||
- Koushoku https://github.com/tachiyomiorg/tachiyomi-extensions/pull/13329
|
||||
- LeerCapitulo https://github.com/tachiyomiorg/tachiyomi-extensions/pull/16255
|
||||
- Mangá Host https://github.com/tachiyomiorg/tachiyomi-extensions/pull/7065
|
||||
- Mangá Livre and Leitor.net https://github.com/tachiyomiorg/tachiyomi-extensions/pull/8679
|
||||
- MangaDig https://github.com/tachiyomiorg/tachiyomi-extensions/pull/14974
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest package="eu.kanade.tachiyomi.extension" />
|
|
@ -1,12 +0,0 @@
|
|||
apply plugin: 'com.android.application'
|
||||
apply plugin: 'kotlin-android'
|
||||
apply plugin: 'kotlinx-serialization'
|
||||
|
||||
ext {
|
||||
extName = 'LeerCapitulo / OlympusScan.top'
|
||||
pkgNameSuffix = 'es.leercapitulo'
|
||||
extClass = '.LeerCapitulo'
|
||||
extVersionCode = 5
|
||||
}
|
||||
|
||||
apply from: "$rootDir/common.gradle"
|
Binary file not shown.
Before Width: | Height: | Size: 6.6 KiB |
Binary file not shown.
Before Width: | Height: | Size: 3.3 KiB |
Binary file not shown.
Before Width: | Height: | Size: 10 KiB |
Binary file not shown.
Before Width: | Height: | Size: 21 KiB |
Binary file not shown.
Before Width: | Height: | Size: 35 KiB |
Binary file not shown.
Before Width: | Height: | Size: 284 KiB |
|
@ -1,206 +0,0 @@
|
|||
package eu.kanade.tachiyomi.extension.es.leercapitulo
|
||||
|
||||
import android.app.Application
|
||||
import android.util.Base64
|
||||
import androidx.preference.ListPreference
|
||||
import androidx.preference.PreferenceScreen
|
||||
import eu.kanade.tachiyomi.extension.es.leercapitulo.dto.MangaDto
|
||||
import eu.kanade.tachiyomi.network.GET
|
||||
import eu.kanade.tachiyomi.source.ConfigurableSource
|
||||
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 kotlinx.serialization.decodeFromString
|
||||
import kotlinx.serialization.json.Json
|
||||
import okhttp3.HttpUrl.Companion.toHttpUrl
|
||||
import okhttp3.Request
|
||||
import okhttp3.Response
|
||||
import org.jsoup.nodes.Document
|
||||
import org.jsoup.nodes.Element
|
||||
import uy.kohesive.injekt.Injekt
|
||||
import uy.kohesive.injekt.api.get
|
||||
import uy.kohesive.injekt.injectLazy
|
||||
import java.nio.charset.Charset
|
||||
import kotlin.random.Random
|
||||
|
||||
class LeerCapitulo : ParsedHttpSource(), ConfigurableSource {
|
||||
override val name = "LeerCapitulo"
|
||||
|
||||
override val lang = "es"
|
||||
|
||||
override val supportsLatest = true
|
||||
|
||||
private val json: Json by injectLazy()
|
||||
|
||||
private val isCi = System.getenv("CI") == "true"
|
||||
|
||||
override val baseUrl
|
||||
get() = when {
|
||||
isCi -> MIRRORS.joinToString("#, ")
|
||||
else -> _baseUrl
|
||||
}
|
||||
|
||||
private val _baseUrl = run {
|
||||
val preferences = Injekt.get<Application>().getSharedPreferences("source_$id", 0x0000)
|
||||
val mirrors = MIRRORS
|
||||
var index = preferences.getString(MIRROR_PREF, "-1")!!.toInt()
|
||||
if (index !in mirrors.indices) {
|
||||
index = Random.nextInt(0, mirrors.size)
|
||||
preferences.edit().putString(MIRROR_PREF, index.toString()).apply()
|
||||
}
|
||||
mirrors[index]
|
||||
}
|
||||
|
||||
// Popular
|
||||
override fun popularMangaRequest(page: Int): Request =
|
||||
GET(baseUrl, headers)
|
||||
|
||||
override fun popularMangaSelector(): String =
|
||||
".hot-manga > .thumbnails > a"
|
||||
|
||||
override fun popularMangaFromElement(element: Element): SManga = SManga.create().apply {
|
||||
setUrlWithoutDomain(element.attr("abs:href"))
|
||||
title = element.attr("title")
|
||||
|
||||
thumbnail_url = element.selectFirst("img")!!.attr("abs:src")
|
||||
}
|
||||
|
||||
override fun popularMangaNextPageSelector(): String? =
|
||||
null
|
||||
|
||||
// Search
|
||||
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
|
||||
val url = "$baseUrl/search-autocomplete".toHttpUrl().newBuilder()
|
||||
.addQueryParameter("term", query)
|
||||
|
||||
return GET(url.toString(), headers)
|
||||
}
|
||||
|
||||
override fun searchMangaParse(response: Response): MangasPage {
|
||||
val mangas = json.decodeFromString<List<MangaDto>>(response.body.string()).map {
|
||||
SManga.create().apply {
|
||||
setUrlWithoutDomain(it.link)
|
||||
title = it.label
|
||||
thumbnail_url = baseUrl + it.thumbnail
|
||||
}
|
||||
}
|
||||
|
||||
return MangasPage(mangas, hasNextPage = false)
|
||||
}
|
||||
|
||||
override fun searchMangaSelector(): String =
|
||||
throw UnsupportedOperationException("Not used.")
|
||||
|
||||
override fun searchMangaFromElement(element: Element): SManga =
|
||||
throw UnsupportedOperationException("Not used.")
|
||||
|
||||
override fun searchMangaNextPageSelector(): String? =
|
||||
null
|
||||
|
||||
// Latest
|
||||
override fun latestUpdatesRequest(page: Int): Request =
|
||||
popularMangaRequest(page)
|
||||
|
||||
override fun latestUpdatesSelector(): String =
|
||||
".mainpage-manga"
|
||||
|
||||
override fun latestUpdatesFromElement(element: Element): SManga = SManga.create().apply {
|
||||
setUrlWithoutDomain(element.selectFirst(".media-body > a")!!.attr("abs:href"))
|
||||
title = element.selectFirst("h4")!!.text()
|
||||
thumbnail_url = element.selectFirst("img")!!.attr("abs:src")
|
||||
}
|
||||
|
||||
override fun latestUpdatesNextPageSelector(): String? =
|
||||
null
|
||||
|
||||
// Details
|
||||
override fun mangaDetailsParse(document: Document): SManga = SManga.create().apply {
|
||||
title = document.selectFirst("h1")!!.text()
|
||||
|
||||
val altNames = document.selectFirst(".description-update > span:contains(Títulos Alternativos:) + :matchText")?.text()
|
||||
val desc = document.selectFirst("#example2")!!.text()
|
||||
description = when (altNames) {
|
||||
null -> desc
|
||||
else -> "$desc\n\nAlt name(s): $altNames"
|
||||
}
|
||||
|
||||
genre = document.select(".description-update a[href^='/genre/']").joinToString { it.text() }
|
||||
status = document.selectFirst(".description-update > span:contains(Estado:) + :matchText")!!.text().toStatus()
|
||||
thumbnail_url = document.selectFirst(".cover-detail > img")!!.attr("abs:src")
|
||||
}
|
||||
|
||||
// Chapters
|
||||
override fun chapterListSelector(): String =
|
||||
".chapter-list > ul > li"
|
||||
|
||||
override fun chapterFromElement(element: Element): SChapter = SChapter.create().apply {
|
||||
val a = element.selectFirst("a.xanh")!!
|
||||
setUrlWithoutDomain(a.attr("abs:href"))
|
||||
name = a.text()
|
||||
chapter_number = name
|
||||
.substringAfter("Capitulo ")
|
||||
.substringBefore(":")
|
||||
.toFloatOrNull()
|
||||
?: -1f
|
||||
}
|
||||
private val keyRepoUrl = "https://raw.githubusercontent.com/seew3l/tachiyomi-scripts/main/leercapitulo_keys.txt"
|
||||
|
||||
override fun pageListParse(document: Document): List<Page> {
|
||||
val orderList = document.selectFirst("meta[property=ad:check]")?.attr("content")
|
||||
?.replace("[^\\d]+".toRegex(), "-")
|
||||
?.split("-")
|
||||
|
||||
val useReversedString = orderList?.any { it == "01" }
|
||||
|
||||
val arrayData = document.selectFirst("#arraydata")!!.text()
|
||||
|
||||
val (key1, key2) = client.newCall(GET(keyRepoUrl)).execute().body.string().split("\n")
|
||||
|
||||
val encodedUrls = arrayData.replace(Regex("[A-Z0-9]", RegexOption.IGNORE_CASE)) {
|
||||
val index = key2.indexOf(it.value)
|
||||
key1[index].toString()
|
||||
}
|
||||
|
||||
val urlList = String(Base64.decode(encodedUrls, Base64.DEFAULT), Charset.forName("UTF-8")).split(",")
|
||||
|
||||
val sortedUrls = orderList?.map {
|
||||
if (useReversedString == true) urlList[it.reversed().toInt()] else urlList[it.toInt()]
|
||||
}?.reversed() ?: urlList
|
||||
|
||||
return sortedUrls.mapIndexed { i, image_url ->
|
||||
Page(i, imageUrl = image_url)
|
||||
}
|
||||
}
|
||||
|
||||
override fun imageUrlParse(document: Document): String =
|
||||
throw UnsupportedOperationException("Not used.")
|
||||
|
||||
// Other
|
||||
private fun String.toStatus() = when (this) {
|
||||
"Ongoing" -> SManga.ONGOING
|
||||
"Paused" -> SManga.ON_HIATUS
|
||||
"Completed" -> SManga.COMPLETED
|
||||
"Cancelled" -> SManga.CANCELLED
|
||||
else -> SManga.UNKNOWN
|
||||
}
|
||||
|
||||
override fun setupPreferenceScreen(screen: PreferenceScreen) {
|
||||
ListPreference(screen.context).apply {
|
||||
val mirrors = MIRRORS
|
||||
|
||||
key = MIRROR_PREF
|
||||
title = "Mirror"
|
||||
summary = "%s\nRequires restart to take effect"
|
||||
entries = mirrors
|
||||
entryValues = Array(mirrors.size, Int::toString)
|
||||
}.let(screen::addPreference)
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val MIRROR_PREF = "MIRROR"
|
||||
private val MIRRORS get() = arrayOf("https://www.leercapitulo.com", "https://olympusscan.top")
|
||||
}
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
package eu.kanade.tachiyomi.extension.es.leercapitulo.dto
|
||||
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
data class MangaDto(
|
||||
val label: String,
|
||||
val link: String,
|
||||
val thumbnail: String,
|
||||
val value: String,
|
||||
)
|
Loading…
Reference in New Issue