mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
small fix
This commit is contained in:
parent
5884971655
commit
0967fe7600
11 changed files with 33 additions and 28 deletions
|
@ -64,7 +64,8 @@ class AnimeFlickProvider : MainAPI() {
|
|||
val poster = mainUrl + doc.selectFirst("img.rounded").attr("src")
|
||||
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 genres = doc.select("a[href*=\"genre-\"]").map { it.text() }
|
||||
|
|
|
@ -88,7 +88,7 @@ class AnimePaheProvider : MainAPI() {
|
|||
"https://pahe.win/a/${it.animeId}",
|
||||
this.name,
|
||||
TvType.Anime,
|
||||
null,
|
||||
it.snapshot,
|
||||
null,
|
||||
null,
|
||||
EnumSet.of(DubStatus.Subbed),
|
||||
|
|
|
@ -204,7 +204,7 @@ class WatchCartoonOnlineProvider : MainAPI() {
|
|||
this.name + " HD",
|
||||
hdLink,
|
||||
"",
|
||||
Qualities.HD.value
|
||||
Qualities.P720.value
|
||||
)
|
||||
)
|
||||
|
||||
|
@ -215,7 +215,7 @@ class WatchCartoonOnlineProvider : MainAPI() {
|
|||
this.name + " SD",
|
||||
sdLink,
|
||||
"",
|
||||
Qualities.SD.value
|
||||
Qualities.P480.value
|
||||
)
|
||||
)
|
||||
|
||||
|
|
|
@ -18,10 +18,10 @@ class MultiQuality : ExtractorApi() {
|
|||
|
||||
private fun getQuality(string: String): Int {
|
||||
return when (string) {
|
||||
"360" -> Qualities.SD.value
|
||||
"480" -> Qualities.SD.value
|
||||
"720" -> Qualities.HD.value
|
||||
"1080" -> Qualities.FullHd.value
|
||||
"360" -> Qualities.P480.value
|
||||
"480" -> Qualities.P480.value
|
||||
"720" -> Qualities.P720.value
|
||||
"1080" -> Qualities.P1080.value
|
||||
else -> Qualities.Unknown.value
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ class Shiro : ExtractorApi() {
|
|||
it.replace(" ", "%20"),
|
||||
"https://cherry.subsplea.se/",
|
||||
// UHD to give top priority
|
||||
Qualities.UHD.value
|
||||
Qualities.P2160.value
|
||||
)
|
||||
)
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ class WcoStream : ExtractorApi() {
|
|||
name + if (it.label != null) "- ${it.label}" else "",
|
||||
it.file,
|
||||
"",
|
||||
Qualities.HD.value,
|
||||
Qualities.P720.value,
|
||||
it.file.contains(".m3u8")
|
||||
)
|
||||
)
|
||||
|
|
|
@ -29,10 +29,10 @@ class XStreamCdn : ExtractorApi() {
|
|||
|
||||
private fun getQuality(string: String): Int {
|
||||
return when (string) {
|
||||
"360p" -> Qualities.SD.value
|
||||
"480p" -> Qualities.SD.value
|
||||
"720p" -> Qualities.HD.value
|
||||
"1080p" -> Qualities.FullHd.value
|
||||
"360p" -> Qualities.P480.value
|
||||
"480p" -> Qualities.P480.value
|
||||
"720p" -> Qualities.P720.value
|
||||
"1080p" -> Qualities.P1080.value
|
||||
else -> Qualities.Unknown.value
|
||||
}
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@ class HDMProvider : MainAPI() {
|
|||
this.name,
|
||||
"https://hls.1o.to/vod/$slug/playlist.m3u8$key",
|
||||
"",
|
||||
Qualities.HD.value,
|
||||
Qualities.P720.value,
|
||||
true
|
||||
)
|
||||
)
|
||||
|
|
|
@ -107,7 +107,8 @@ object CastHelper {
|
|||
val holder =
|
||||
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 =
|
||||
getMediaInfo(epData, holder, index, JSONObject(mapper.writeValueAsString(holder)), subtitles)
|
||||
|
||||
|
|
|
@ -20,22 +20,24 @@ data class ExtractorSubtitleLink(
|
|||
|
||||
enum class Qualities(var value: Int) {
|
||||
Unknown(0),
|
||||
SD(-1), // 360p - 480p
|
||||
HD(1), // 720p
|
||||
FullHd(2), // 1080p
|
||||
UHD(3) // 4k
|
||||
P360(-2), // 360p
|
||||
P480(-1), // 480p
|
||||
P720(1), // 720p
|
||||
P1080(2), // 1080p
|
||||
P1440(3), // 1440p
|
||||
P2160(4) // 4k or 2160p
|
||||
}
|
||||
|
||||
fun getQualityFromName(qualityName: String): Int {
|
||||
return when (qualityName.replace("p", "").replace("P", "")) {
|
||||
"360" -> Qualities.SD
|
||||
"480" -> Qualities.SD
|
||||
"720" -> Qualities.HD
|
||||
"1080" -> Qualities.FullHd
|
||||
"1440" -> Qualities.UHD // I KNOW KINDA MISLEADING
|
||||
"2160" -> Qualities.UHD
|
||||
"4k" -> Qualities.UHD
|
||||
"4K" -> Qualities.UHD
|
||||
"360" -> Qualities.P360
|
||||
"480" -> Qualities.P480
|
||||
"720" -> Qualities.P720
|
||||
"1080" -> Qualities.P1080
|
||||
"1440" -> Qualities.P1440
|
||||
"2160" -> Qualities.P2160
|
||||
"4k" -> Qualities.P2160
|
||||
"4K" -> Qualities.P2160
|
||||
else -> Qualities.Unknown
|
||||
}.value
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!--5736E0-->
|
||||
<color name="ic_launcher_background">#3242D3</color>
|
||||
</resources>
|
Loading…
Reference in a new issue