From d3e088333244432330d9320297b4373ac7d9f38d Mon Sep 17 00:00:00 2001 From: Brahim Hadriche Date: Thu, 8 Jan 2026 19:30:47 -0500 Subject: [PATCH] Fix/ytjs missing urls (#811) * ytjs fix * ignore shoppingTimelyShelfViewModel --- CHANGELOG.md | 4 +++- .../src/components/Services/Innertube/NodesParser.bs | 1 + playlet-web/src/lib/Api/YoutubeJs.ts | 6 +++++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b9320a6..830673bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -- Nothing worth mentioning yet. +### Fixed + +- Error handling when ytjs formats have missing urls ## [0.44.4] - 2025-11-23 diff --git a/playlet-lib/src/components/Services/Innertube/NodesParser.bs b/playlet-lib/src/components/Services/Innertube/NodesParser.bs index c41f9042..070e4e48 100644 --- a/playlet-lib/src/components/Services/Innertube/NodesParser.bs +++ b/playlet-lib/src/components/Services/Innertube/NodesParser.bs @@ -163,6 +163,7 @@ namespace Innertube "emergencyOneboxRenderer": ParseNotImplemented ' Suicide & crisis lifeline, within search "searchFrictionViewModel": ParseNotImplemented + "shoppingTimelyShelfViewModel": ParseNotImplemented "backstagePostRenderer": ParseNotImplemented "backstagePostThreadRenderer": ParseNotImplemented "counterfactualRenderer": ParseNotImplemented diff --git a/playlet-web/src/lib/Api/YoutubeJs.ts b/playlet-web/src/lib/Api/YoutubeJs.ts index 77cbe1ec..e8513560 100644 --- a/playlet-web/src/lib/Api/YoutubeJs.ts +++ b/playlet-web/src/lib/Api/YoutubeJs.ts @@ -320,12 +320,16 @@ export class YoutubeJs { init: format.init_range ? `${format.init_range.start}-${format.init_range.end}` : "", index: format.index_range ? `${format.index_range.start}-${format.index_range.end}` : "", bitrate: `${format.bitrate}`, - url: await format.decipher(YoutubeJs.innerTube.session.player), itag: `${format.itag}`, type: format.mime_type, clen: `${format.approx_duration_ms}`, lmt: `${format.last_modified}`, }; + + if (format.url || format.signature_cipher || format.cipher) { + result.url = await format.decipher(YoutubeJs.innerTube.session.player); + } + if (format.audio_quality) { result.audioQuality = format.audio_quality; }