mirror of
https://github.com/hexated/cloudstream-extensions-hexated.git
synced 2024-08-15 00:03:22 +00:00
small fix
This commit is contained in:
parent
211c58b0ef
commit
51d8c74880
4 changed files with 33 additions and 8 deletions
|
@ -2269,9 +2269,11 @@ object SoraExtractor : SoraStream() {
|
||||||
title: String? = null,
|
title: String? = null,
|
||||||
year: Int? = null,
|
year: Int? = null,
|
||||||
season: Int? = null,
|
season: Int? = null,
|
||||||
|
lastSeason: Int? = null,
|
||||||
episode: Int? = null,
|
episode: Int? = null,
|
||||||
callback: (ExtractorLink) -> Unit,
|
callback: (ExtractorLink) -> Unit,
|
||||||
) {
|
) {
|
||||||
|
|
||||||
val showboxApi = "https://www.showbox.media"
|
val showboxApi = "https://www.showbox.media"
|
||||||
val (seasonSlug, episodeSlug) = getEpisodeSlug(season, episode)
|
val (seasonSlug, episodeSlug) = getEpisodeSlug(season, episode)
|
||||||
|
|
||||||
|
@ -2281,16 +2283,31 @@ object SoraExtractor : SoraStream() {
|
||||||
), headers = mapOf("X-Requested-With" to "XMLHttpRequest")
|
), headers = mapOf("X-Requested-With" to "XMLHttpRequest")
|
||||||
).parsed<String>().let { Jsoup.parse(it) }
|
).parsed<String>().let { Jsoup.parse(it) }
|
||||||
|
|
||||||
val mediaId = res.select("a.nav-item").find {
|
val mediaRes = res.select("a.nav-item").map {
|
||||||
it.select("h3.film-name").text()
|
ShowboxMedia(
|
||||||
.equals(title, true) && it.select("div.film-infor > span:first-child").text()
|
it.attr("href"),
|
||||||
.contains(if (season == null) "$year" else "SS") && it.select("div.film-infor > span:last-child")
|
it.select("h3.film-name").text(),
|
||||||
.text()
|
it.select("div.film-infor > span:first-child").text(),
|
||||||
.equals(if (season == null) "Movie" else "TV")
|
it.select("div.film-infor > span:last-child").text(),
|
||||||
}?.attr("href")?.substringAfterLast("/")
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
val media = mediaRes.find {
|
||||||
|
it.title.equals(
|
||||||
|
title,
|
||||||
|
true
|
||||||
|
) && it.infor == if (season == null) "$year" else "SS $lastSeason" && it.type == if (season == null) "Movie" else "TV"
|
||||||
|
} ?: mediaRes.find {
|
||||||
|
it.title.equals(
|
||||||
|
title,
|
||||||
|
true
|
||||||
|
) && it.infor.contains(if (season == null) "$year" else "SS") && it.type == if (season == null) "Movie" else "TV"
|
||||||
|
}
|
||||||
|
|
||||||
|
val shareId = media?.url?.substringAfterLast("/") ?: return
|
||||||
|
|
||||||
val shareKey =
|
val shareKey =
|
||||||
app.get("$showboxApi/index/share_link?id=${mediaId ?: return}&type=${if (season == null) "1" else "2"}")
|
app.get("$showboxApi/index/share_link?id=${shareId}&type=${if (season == null) "1" else "2"}")
|
||||||
.parsedSafe<FebboxResponse>()?.data?.link?.substringAfterLast("/")
|
.parsedSafe<FebboxResponse>()?.data?.link?.substringAfterLast("/")
|
||||||
|
|
||||||
val headers = mapOf("Accept-Language" to "en")
|
val headers = mapOf("Accept-Language" to "en")
|
||||||
|
|
|
@ -2,6 +2,12 @@ package com.hexated
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty
|
import com.fasterxml.jackson.annotation.JsonProperty
|
||||||
|
|
||||||
|
data class ShowboxMedia(
|
||||||
|
val url: String,
|
||||||
|
val title: String,
|
||||||
|
val infor: String,
|
||||||
|
val type: String,
|
||||||
|
)
|
||||||
data class FDMovieIFrame(
|
data class FDMovieIFrame(
|
||||||
val link: String,
|
val link: String,
|
||||||
val quality: String,
|
val quality: String,
|
||||||
|
|
|
@ -366,6 +366,7 @@ open class SoraStream : TmdbProvider() {
|
||||||
res.title,
|
res.title,
|
||||||
res.year,
|
res.year,
|
||||||
res.season,
|
res.season,
|
||||||
|
res.lastSeason,
|
||||||
res.episode,
|
res.episode,
|
||||||
callback
|
callback
|
||||||
)
|
)
|
||||||
|
|
|
@ -57,6 +57,7 @@ class SoraStreamLite : SoraStream() {
|
||||||
res.title,
|
res.title,
|
||||||
res.year,
|
res.year,
|
||||||
res.season,
|
res.season,
|
||||||
|
res.lastSeason,
|
||||||
res.episode,
|
res.episode,
|
||||||
callback
|
callback
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue