mirror of
https://github.com/recloudstream/cloudstream-extensions.git
synced 2024-08-15 03:03:54 +00:00
Update SuperembedProvider.kt
This commit is contained in:
parent
95c9aba1c2
commit
c23c324d9d
1 changed files with 6 additions and 3 deletions
|
@ -24,10 +24,13 @@ class SuperembedProvider : TmdbProvider() {
|
|||
subtitleCallback: (SubtitleFile) -> Unit,
|
||||
callback: (ExtractorLink) -> Unit
|
||||
): Boolean {
|
||||
val mappedData = tryParseJson<TmdbLink>(data)
|
||||
val mappedData = tryParseJson<TmdbLink>(data) ?: return false
|
||||
val tmdbId = mappedData?.tmdbID ?: return false
|
||||
|
||||
val document = app.get("https://seapi.link/?type=tmdb&id=${tmdbId}&max_results=1").text
|
||||
val document = app.get(
|
||||
if (mappedData.season == null || mappedData.episode == null) "https://seapi.link/?type=tmdb&id=${tmdbId}&max_results=1"
|
||||
else "https://seapi.link/?type=tmdb&id=${tmdbId}&season=${mappedData.season}&episode=${mappedData.episode}&max_results=1"
|
||||
).text
|
||||
val response = tryParseJson<ApiResponse>(document) ?: return false
|
||||
|
||||
response.results.forEach {
|
||||
|
|
Loading…
Reference in a new issue