From 4363c068d6bc06aa3b77345f99732666f24a9e94 Mon Sep 17 00:00:00 2001 From: Brahim Hadriche Date: Sat, 6 Sep 2025 21:16:14 -0400 Subject: [PATCH] Dash: null check on urls (can be empty from Invidious for example) --- playlet-lib/src/components/Services/Dash/DashManifest.bs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/playlet-lib/src/components/Services/Dash/DashManifest.bs b/playlet-lib/src/components/Services/Dash/DashManifest.bs index bc277f07..0169c105 100644 --- a/playlet-lib/src/components/Services/Dash/DashManifest.bs +++ b/playlet-lib/src/components/Services/Dash/DashManifest.bs @@ -39,6 +39,9 @@ class DashManifest if local and m.invidiousInstance <> Invidious.PLAYLET_BUILT_IN_INSTANCE parsedInvidiousUrl = UrlUtils.ParseUrl(m.invidiousInstance) for i = 0 to adaptiveFormats.Count() - 1 + if StringUtils.IsNullOrEmpty(adaptiveFormats[i].url) + continue for + end if parsedUrl = UrlUtils.ParseUrl(adaptiveFormats[i].url) parsedInvidiousUrl.path = UrlUtils.AppendQueryParams(parsedUrl.path, { host: parsedUrl.host }) adaptiveFormats[i].url = UrlUtils.BuildUrlFromParts(parsedInvidiousUrl) @@ -113,8 +116,8 @@ class DashManifest "value": `${stream.audioChannels}` }) - if stream.url = invalid - xml.Comment(`[ERROR] Stream.url is invalid for itag: ${stream.itag}`) + if StringUtils.IsNullOrEmpty(stream.url) + xml.Comment(`[ERROR] Stream.url is null or empty for itag: ${stream.itag}`) else if stream.url.InStr("source=yt_live_broadcast") <> -1 xml.Comment(`[WARN] Stream URL indicates a live broadcast for itag: ${stream.itag}`) end if