[Sora] Updated Home and small fix in UHDMovies

This commit is contained in:
hexated 2022-12-06 04:03:26 +07:00
parent a43e1f68d5
commit 26832004a3
4 changed files with 6 additions and 5 deletions

View file

@ -1,5 +1,5 @@
// use an integer for version numbers
version = 43
version = 44
cloudstream {

View file

@ -1223,7 +1223,7 @@ object SoraExtractor : SoraStream() {
val iframe =
detailDoc.select("div.entry-content p").map { it }
.filter { it.text().filterIframe(season, year) }
.filter { it.text().filterIframe(season, lastSeason, year) }
.mapNotNull {
if (season == null) {
it.text() to it.nextElementSibling()?.select("a")?.attr("href")
@ -1264,7 +1264,7 @@ object SoraExtractor : SoraStream() {
val videoQuality =
Regex("(\\d{3,4})p").find(quality)?.groupValues?.getOrNull(1)?.toIntOrNull()
?: Qualities.Unknown.value
val size = Regex("(?i)\\[(\\S+\\s?gb|mb)[]/]").find(quality)?.groupValues?.getOrNull(1)
val size = Regex("(?i)\\[(\\S+\\s?(gb|mb))[]/]").find(quality)?.groupValues?.getOrNull(1)
?.let { "[$it]" } ?: quality
callback.invoke(
ExtractorLink(

View file

@ -97,6 +97,7 @@ open class SoraStream : TmdbProvider() {
}
override val mainPage = mainPageOf(
"$tmdbAPI/trending/all/day?api_key=$apiKey&region=&page=" to "Trending",
"$tmdbAPI/tv/airing_today?api_key=$apiKey&region=&page=" to "Airing Today TV Shows",
"$tmdbAPI/movie/popular?api_key=$apiKey&region=&page=" to "Popular Movies",
"$tmdbAPI/tv/popular?api_key=$apiKey&region=&page=" to "Popular TV Shows",

View file

@ -18,9 +18,9 @@ data class FilmxyCookies(
val wSec: String? = null,
)
fun String.filterIframe(seasonNum: Int?, year: Int?): Boolean {
fun String.filterIframe(seasonNum: Int?, lastSeason: Int?, year: Int?): Boolean {
return if (seasonNum != null) {
if (seasonNum == 1) {
if (lastSeason == 1) {
this.contains(Regex("(?i)(S0?$seasonNum)|(Season\\s0?$seasonNum)|([0-9]{3,4}p)")) && !this.contains(
"Download",
true