fix(es/hentaila): Update domain and add servers (#2179)
This commit is contained in:
@ -6,7 +6,7 @@ ext {
|
|||||||
extName = 'Hentaila'
|
extName = 'Hentaila'
|
||||||
pkgNameSuffix = 'es.hentaila'
|
pkgNameSuffix = 'es.hentaila'
|
||||||
extClass = '.Hentaila'
|
extClass = '.Hentaila'
|
||||||
extVersionCode = 15
|
extVersionCode = 16
|
||||||
libVersion = '13'
|
libVersion = '13'
|
||||||
containsNsfw = true
|
containsNsfw = true
|
||||||
}
|
}
|
||||||
@ -14,6 +14,8 @@ ext {
|
|||||||
dependencies {
|
dependencies {
|
||||||
implementation(project(':lib-burstcloud-extractor'))
|
implementation(project(':lib-burstcloud-extractor'))
|
||||||
implementation(project(':lib-mp4upload-extractor'))
|
implementation(project(':lib-mp4upload-extractor'))
|
||||||
|
implementation(project(':lib-streamwish-extractor'))
|
||||||
|
implementation(project(':lib-voe-extractor'))
|
||||||
implementation(project(':lib-yourupload-extractor'))
|
implementation(project(':lib-yourupload-extractor'))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,6 +14,8 @@ import eu.kanade.tachiyomi.animesource.model.Video
|
|||||||
import eu.kanade.tachiyomi.animesource.online.AnimeHttpSource
|
import eu.kanade.tachiyomi.animesource.online.AnimeHttpSource
|
||||||
import eu.kanade.tachiyomi.lib.burstcloudextractor.BurstCloudExtractor
|
import eu.kanade.tachiyomi.lib.burstcloudextractor.BurstCloudExtractor
|
||||||
import eu.kanade.tachiyomi.lib.mp4uploadextractor.Mp4uploadExtractor
|
import eu.kanade.tachiyomi.lib.mp4uploadextractor.Mp4uploadExtractor
|
||||||
|
import eu.kanade.tachiyomi.lib.streamwishextractor.StreamWishExtractor
|
||||||
|
import eu.kanade.tachiyomi.lib.voeextractor.VoeExtractor
|
||||||
import eu.kanade.tachiyomi.lib.youruploadextractor.YourUploadExtractor
|
import eu.kanade.tachiyomi.lib.youruploadextractor.YourUploadExtractor
|
||||||
import eu.kanade.tachiyomi.network.GET
|
import eu.kanade.tachiyomi.network.GET
|
||||||
import eu.kanade.tachiyomi.network.POST
|
import eu.kanade.tachiyomi.network.POST
|
||||||
@ -34,7 +36,7 @@ class Hentaila : ConfigurableAnimeSource, AnimeHttpSource() {
|
|||||||
|
|
||||||
override val name = "Hentaila"
|
override val name = "Hentaila"
|
||||||
|
|
||||||
override val baseUrl = "https://www3.hentaila.com"
|
override val baseUrl = "https://www4.hentaila.com"
|
||||||
|
|
||||||
override val lang = "es"
|
override val lang = "es"
|
||||||
|
|
||||||
@ -144,7 +146,7 @@ class Hentaila : ConfigurableAnimeSource, AnimeHttpSource() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val hasNextPage = document.select("a.btn.rnd.npd.fa-arrow-right").isNullOrEmpty().not()
|
val hasNextPage = document.select("a.btn.rnd.npd.fa-arrow-right").isEmpty().not()
|
||||||
|
|
||||||
return AnimesPage(animes, hasNextPage)
|
return AnimesPage(animes, hasNextPage)
|
||||||
}
|
}
|
||||||
@ -195,21 +197,27 @@ class Hentaila : ConfigurableAnimeSource, AnimeHttpSource() {
|
|||||||
val urlServer = server[1].replace("\\/", "/")
|
val urlServer = server[1].replace("\\/", "/")
|
||||||
val nameServer = server[0]
|
val nameServer = server[0]
|
||||||
|
|
||||||
if (nameServer.lowercase() == "arc") {
|
when (nameServer.lowercase()) {
|
||||||
val videoUrl = urlServer.substringAfter("#")
|
"streamwish" -> {
|
||||||
videoList.add(Video(videoUrl, "Arc", videoUrl))
|
videoList.addAll(StreamWishExtractor(client, headers).videosFromUrl(urlServer, "StreamWish "))
|
||||||
}
|
}
|
||||||
|
"voe" -> {
|
||||||
if (nameServer.lowercase() == "yupi") {
|
val video = VoeExtractor(client).videoFromUrl(urlServer)
|
||||||
videoList.addAll(YourUploadExtractor(client).videoFromUrl(urlServer, headers = headers))
|
if (video != null) videoList.add(video)
|
||||||
}
|
}
|
||||||
|
"arc" -> {
|
||||||
if (nameServer.lowercase() == "mp4upload") {
|
val videoUrl = urlServer.substringAfter("#")
|
||||||
videoList.addAll(Mp4uploadExtractor(client).videosFromUrl(urlServer, headers = headers))
|
videoList.add(Video(videoUrl, "Arc", videoUrl))
|
||||||
}
|
}
|
||||||
|
"yupi" -> {
|
||||||
if (nameServer.lowercase() == "burst") {
|
videoList.addAll(YourUploadExtractor(client).videoFromUrl(urlServer, headers = headers))
|
||||||
videoList.addAll(BurstCloudExtractor(client).videoFromUrl(urlServer, headers = headers))
|
}
|
||||||
|
"mp4upload" -> {
|
||||||
|
videoList.addAll(Mp4uploadExtractor(client).videosFromUrl(urlServer, headers = headers))
|
||||||
|
}
|
||||||
|
"burst" -> {
|
||||||
|
videoList.addAll(BurstCloudExtractor(client).videoFromUrl(urlServer, headers = headers))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -222,20 +230,24 @@ class Hentaila : ConfigurableAnimeSource, AnimeHttpSource() {
|
|||||||
compareBy<Video> { it.quality.replace("[0-9]".toRegex(), "") }.thenByDescending { getNumberFromString(it.quality) },
|
compareBy<Video> { it.quality.replace("[0-9]".toRegex(), "") }.thenByDescending { getNumberFromString(it.quality) },
|
||||||
).toMutableList()
|
).toMutableList()
|
||||||
val userPreferredQuality = preferences.getString("preferred_quality", "YourUpload")
|
val userPreferredQuality = preferences.getString("preferred_quality", "YourUpload")
|
||||||
val preferredIdx = videoSorted.indexOfFirst { x -> x.quality == userPreferredQuality }
|
val newList = mutableListOf<Video>()
|
||||||
if (preferredIdx != -1) {
|
var preferred = 0
|
||||||
val temp = videoSorted[preferredIdx]
|
for (video in videoSorted) {
|
||||||
videoSorted.removeAt(preferredIdx)
|
if (video.quality.startsWith(userPreferredQuality!!)) {
|
||||||
videoSorted.add(0, temp)
|
newList.add(preferred, video)
|
||||||
|
preferred++
|
||||||
|
} else {
|
||||||
|
newList.add(video)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
videoSorted.toList()
|
newList.toList()
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
this
|
this
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getNumberFromString(epsStr: String): String {
|
private fun getNumberFromString(epsStr: String): Int {
|
||||||
return epsStr.filter { it.isDigit() }.ifEmpty { "0" }
|
return epsStr.filter { it.isDigit() }.ifEmpty { "0" }.toInt()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getFilterList(): AnimeFilterList = AnimeFilterList(
|
override fun getFilterList(): AnimeFilterList = AnimeFilterList(
|
||||||
@ -312,6 +324,9 @@ class Hentaila : ConfigurableAnimeSource, AnimeHttpSource() {
|
|||||||
val qualities = arrayOf(
|
val qualities = arrayOf(
|
||||||
"YourUpload",
|
"YourUpload",
|
||||||
"BurstCloud",
|
"BurstCloud",
|
||||||
|
"Voe",
|
||||||
|
"StreamWish",
|
||||||
|
"Mp4Upload",
|
||||||
)
|
)
|
||||||
val videoQualityPref = ListPreference(screen.context).apply {
|
val videoQualityPref = ListPreference(screen.context).apply {
|
||||||
key = "preferred_quality"
|
key = "preferred_quality"
|
||||||
|
Reference in New Issue
Block a user