From b0e6dc75282316ea9f0de97bb685bd66f23165f2 Mon Sep 17 00:00:00 2001 From: wukko Date: Mon, 10 Apr 2023 18:28:41 +0600 Subject: [PATCH] fixed a lil oversight in youtube module --- src/modules/processing/services/youtube.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/modules/processing/services/youtube.js b/src/modules/processing/services/youtube.js index dc187c1..91bc1dc 100644 --- a/src/modules/processing/services/youtube.js +++ b/src/modules/processing/services/youtube.js @@ -73,10 +73,9 @@ export default async function(o) { }; return r } - - let checkSingle = (i) => ((i['quality_label'].split('p')[0] === quality || i['quality_label'].split('p')[0] === bestQuality) && i["mime_type"].includes(c[o.format].codec)), - checkBestVideo = (i) => (i['quality_label'].split('p')[0] === bestQuality && !i["has_audio"] && i["has_video"]), - checkRightVideo = (i) => (i['quality_label'].split('p')[0] === quality && !i["has_audio"] && i["has_video"]); + let checkSingle = (i) => (i['quality_label'] && (i['quality_label'].split('p')[0] === quality || i['quality_label'].split('p')[0] === bestQuality) && i["mime_type"].includes(c[o.format].codec)), + checkBestVideo = (i) => (i['quality_label'] && i['quality_label'].split('p')[0] === bestQuality && !i["has_audio"] && i["has_video"]), + checkRightVideo = (i) => (i['quality_label'] && i['quality_label'].split('p')[0] === quality && !i["has_audio"] && i["has_video"]); if (!o.isAudioOnly && !o.isAudioMuted && o.format === 'h264') { let single = info.streaming_data.formats.find(i => checkSingle(i));