mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
parsed | parsedSafe get » ApiError safeApiCall
🕊
This commit is contained in:
parent
23d193c163
commit
67cba31aab
2 changed files with 7 additions and 3 deletions
|
@ -24,10 +24,10 @@ open class TauVideo : ExtractorApi() {
|
||||||
callback.invoke(
|
callback.invoke(
|
||||||
ExtractorLink(
|
ExtractorLink(
|
||||||
source = this.name,
|
source = this.name,
|
||||||
name = "${this.name} - ${video.label}",
|
name = this.name,
|
||||||
url = video.url,
|
url = video.url,
|
||||||
referer = ext_ref,
|
referer = ext_ref,
|
||||||
quality = Qualities.Unknown.value,
|
quality = getQualityFromName(video.label),
|
||||||
type = INFER_TYPE
|
type = INFER_TYPE
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
|
@ -6,6 +6,8 @@ import android.util.Log
|
||||||
import com.lagradost.cloudstream3.*
|
import com.lagradost.cloudstream3.*
|
||||||
import com.lagradost.cloudstream3.utils.*
|
import com.lagradost.cloudstream3.utils.*
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty
|
import com.fasterxml.jackson.annotation.JsonProperty
|
||||||
|
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
|
||||||
|
import com.fasterxml.jackson.module.kotlin.readValue
|
||||||
|
|
||||||
open class VideoSeyred : ExtractorApi() {
|
open class VideoSeyred : ExtractorApi() {
|
||||||
override val name = "VideoSeyred"
|
override val name = "VideoSeyred"
|
||||||
|
@ -18,7 +20,9 @@ open class VideoSeyred : ExtractorApi() {
|
||||||
val video_url = "${mainUrl}/playlist/${video_id}.json"
|
val video_url = "${mainUrl}/playlist/${video_id}.json"
|
||||||
Log.d("Kekik_${this.name}", "video_url » ${video_url}")
|
Log.d("Kekik_${this.name}", "video_url » ${video_url}")
|
||||||
|
|
||||||
val response = app.get(video_url).parsedSafe<List<VideoSeyredSource>>()?.firstOrNull() ?: throw Error("Failed to parse response")
|
val response_raw = app.get(video_url)
|
||||||
|
val response_list:List<VideoSeyredSource> = jacksonObjectMapper().readValue(response_raw.text) ?: throw ErrorLoadingException("VideoSeyred")
|
||||||
|
val response = response_list[0] ?: throw ErrorLoadingException("VideoSeyred")
|
||||||
|
|
||||||
for (track in response.tracks) {
|
for (track in response.tracks) {
|
||||||
if (track.label != null && track.kind == "captions") {
|
if (track.label != null && track.kind == "captions") {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue