diff --git a/CHANGELOG.md b/CHANGELOG.md index a0108814..cace5f6d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +- Nothing worth mentioning yet + ## [0.40.13] - 2025-08-19 ### Fixed diff --git a/playlet-lib/src/components/Services/Innertube/PlayerEndpoint.bs b/playlet-lib/src/components/Services/Innertube/PlayerEndpoint.bs index 531fa8e9..b62d140d 100644 --- a/playlet-lib/src/components/Services/Innertube/PlayerEndpoint.bs +++ b/playlet-lib/src/components/Services/Innertube/PlayerEndpoint.bs @@ -100,7 +100,6 @@ namespace Innertube "hlsUrl": streamingData["hlsManifestUrl"] "dashUrl": streamingData["dashManifestUrl"] "adaptiveFormats": ParseAdaptiveFormats(payload, signatureTimestamp, isLive, cancellation) - "hasDecodedDashUrls": true "formatStreams": [] "captions": ParseCaptions(payload) "recommendedVideos": [] diff --git a/playlet-lib/src/components/VideoPlayer/VideoContentJob.bs b/playlet-lib/src/components/VideoPlayer/VideoContentJob.bs index a39607f5..e8fa13d9 100644 --- a/playlet-lib/src/components/VideoPlayer/VideoContentJob.bs +++ b/playlet-lib/src/components/VideoPlayer/VideoContentJob.bs @@ -161,7 +161,6 @@ function AddDashUrls(streamUrls as object, metadata as object, preferredQuality ' dynamically generating the DASH manifest, and filter quality dashUrl = UrlUtils.AppendQueryParams(`http://127.0.0.1:${playletServerPort}/api/dash`, { v: metadata.videoId - hasDecodedDashUrls: ValidBool(metadata.hasDecodedDashUrls) }) dashUrlLocal = invalid diff --git a/playlet-lib/src/components/Web/PlayletWebServer/Middleware/DashRouter.bs b/playlet-lib/src/components/Web/PlayletWebServer/Middleware/DashRouter.bs index b046946b..ef9f80a7 100644 --- a/playlet-lib/src/components/Web/PlayletWebServer/Middleware/DashRouter.bs +++ b/playlet-lib/src/components/Web/PlayletWebServer/Middleware/DashRouter.bs @@ -26,39 +26,20 @@ namespace Http v = request.query.v local = request.query.local quality = request.query.quality - hasDecodedDashUrls = request.query.hasDecodedDashUrls if StringUtils.IsNullOrEmpty(v) response.Default(400, "Missing video id") return true end if - if ValidString(hasDecodedDashUrls) = "true" - player = m.videoQueueNode.player - if player = invalid - response.Default(500, "videoQueue.player is invalid") - return true - end if - content = player.content - if content = invalid - response.Default(500, "videoQueue.player.content is invalid") - return true - end if - metadata = content.metadata - if not IsAssociativeArray(metadata) - response.Default(500, "videoQueue.player.content.metadata is invalid") - return true - end if - if metadata.videoId <> v - response.Default(400, "videoQueue.playVideo.metadata.videoId does not match the requested video id") - return true - end if - else - metadata = m.invidiousService.GetVideoMetadata(v) - if metadata.error <> invalid - response.Default(500, metadata.error) - return true - end if + metadata = ObjectUtils.DigUnsafe(m.videoQueueNode, ["player", "content", "metadata"]) + if not IsAssociativeArray(metadata) + response.Default(500, "videoQueue.player.content.metadata is invalid") + return true + end if + if metadata.videoId <> v + response.Default(400, "videoQueue.player.content.metadata.videoId does not match the requested video id") + return true end if m.dashManifest.invidiousInstance = m.invidiousService.GetInstance() diff --git a/playlet-lib/src/source/utils/ObjectUtils.bs b/playlet-lib/src/source/utils/ObjectUtils.bs index bce2eccd..c56ae09e 100644 --- a/playlet-lib/src/source/utils/ObjectUtils.bs +++ b/playlet-lib/src/source/utils/ObjectUtils.bs @@ -22,6 +22,19 @@ namespace ObjectUtils return obj end function + function DigUnsafe(obj as object, keys as object) as object + for each key in keys + if obj <> invalid + obj = obj[key] + continue for + end if + + return invalid + end for + + return obj + end function + function DigWithDefault(obj as object, keys as object, defaultValue as dynamic) as dynamic result = Dig(obj, keys) if result = invalid diff --git a/playlet-web/src/lib/Api/YoutubeJs.ts b/playlet-web/src/lib/Api/YoutubeJs.ts index 636c358d..22bfe0b8 100644 --- a/playlet-web/src/lib/Api/YoutubeJs.ts +++ b/playlet-web/src/lib/Api/YoutubeJs.ts @@ -278,7 +278,6 @@ export class YoutubeJs { dashUrl: info.streaming_data.dash_manifest_url || "", hlsUrl: info.streaming_data.hls_manifest_url, adaptiveFormats: YoutubeJs.getAdaptiveFormats(info), - hasDecodedDashUrls: true, formatStreams: [], captions: YoutubeJs.getCaptions(info), recommendedVideos: [],