From ee3ef60a20701adf40fa5b4bb89c6db37cd33af9 Mon Sep 17 00:00:00 2001 From: jj Date: Mon, 20 Jan 2025 20:12:21 +0000 Subject: [PATCH] api/youtube: expect one of itags to be empty --- api/src/processing/services/youtube.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/src/processing/services/youtube.js b/api/src/processing/services/youtube.js index ff4a95cf..f0766b3f 100644 --- a/api/src/processing/services/youtube.js +++ b/api/src/processing/services/youtube.js @@ -351,7 +351,7 @@ export default async function (o) { Number(b.bitrate) - Number(a.bitrate) ).forEach(format => { Object.keys(codecList).forEach(yCodec => { - const matchingItag = slot => !itag || itag[slot] === format.itag; + const matchingItag = slot => !itag?.[slot] || itag[slot] === format.itag; const sorted = sorted_formats[yCodec]; const goodFormat = checkFormat(format, yCodec); if (!goodFormat) return; @@ -453,8 +453,8 @@ export default async function (o) { } itag = { - video: video.itag, - audio: audio.itag + video: video?.itag, + audio: audio?.itag }; const originalRequest = {