feat(src/es): EstrenosDoramas added & HLA fixes #528
10 changed files with 501 additions and 36 deletions
16
src/es/estrenosdoramas/build.gradle
Normal file
16
src/es/estrenosdoramas/build.gradle
Normal file
|
@ -0,0 +1,16 @@
|
|||
ext {
|
||||
extName = 'EstrenosDoramas'
|
||||
extClass = '.EstrenosDoramas'
|
||||
extVersionCode = 1
|
||||
}
|
||||
|
||||
apply from: "$rootDir/common.gradle"
|
||||
|
||||
dependencies {
|
||||
implementation(project(':lib:okru-extractor'))
|
||||
implementation(project(':lib:streamwish-extractor'))
|
||||
implementation(project(':lib:streamhidevid-extractor'))
|
||||
implementation(project(':lib:voe-extractor'))
|
||||
implementation(project(':lib:yourupload-extractor'))
|
||||
implementation(project(':lib:vidguard-extractor'))
|
||||
}
|
BIN
src/es/estrenosdoramas/res/mipmap-hdpi/ic_launcher.png
Normal file
BIN
src/es/estrenosdoramas/res/mipmap-hdpi/ic_launcher.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.2 KiB |
BIN
src/es/estrenosdoramas/res/mipmap-mdpi/ic_launcher.png
Normal file
BIN
src/es/estrenosdoramas/res/mipmap-mdpi/ic_launcher.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.6 KiB |
BIN
src/es/estrenosdoramas/res/mipmap-xhdpi/ic_launcher.png
Normal file
BIN
src/es/estrenosdoramas/res/mipmap-xhdpi/ic_launcher.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.8 KiB |
BIN
src/es/estrenosdoramas/res/mipmap-xxhdpi/ic_launcher.png
Normal file
BIN
src/es/estrenosdoramas/res/mipmap-xxhdpi/ic_launcher.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.5 KiB |
BIN
src/es/estrenosdoramas/res/mipmap-xxxhdpi/ic_launcher.png
Normal file
BIN
src/es/estrenosdoramas/res/mipmap-xxxhdpi/ic_launcher.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 16 KiB |
|
@ -0,0 +1,220 @@
|
|||
package eu.kanade.tachiyomi.animeextension.es.estrenosdoramas
|
||||
|
||||
import android.app.Application
|
||||
import android.content.SharedPreferences
|
||||
import androidx.preference.ListPreference
|
||||
import androidx.preference.PreferenceScreen
|
||||
import eu.kanade.tachiyomi.animesource.ConfigurableAnimeSource
|
||||
import eu.kanade.tachiyomi.animesource.model.AnimeFilterList
|
||||
import eu.kanade.tachiyomi.animesource.model.AnimesPage
|
||||
import eu.kanade.tachiyomi.animesource.model.SAnime
|
||||
import eu.kanade.tachiyomi.animesource.model.SEpisode
|
||||
import eu.kanade.tachiyomi.animesource.model.Video
|
||||
import eu.kanade.tachiyomi.animesource.online.AnimeHttpSource
|
||||
import eu.kanade.tachiyomi.lib.okruextractor.OkruExtractor
|
||||
import eu.kanade.tachiyomi.lib.streamhidevidextractor.StreamHideVidExtractor
|
||||
import eu.kanade.tachiyomi.lib.streamwishextractor.StreamWishExtractor
|
||||
import eu.kanade.tachiyomi.lib.vidguardextractor.VidGuardExtractor
|
||||
import eu.kanade.tachiyomi.lib.voeextractor.VoeExtractor
|
||||
import eu.kanade.tachiyomi.lib.youruploadextractor.YourUploadExtractor
|
||||
import eu.kanade.tachiyomi.network.GET
|
||||
import eu.kanade.tachiyomi.util.asJsoup
|
||||
import eu.kanade.tachiyomi.util.parallelCatchingFlatMapBlocking
|
||||
import okhttp3.Request
|
||||
import okhttp3.Response
|
||||
import uy.kohesive.injekt.Injekt
|
||||
import uy.kohesive.injekt.api.get
|
||||
|
||||
class EstrenosDoramas : ConfigurableAnimeSource, AnimeHttpSource() {
|
||||
|
||||
override val name = "EstrenosDoramas"
|
||||
|
||||
override val baseUrl = "https://estrenosdoramas.es"
|
||||
|
||||
override val lang = "es"
|
||||
|
||||
override val supportsLatest = true
|
||||
|
||||
private val preferences: SharedPreferences by lazy {
|
||||
Injekt.get<Application>().getSharedPreferences("source_$id", 0x0000)
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val PREF_QUALITY_KEY = "preferred_quality"
|
||||
private const val PREF_QUALITY_DEFAULT = "1080"
|
||||
private val QUALITY_LIST = arrayOf("1080", "720", "480", "360")
|
||||
|
||||
private const val PREF_SERVER_KEY = "preferred_server"
|
||||
private const val PREF_SERVER_DEFAULT = "Voe"
|
||||
private val SERVER_LIST = arrayOf(
|
||||
"StreamWish",
|
||||
"Voe",
|
||||
"Okru",
|
||||
"YourUpload",
|
||||
"FileLions",
|
||||
"StreamHideVid",
|
||||
"VidGuard",
|
||||
)
|
||||
}
|
||||
|
||||
override fun animeDetailsParse(response: Response): SAnime {
|
||||
val document = response.asJsoup()
|
||||
return SAnime.create().apply {
|
||||
title = document.selectFirst(".entry-title")?.text()?.trim() ?: ""
|
||||
description = document.selectFirst(".mindesc")?.text()?.trim()
|
||||
genre = document.select(".genxed a").joinToString { it.text() }
|
||||
thumbnail_url = document.selectFirst(".thumb img")?.attr("abs:src")
|
||||
document.select(".spe > span").map {
|
||||
val title = it.select("b").text()
|
||||
when {
|
||||
title.contains("Estado") -> status = it.ownText().getStatus()
|
||||
title.contains("Casts") -> artist = it.select("a").joinToString { it.text() }
|
||||
title.contains("Network") -> author = it.select("a").joinToString { it.text() }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun popularAnimeRequest(page: Int) = GET("$baseUrl/temporadas/?page=$page&order=popular", headers)
|
||||
|
||||
override fun popularAnimeParse(response: Response): AnimesPage {
|
||||
val document = response.asJsoup()
|
||||
val elements = document.select(".listupd article a")
|
||||
val nextPage = document.select(".hpage .r, .pagination .next").any()
|
||||
val animeList = elements.map { element ->
|
||||
SAnime.create().apply {
|
||||
setUrlWithoutDomain(element.attr("abs:href"))
|
||||
title = element.attr("title")
|
||||
thumbnail_url = element.selectFirst("img")!!.attr("abs:src")
|
||||
}
|
||||
}
|
||||
return AnimesPage(animeList, nextPage)
|
||||
}
|
||||
|
||||
override fun latestUpdatesParse(response: Response) = popularAnimeParse(response)
|
||||
|
||||
override fun latestUpdatesRequest(page: Int) = GET("$baseUrl/temporadas/?page=$page&order=latest", headers)
|
||||
|
||||
override fun searchAnimeRequest(page: Int, query: String, filters: AnimeFilterList): Request {
|
||||
val params = EstrenosDoramasFilters.getSearchParameters(filters)
|
||||
return when {
|
||||
query.isNotBlank() -> GET("$baseUrl/page/$page/?s=$query", headers)
|
||||
params.filter.isNotBlank() -> GET("$baseUrl/temporadas/${params.getQuery()}&page=$page", headers)
|
||||
else -> popularAnimeRequest(page)
|
||||
}
|
||||
}
|
||||
|
||||
override fun searchAnimeParse(response: Response) = popularAnimeParse(response)
|
||||
|
||||
override fun episodeListParse(response: Response): List<SEpisode> {
|
||||
val document = response.asJsoup()
|
||||
return document.select("#myList li a").mapIndexed { idx, it ->
|
||||
val title = it.select(".epl-title").text().trim()
|
||||
val epNumber = try {
|
||||
"""(\d+(\.\d+)?)""".toRegex().find(title)?.groupValues?.get(1)?.toFloat() ?: (idx + 1f)
|
||||
} catch (_: Exception) { idx + 1f }
|
||||
|
||||
SEpisode.create().apply {
|
||||
episode_number = epNumber
|
||||
name = title
|
||||
scanlator = it.select(".epl-sub span").joinToString { it.text() }
|
||||
setUrlWithoutDomain(it.attr("abs:href"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun videoListParse(response: Response): List<Video> {
|
||||
val document = response.asJsoup()
|
||||
return document.select("[data-embed]").parallelCatchingFlatMapBlocking {
|
||||
val link = it.attr("data-embed")
|
||||
val realLink = fetchUrls(client.newCall(GET(link)).execute().networkResponse.toString()).firstOrNull()
|
||||
serverVideoResolver(realLink?.ifEmpty { link } ?: "")
|
||||
}
|
||||
}
|
||||
|
||||
/*--------------------------------Video extractors------------------------------------*/
|
||||
private val okruExtractor by lazy { OkruExtractor(client) }
|
||||
private val streamWishExtractor by lazy { StreamWishExtractor(client, headers) }
|
||||
private val streamHideVidExtractor by lazy { StreamHideVidExtractor(client) }
|
||||
private val voeExtractor by lazy { VoeExtractor(client) }
|
||||
private val yourUploadExtractor by lazy { YourUploadExtractor(client) }
|
||||
private val vidGuardExtractor by lazy { VidGuardExtractor(client) }
|
||||
|
||||
private fun serverVideoResolver(url: String): List<Video> {
|
||||
return when {
|
||||
arrayOf("ok.ru", "okru").any(url) -> okruExtractor.videosFromUrl(url)
|
||||
arrayOf("filelions", "lion", "fviplions").any(url) -> streamWishExtractor.videosFromUrl(url, videoNameGen = { "FileLions:$it" })
|
||||
arrayOf("wishembed", "streamwish", "strwish", "wish").any(url) -> streamWishExtractor.videosFromUrl(url, videoNameGen = { "StreamWish:$it" })
|
||||
arrayOf("vidhide", "streamhide", "guccihide", "streamvid").any(url) -> streamHideVidExtractor.videosFromUrl(url)
|
||||
arrayOf("voe", "robertordercharacter", "donaldlineelse").any(url) -> voeExtractor.videosFromUrl(url)
|
||||
arrayOf("yourupload", "upload").any(url) -> yourUploadExtractor.videoFromUrl(url, headers = headers)
|
||||
arrayOf("vembed", "guard", "listeamed", "bembed", "vgfplay").any(url) -> vidGuardExtractor.videosFromUrl(url)
|
||||
else -> emptyList()
|
||||
}
|
||||
}
|
||||
|
||||
override fun List<Video>.sort(): List<Video> {
|
||||
val quality = preferences.getString(PREF_QUALITY_KEY, PREF_QUALITY_DEFAULT)!!
|
||||
val server = preferences.getString(PREF_SERVER_KEY, PREF_SERVER_DEFAULT)!!
|
||||
return this.sortedWith(
|
||||
compareBy(
|
||||
{ it.quality.contains(server, true) },
|
||||
{ it.quality.contains(quality) },
|
||||
{ Regex("""(\d+)p""").find(it.quality)?.groupValues?.get(1)?.toIntOrNull() ?: 0 },
|
||||
),
|
||||
).reversed()
|
||||
}
|
||||
|
||||
override fun getFilterList(): AnimeFilterList = EstrenosDoramasFilters.FILTER_LIST
|
||||
|
||||
private fun Array<String>.any(url: String): Boolean = this.any { url.contains(it, ignoreCase = true) }
|
||||
|
||||
private fun String.getStatus(): Int {
|
||||
val status = this.trim()
|
||||
return when {
|
||||
status.contains("Ongoing") -> SAnime.ONGOING
|
||||
status.contains("Completed") -> SAnime.COMPLETED
|
||||
else -> SAnime.UNKNOWN
|
||||
}
|
||||
}
|
||||
|
||||
private fun fetchUrls(text: String?): List<String> {
|
||||
if (text.isNullOrEmpty()) return listOf()
|
||||
val linkRegex = "(http|ftp|https):\\/\\/([\\w_-]+(?:(?:\\.[\\w_-]+)+))([\\w.,@?^=%&:\\/~+#-]*[\\w@?^=%&\\/~+#-])".toRegex()
|
||||
return linkRegex.findAll(text).map { it.value.trim().removeSurrounding("\"") }.toList()
|
||||
}
|
||||
|
||||
override fun setupPreferenceScreen(screen: PreferenceScreen) {
|
||||
ListPreference(screen.context).apply {
|
||||
key = PREF_SERVER_KEY
|
||||
title = "Preferred server"
|
||||
entries = SERVER_LIST
|
||||
entryValues = SERVER_LIST
|
||||
setDefaultValue(PREF_SERVER_DEFAULT)
|
||||
summary = "%s"
|
||||
|
||||
setOnPreferenceChangeListener { _, newValue ->
|
||||
val selected = newValue as String
|
||||
val index = findIndexOfValue(selected)
|
||||
val entry = entryValues[index] as String
|
||||
preferences.edit().putString(key, entry).commit()
|
||||
}
|
||||
}.also(screen::addPreference)
|
||||
|
||||
ListPreference(screen.context).apply {
|
||||
key = PREF_QUALITY_KEY
|
||||
title = "Preferred quality"
|
||||
entries = QUALITY_LIST
|
||||
entryValues = QUALITY_LIST
|
||||
setDefaultValue(PREF_QUALITY_DEFAULT)
|
||||
summary = "%s"
|
||||
|
||||
setOnPreferenceChangeListener { _, newValue ->
|
||||
val selected = newValue as String
|
||||
val index = findIndexOfValue(selected)
|
||||
val entry = entryValues[index] as String
|
||||
preferences.edit().putString(key, entry).commit()
|
||||
}
|
||||
}.also(screen::addPreference)
|
||||
}
|
||||
}
|
|
@ -0,0 +1,237 @@
|
|||
package eu.kanade.tachiyomi.animeextension.es.estrenosdoramas
|
||||
|
||||
import eu.kanade.tachiyomi.animesource.model.AnimeFilter
|
||||
import eu.kanade.tachiyomi.animesource.model.AnimeFilterList
|
||||
|
||||
object EstrenosDoramasFilters {
|
||||
open class QueryPartFilter(displayName: String, val vals: Array<Pair<String, String>>) : AnimeFilter.Select<String>(
|
||||
displayName,
|
||||
vals.map { it.first }.toTypedArray(),
|
||||
) {
|
||||
fun toQueryPart(name: String) = vals[state].second.takeIf { it.isNotEmpty() }?.let { "&$name=${vals[state].second}" } ?: run { "" }
|
||||
}
|
||||
|
||||
open class CheckBoxFilterList(name: String, values: List<CheckBox>) : AnimeFilter.Group<AnimeFilter.CheckBox>(name, values)
|
||||
|
||||
private class CheckBoxVal(name: String, state: Boolean = false) : AnimeFilter.CheckBox(name, state)
|
||||
|
||||
private inline fun <reified R> AnimeFilterList.parseCheckbox(
|
||||
options: Array<Pair<String, String>>,
|
||||
name: String,
|
||||
): String {
|
||||
return (this.getFirst<R>() as CheckBoxFilterList).state
|
||||
.mapNotNull { checkbox ->
|
||||
if (checkbox.state) {
|
||||
options.find { it.first == checkbox.name }!!.second
|
||||
} else {
|
||||
null
|
||||
}
|
||||
}.joinToString("&$name[]=").let {
|
||||
if (it.isBlank()) {
|
||||
""
|
||||
} else {
|
||||
"&$name[]=$it"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private inline fun <reified R> AnimeFilterList.asQueryPart(name: String): String {
|
||||
return (this.getFirst<R>() as QueryPartFilter).toQueryPart(name)
|
||||
}
|
||||
|
||||
private inline fun <reified R> AnimeFilterList.getFirst(): R {
|
||||
return this.filterIsInstance<R>().first()
|
||||
}
|
||||
|
||||
private fun String.changePrefix() = this.takeIf { it.startsWith("&") }?.let { this.replaceFirst("&", "?") } ?: run { this }
|
||||
|
||||
data class FilterSearchParams(val filter: String = "") { fun getQuery() = filter.changePrefix() }
|
||||
|
||||
internal fun getSearchParameters(filters: AnimeFilterList): FilterSearchParams {
|
||||
if (filters.isEmpty()) return FilterSearchParams()
|
||||
return FilterSearchParams(
|
||||
filters.parseCheckbox<GenresFilter>(EstrenosDoramasFiltersData.GENRES, "genre") +
|
||||
filters.parseCheckbox<SeasonsFilter>(EstrenosDoramasFiltersData.SEASONS, "season") +
|
||||
filters.parseCheckbox<StudiosFilter>(EstrenosDoramasFiltersData.STUDIOS, "studio") +
|
||||
filters.parseCheckbox<CountriesFilter>(EstrenosDoramasFiltersData.COUNTRIES, "country") +
|
||||
filters.parseCheckbox<NetworksFilter>(EstrenosDoramasFiltersData.NETWORKS, "network") +
|
||||
filters.asQueryPart<StatusFilter>("status") +
|
||||
filters.asQueryPart<TypesFilter>("type") +
|
||||
filters.asQueryPart<SortFilter>("order"),
|
||||
)
|
||||
}
|
||||
|
||||
val FILTER_LIST get() = AnimeFilterList(
|
||||
AnimeFilter.Header("La busqueda por texto ignora el filtro"),
|
||||
GenresFilter(),
|
||||
SeasonsFilter(),
|
||||
StudiosFilter(),
|
||||
CountriesFilter(),
|
||||
NetworksFilter(),
|
||||
StatusFilter(),
|
||||
TypesFilter(),
|
||||
SortFilter(),
|
||||
)
|
||||
|
||||
class GenresFilter : CheckBoxFilterList("Géneros", EstrenosDoramasFiltersData.GENRES.map { CheckBoxVal(it.first, false) })
|
||||
class SeasonsFilter : CheckBoxFilterList("Temporadas", EstrenosDoramasFiltersData.SEASONS.map { CheckBoxVal(it.first, false) })
|
||||
class StudiosFilter : CheckBoxFilterList("Estudio", EstrenosDoramasFiltersData.STUDIOS.map { CheckBoxVal(it.first, false) })
|
||||
class CountriesFilter : CheckBoxFilterList("País", EstrenosDoramasFiltersData.COUNTRIES.map { CheckBoxVal(it.first, false) })
|
||||
class NetworksFilter : CheckBoxFilterList("Networks", EstrenosDoramasFiltersData.NETWORKS.map { CheckBoxVal(it.first, false) })
|
||||
class StatusFilter : QueryPartFilter("Estatus", EstrenosDoramasFiltersData.STATUS)
|
||||
class TypesFilter : QueryPartFilter("Tipo", EstrenosDoramasFiltersData.TYPES)
|
||||
class SortFilter : QueryPartFilter("Orden", EstrenosDoramasFiltersData.SORT)
|
||||
|
||||
private object EstrenosDoramasFiltersData {
|
||||
val GENRES = arrayOf(
|
||||
Pair("Action", "action"),
|
||||
Pair("Adult Cast", "adult-cast"),
|
||||
Pair("Adventure", "adventure"),
|
||||
Pair("Business", "business"),
|
||||
Pair("Comedy", "comedy"),
|
||||
Pair("Crime", "crime"),
|
||||
Pair("Documentary", "documentary"),
|
||||
Pair("Drama", "drama"),
|
||||
Pair("Ecchi", "ecchi"),
|
||||
Pair("Family", "family"),
|
||||
Pair("Fantasy", "fantasy"),
|
||||
Pair("Food", "food"),
|
||||
Pair("Gourmet", "gourmet"),
|
||||
Pair("Harem", "harem"),
|
||||
Pair("Historical", "historical"),
|
||||
Pair("Horror", "horror"),
|
||||
Pair("Isekai", "isekai"),
|
||||
Pair("Law", "law"),
|
||||
Pair("Life", "life"),
|
||||
Pair("Martial Arts", "martial-arts"),
|
||||
Pair("Mature", "mature"),
|
||||
Pair("Medical", "medical"),
|
||||
Pair("Melodrama", "melodrama"),
|
||||
Pair("Military", "military"),
|
||||
Pair("Music", "music"),
|
||||
Pair("Mystery", "mystery"),
|
||||
Pair("Mythology", "mythology"),
|
||||
Pair("Political", "political"),
|
||||
Pair("Psychological", "psychological"),
|
||||
Pair("Reincarnation", "reincarnation"),
|
||||
Pair("Romance", "romance"),
|
||||
Pair("Sci-Fi", "sci-fi"),
|
||||
Pair("Seinen", "seinen"),
|
||||
Pair("Shoujo", "shoujo"),
|
||||
Pair("Shounen", "shounen"),
|
||||
Pair("Sitcom", "sitcom"),
|
||||
Pair("Sports", "sports"),
|
||||
Pair("Supernatural", "supernatural"),
|
||||
Pair("Thriller", "thriller"),
|
||||
Pair("War", "war"),
|
||||
Pair("Workplace", "workplace"),
|
||||
Pair("Wuxia", "wuxia"),
|
||||
Pair("Youth", "youth"),
|
||||
)
|
||||
|
||||
val SEASONS = arrayOf(
|
||||
Pair("Winter 2024", "winter-2024"),
|
||||
)
|
||||
|
||||
val STUDIOS = arrayOf(
|
||||
Pair("Connect", "connect"),
|
||||
Pair("Drive", "drive"),
|
||||
Pair("HORNETS", "hornets"),
|
||||
Pair("Okuruto Noboru", "okuruto-noboru"),
|
||||
Pair("Seven Arcs", "seven-arcs"),
|
||||
Pair("Shin-Ei Animation", "shin-ei-animation"),
|
||||
Pair("SILVER LINK.", "silver-link"),
|
||||
Pair("Studio Add", "studio-add"),
|
||||
Pair("Studio Flad", "studio-flad"),
|
||||
Pair("Studio Kai", "studio-kai"),
|
||||
Pair("Studio PuYUKAI", "studio-puyukai"),
|
||||
Pair("SynergySP", "synergysp"),
|
||||
Pair("Trigger", "trigger"),
|
||||
)
|
||||
|
||||
val COUNTRIES = arrayOf(
|
||||
Pair("China", "china"),
|
||||
Pair("Japan", "japan"),
|
||||
Pair("South Korea", "south-korea"),
|
||||
Pair("Taiwan", "taiwan"),
|
||||
Pair("Thailand", "thailand"),
|
||||
)
|
||||
|
||||
val NETWORKS = arrayOf(
|
||||
Pair("Amazon Prime", "amazon-prime"),
|
||||
Pair("BS Asahi", "bs-asahi"),
|
||||
Pair("CCTV", "cctv"),
|
||||
Pair("Channel 3", "channel-3"),
|
||||
Pair("Channel 9", "channel-9"),
|
||||
Pair("Channel A", "channel-a"),
|
||||
Pair("COUPANG TV", "coupang-tv"),
|
||||
Pair("Disney+", "disney"),
|
||||
Pair("ENA", "ena"),
|
||||
Pair("Fuji TV", "fuji-tv"),
|
||||
Pair("Genie TV", "genie-tv"),
|
||||
Pair("GMM 25", "gmm-25"),
|
||||
Pair("GMM One", "gmm-one"),
|
||||
Pair("GTV", "gtv"),
|
||||
Pair("Hulu", "hulu"),
|
||||
Pair("Hunan TV", "hunan-tv"),
|
||||
Pair("iQiyi", "iqiyi"),
|
||||
Pair("JSTV", "jstv"),
|
||||
Pair("jTBC", "jtbc"),
|
||||
Pair("KBS2", "kbs2"),
|
||||
Pair("Mango TV", "mango-tv"),
|
||||
Pair("MBC", "mbc"),
|
||||
Pair("MBN", "mbn"),
|
||||
Pair("MBS", "mbs"),
|
||||
Pair("Mnet", "mnet"),
|
||||
Pair("Naver TV Cast", "naver-tv-cast"),
|
||||
Pair("Netflix", "netflix"),
|
||||
Pair("One 31", "one-31"),
|
||||
Pair("oneD", "oned"),
|
||||
Pair("SBS", "sbs"),
|
||||
Pair("SBS Plus", "sbs-plus"),
|
||||
Pair("SET TV", "set-tv"),
|
||||
Pair("Sohu TV", "sohu-tv"),
|
||||
Pair("TBS", "tbs"),
|
||||
Pair("Telasa", "telasa"),
|
||||
Pair("Tencent Video", "tencent-video"),
|
||||
Pair("Tokyo MX", "tokyo-mx"),
|
||||
Pair("TV Chosun", "tv-chosun"),
|
||||
Pair("TV Tokyo", "tv-tokyo"),
|
||||
Pair("TVING", "tving"),
|
||||
Pair("TVK", "tvk"),
|
||||
Pair("tvN", "tvn"),
|
||||
Pair("Viki", "viki"),
|
||||
Pair("ViuTV", "viutv"),
|
||||
Pair("vLive", "vlive"),
|
||||
Pair("Wavve", "wavve"),
|
||||
Pair("WeTV", "wetv"),
|
||||
Pair("Workpoint TV", "workpoint-tv"),
|
||||
Pair("Youku", "youku"),
|
||||
Pair("ZJTV", "zjtv"),
|
||||
)
|
||||
|
||||
val STATUS = arrayOf(
|
||||
Pair("All", ""),
|
||||
Pair("Ongoing", "Ongoing"),
|
||||
Pair("Completed", "Completed"),
|
||||
)
|
||||
|
||||
val TYPES = arrayOf(
|
||||
Pair("All", ""),
|
||||
Pair("Dorama", "Drama"),
|
||||
Pair("TV Show", "TV Show"),
|
||||
Pair("Anime", "Anime"),
|
||||
Pair("Película", "Movie"),
|
||||
Pair("Special", "Special"),
|
||||
)
|
||||
|
||||
val SORT = arrayOf(
|
||||
Pair("Latest Update", "update"),
|
||||
Pair("A-Z", "title"),
|
||||
Pair("Z-A", "titlereverse"),
|
||||
Pair("Latest Added", "latest"),
|
||||
Pair("Popular", "popular"),
|
||||
Pair("Rating", "rating"),
|
||||
)
|
||||
}
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
ext {
|
||||
extName = 'HentaiLA'
|
||||
extClass = '.Hentaila'
|
||||
extVersionCode = 27
|
||||
extVersionCode = 28
|
||||
isNsfw = true
|
||||
}
|
||||
|
||||
|
@ -14,4 +14,5 @@ dependencies {
|
|||
implementation(project(':lib:voe-extractor'))
|
||||
implementation(project(':lib:yourupload-extractor'))
|
||||
implementation(project(':lib:streamhidevid-extractor'))
|
||||
implementation(project(':lib:sendvid-extractor'))
|
||||
}
|
|
@ -14,6 +14,7 @@ import eu.kanade.tachiyomi.animesource.model.Video
|
|||
import eu.kanade.tachiyomi.animesource.online.AnimeHttpSource
|
||||
import eu.kanade.tachiyomi.lib.burstcloudextractor.BurstCloudExtractor
|
||||
import eu.kanade.tachiyomi.lib.mp4uploadextractor.Mp4uploadExtractor
|
||||
import eu.kanade.tachiyomi.lib.sendvidextractor.SendvidExtractor
|
||||
import eu.kanade.tachiyomi.lib.streamhidevidextractor.StreamHideVidExtractor
|
||||
import eu.kanade.tachiyomi.lib.streamwishextractor.StreamWishExtractor
|
||||
import eu.kanade.tachiyomi.lib.voeextractor.VoeExtractor
|
||||
|
@ -30,7 +31,6 @@ import okhttp3.Response
|
|||
import uy.kohesive.injekt.Injekt
|
||||
import uy.kohesive.injekt.api.get
|
||||
import uy.kohesive.injekt.injectLazy
|
||||
import java.io.IOException
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.Locale
|
||||
|
||||
|
@ -65,6 +65,7 @@ class Hentaila : ConfigurableAnimeSource, AnimeHttpSource() {
|
|||
"Mp4Upload",
|
||||
"BurstCloud",
|
||||
"StreamHideVid",
|
||||
"Sendvid",
|
||||
)
|
||||
|
||||
private val DATE_FORMATTER by lazy {
|
||||
|
@ -94,45 +95,27 @@ class Hentaila : ConfigurableAnimeSource, AnimeHttpSource() {
|
|||
|
||||
override fun searchAnimeRequest(page: Int, query: String, filters: AnimeFilterList): Request {
|
||||
val filterList = if (filters.isEmpty()) getFilterList() else filters
|
||||
val genreFilter = filterList.find { it is GenreFilter } as GenreFilter
|
||||
val genreFilter = filterList.filterIsInstance<GenreFilter>().firstOrNull()
|
||||
|
||||
if (query.isNotEmpty()) {
|
||||
if (query.length < 2) throw IOException("La búsqueda debe tener al menos 2 caracteres")
|
||||
require(query.length >= 2) { "La búsqueda debe tener al menos 2 caracteres" }
|
||||
return POST("$baseUrl/api/search", headers, FormBody.Builder().add("value", query).build())
|
||||
}
|
||||
|
||||
var url = "$baseUrl/directorio?p=$page".toHttpUrl().newBuilder()
|
||||
|
||||
if (genreFilter.state != 0) {
|
||||
url = "$baseUrl/genero/${genreFilter.toUriPart()}?p=$page".toHttpUrl().newBuilder()
|
||||
}
|
||||
val urlBuilder = "$baseUrl/${if (genreFilter?.state != 0) "genero/${genreFilter?.toUriPart()}" else "directorio?p=$page"}"
|
||||
.toHttpUrl().newBuilder()
|
||||
|
||||
filterList.forEach { filter ->
|
||||
when (filter) {
|
||||
is OrderFilter -> {
|
||||
url.addQueryParameter("filter", filter.toUriPart())
|
||||
}
|
||||
is StatusOngoingFilter -> {
|
||||
if (filter.state) {
|
||||
url.addQueryParameter("status[1]", "on")
|
||||
}
|
||||
}
|
||||
is StatusCompletedFilter -> {
|
||||
if (filter.state) {
|
||||
url.addQueryParameter("status[2]", "on")
|
||||
}
|
||||
}
|
||||
is UncensoredFilter -> {
|
||||
if (filter.state) {
|
||||
url.addQueryParameter("uncensored", "on")
|
||||
}
|
||||
}
|
||||
|
||||
is OrderFilter -> urlBuilder.addQueryParameter("filter", filter.toUriPart())
|
||||
is StatusOngoingFilter -> if (filter.state) urlBuilder.addQueryParameter("status[1]", "on")
|
||||
is StatusCompletedFilter -> if (filter.state) urlBuilder.addQueryParameter("status[2]", "on")
|
||||
is UncensoredFilter -> if (filter.state) urlBuilder.addQueryParameter("uncensored", "on")
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
|
||||
return GET(url.build().toString(), headers)
|
||||
return GET(urlBuilder.build().toString(), headers)
|
||||
}
|
||||
|
||||
override fun searchAnimeParse(response: Response): AnimesPage {
|
||||
|
@ -150,7 +133,7 @@ class Hentaila : ConfigurableAnimeSource, AnimeHttpSource() {
|
|||
}
|
||||
|
||||
val document = response.asJsoup()
|
||||
val animes = document.select("div.columns main section.section div.grid.hentais article.hentai").map {
|
||||
val animeList = document.select("div.columns main section.section div.grid.hentais article.hentai").map {
|
||||
SAnime.create().apply {
|
||||
title = it.select("header.h-header h2").text()
|
||||
setUrlWithoutDomain(it.select("a").attr("abs:href"))
|
||||
|
@ -160,7 +143,7 @@ class Hentaila : ConfigurableAnimeSource, AnimeHttpSource() {
|
|||
|
||||
val hasNextPage = document.select("a.btn.rnd.npd.fa-arrow-right").any()
|
||||
|
||||
return AnimesPage(animes, hasNextPage)
|
||||
return AnimesPage(animeList, hasNextPage)
|
||||
}
|
||||
|
||||
override fun animeDetailsParse(response: Response): SAnime {
|
||||
|
@ -206,6 +189,7 @@ class Hentaila : ConfigurableAnimeSource, AnimeHttpSource() {
|
|||
private val mp4uploadExtractor by lazy { Mp4uploadExtractor(client) }
|
||||
private val burstCloudExtractor by lazy { BurstCloudExtractor(client) }
|
||||
private val streamHideVidExtractor by lazy { StreamHideVidExtractor(client) }
|
||||
private val sendvidExtractor by lazy { SendvidExtractor(client, headers) }
|
||||
|
||||
override fun videoListParse(response: Response): List<Video> {
|
||||
val document = response.asJsoup()
|
||||
|
@ -227,6 +211,7 @@ class Hentaila : ConfigurableAnimeSource, AnimeHttpSource() {
|
|||
"mp4upload" -> mp4uploadExtractor.videosFromUrl(urlServer, headers = headers)
|
||||
"burst" -> burstCloudExtractor.videoFromUrl(urlServer, headers = headers)
|
||||
"vidhide", "streamhide", "guccihide", "streamvid" -> streamHideVidExtractor.videosFromUrl(urlServer)
|
||||
"sendvid" -> sendvidExtractor.videosFromUrl(urlServer)
|
||||
else -> emptyList()
|
||||
}
|
||||
}
|
||||
|
@ -279,20 +264,20 @@ class Hentaila : ConfigurableAnimeSource, AnimeHttpSource() {
|
|||
Pair("Casadas", "casadas"),
|
||||
Pair("Chikan", "chikan"),
|
||||
Pair("Ecchi", "ecchi"),
|
||||
Pair("Escolares", "escolares"),
|
||||
Pair("Enfermeras", "enfermeras"),
|
||||
Pair("Escolares", "escolares"),
|
||||
Pair("Futanari", "futanari"),
|
||||
Pair("Harem", "Harem"),
|
||||
Pair("Gore", "gore"),
|
||||
Pair("Hardcore", "hardcore"),
|
||||
Pair("Harem", "harem"),
|
||||
Pair("Incesto", "incesto"),
|
||||
Pair("Juegos Sexuales", "juegos-sexuales"),
|
||||
Pair("Maids", "maids"),
|
||||
Pair("Milfs", "milfs"),
|
||||
Pair("Maids", "maids"),
|
||||
Pair("Netorare", "netorare"),
|
||||
Pair("Ninfomania", "ninfomania"),
|
||||
Pair("Ninjas", "ninjas"),
|
||||
Pair("Orgia", "orgia"),
|
||||
Pair("Orgias", "orgias"),
|
||||
Pair("Romance", "romance"),
|
||||
Pair("Shota", "shota"),
|
||||
Pair("Softcore", "softcore"),
|
||||
|
@ -303,9 +288,15 @@ class Hentaila : ConfigurableAnimeSource, AnimeHttpSource() {
|
|||
Pair("Vanilla", "vanilla"),
|
||||
Pair("Violacion", "violacion"),
|
||||
Pair("Virgenes", "virgenes"),
|
||||
Pair("Yaoi", "Yaoi"),
|
||||
Pair("Yaoi", "yaoi"),
|
||||
Pair("Yuri", "yuri"),
|
||||
Pair("Bondage", "bondage"),
|
||||
Pair("Elfas", "elfas"),
|
||||
Pair("Petit", "petit"),
|
||||
Pair("Threesome", "threesome"),
|
||||
Pair("Paizuri", "paizuri"),
|
||||
Pair("Gal", "gal"),
|
||||
Pair("Oyakodon", "oyakodon"),
|
||||
),
|
||||
)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue