small fix

This commit is contained in:
LagradOst 2021-08-24 23:06:40 +02:00
parent 5884971655
commit 0967fe7600
11 changed files with 33 additions and 28 deletions

View file

@ -64,7 +64,8 @@ class AnimeFlickProvider : MainAPI() {
val poster = mainUrl + doc.selectFirst("img.rounded").attr("src") val poster = mainUrl + doc.selectFirst("img.rounded").attr("src")
val title = doc.selectFirst("h2.title").text() val title = doc.selectFirst("h2.title").text()
val year = Regex("""(\d{4})""").find(doc.selectFirst(".trending-year").text())!!.destructured.component1().toIntOrNull() val yearText = doc.selectFirst(".trending-year")?.text()
val year = if(yearText != null) Regex("""(\d{4})""").find(yearText)?.destructured?.component1()?.toIntOrNull() else null
val description = doc.selectFirst("p").text() val description = doc.selectFirst("p").text()
val genres = doc.select("a[href*=\"genre-\"]").map { it.text() } val genres = doc.select("a[href*=\"genre-\"]").map { it.text() }

View file

@ -88,7 +88,7 @@ class AnimePaheProvider : MainAPI() {
"https://pahe.win/a/${it.animeId}", "https://pahe.win/a/${it.animeId}",
this.name, this.name,
TvType.Anime, TvType.Anime,
null, it.snapshot,
null, null,
null, null,
EnumSet.of(DubStatus.Subbed), EnumSet.of(DubStatus.Subbed),

View file

@ -204,7 +204,7 @@ class WatchCartoonOnlineProvider : MainAPI() {
this.name + " HD", this.name + " HD",
hdLink, hdLink,
"", "",
Qualities.HD.value Qualities.P720.value
) )
) )
@ -215,7 +215,7 @@ class WatchCartoonOnlineProvider : MainAPI() {
this.name + " SD", this.name + " SD",
sdLink, sdLink,
"", "",
Qualities.SD.value Qualities.P480.value
) )
) )

View file

@ -18,10 +18,10 @@ class MultiQuality : ExtractorApi() {
private fun getQuality(string: String): Int { private fun getQuality(string: String): Int {
return when (string) { return when (string) {
"360" -> Qualities.SD.value "360" -> Qualities.P480.value
"480" -> Qualities.SD.value "480" -> Qualities.P480.value
"720" -> Qualities.HD.value "720" -> Qualities.P720.value
"1080" -> Qualities.FullHd.value "1080" -> Qualities.P1080.value
else -> Qualities.Unknown.value else -> Qualities.Unknown.value
} }
} }

View file

@ -25,7 +25,7 @@ class Shiro : ExtractorApi() {
it.replace(" ", "%20"), it.replace(" ", "%20"),
"https://cherry.subsplea.se/", "https://cherry.subsplea.se/",
// UHD to give top priority // UHD to give top priority
Qualities.UHD.value Qualities.P2160.value
) )
) )
} }

View file

@ -47,7 +47,7 @@ class WcoStream : ExtractorApi() {
name + if (it.label != null) "- ${it.label}" else "", name + if (it.label != null) "- ${it.label}" else "",
it.file, it.file,
"", "",
Qualities.HD.value, Qualities.P720.value,
it.file.contains(".m3u8") it.file.contains(".m3u8")
) )
) )

View file

@ -29,10 +29,10 @@ class XStreamCdn : ExtractorApi() {
private fun getQuality(string: String): Int { private fun getQuality(string: String): Int {
return when (string) { return when (string) {
"360p" -> Qualities.SD.value "360p" -> Qualities.P480.value
"480p" -> Qualities.SD.value "480p" -> Qualities.P480.value
"720p" -> Qualities.HD.value "720p" -> Qualities.P720.value
"1080p" -> Qualities.FullHd.value "1080p" -> Qualities.P1080.value
else -> Qualities.Unknown.value else -> Qualities.Unknown.value
} }
} }

View file

@ -52,7 +52,7 @@ class HDMProvider : MainAPI() {
this.name, this.name,
"https://hls.1o.to/vod/$slug/playlist.m3u8$key", "https://hls.1o.to/vod/$slug/playlist.m3u8$key",
"", "",
Qualities.HD.value, Qualities.P720.value,
true true
) )
) )

View file

@ -107,7 +107,8 @@ object CastHelper {
val holder = val holder =
MetadataHolder(apiName, isMovie, title, poster, currentEpisodeIndex, episodes, currentLinks, subtitles) MetadataHolder(apiName, isMovie, title, poster, currentEpisodeIndex, episodes, currentLinks, subtitles)
val index = startIndex ?: 0 val index = if(startIndex == null || startIndex < 0) 0 else startIndex
val mediaItem = val mediaItem =
getMediaInfo(epData, holder, index, JSONObject(mapper.writeValueAsString(holder)), subtitles) getMediaInfo(epData, holder, index, JSONObject(mapper.writeValueAsString(holder)), subtitles)

View file

@ -20,22 +20,24 @@ data class ExtractorSubtitleLink(
enum class Qualities(var value: Int) { enum class Qualities(var value: Int) {
Unknown(0), Unknown(0),
SD(-1), // 360p - 480p P360(-2), // 360p
HD(1), // 720p P480(-1), // 480p
FullHd(2), // 1080p P720(1), // 720p
UHD(3) // 4k P1080(2), // 1080p
P1440(3), // 1440p
P2160(4) // 4k or 2160p
} }
fun getQualityFromName(qualityName: String): Int { fun getQualityFromName(qualityName: String): Int {
return when (qualityName.replace("p", "").replace("P", "")) { return when (qualityName.replace("p", "").replace("P", "")) {
"360" -> Qualities.SD "360" -> Qualities.P360
"480" -> Qualities.SD "480" -> Qualities.P480
"720" -> Qualities.HD "720" -> Qualities.P720
"1080" -> Qualities.FullHd "1080" -> Qualities.P1080
"1440" -> Qualities.UHD // I KNOW KINDA MISLEADING "1440" -> Qualities.P1440
"2160" -> Qualities.UHD "2160" -> Qualities.P2160
"4k" -> Qualities.UHD "4k" -> Qualities.P2160
"4K" -> Qualities.UHD "4K" -> Qualities.P2160
else -> Qualities.Unknown else -> Qualities.Unknown
}.value }.value
} }

View file

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<!--5736E0-->
<color name="ic_launcher_background">#3242D3</color> <color name="ic_launcher_background">#3242D3</color>
</resources> </resources>