From 7614ffb7bc9037c6729eb4e499ccbd02fde9688f Mon Sep 17 00:00:00 2001 From: aandrew-me Date: Sun, 25 Aug 2024 12:05:24 +0300 Subject: [PATCH] Ignore unavailable videos for playlist index --- src/playlist.js | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/playlist.js b/src/playlist.js index aff42ba..3c9a1aa 100644 --- a/src/playlist.js +++ b/src/playlist.js @@ -198,8 +198,8 @@ function download(type) { proxy ? "--no-check-certificate" : "", proxy ? "--proxy" : "", proxy, - // "--compat-options", - // "no-youtube-unavailable-videos", + "--compat-options", + "no-youtube-unavailable-videos", `"${url}"`, ].filter(item => item); @@ -243,6 +243,8 @@ function download(type) { proxy ? "--no-check-certificate" : "", proxy ? "--proxy" : "", proxy, + "--compat-options", + "no-youtube-unavailable-videos", `"${url}"`, ].filter(item => item); @@ -283,6 +285,8 @@ function download(type) { proxy ? "--no-check-certificate" : "", proxy ? "--proxy" : "", proxy, + "--compat-options", + "no-youtube-unavailable-videos", `"${url}"`, ].filter(item => item); @@ -450,8 +454,10 @@ function downloadThumbnails() { "--ffmpeg-location", ffmpeg, proxy ? "--no-check-certificate" : "", - "--proxy", + proxy ? "--proxy" : "", proxy, + "--compat-options", + "no-youtube-unavailable-videos", `"${url}"`, ].filter(item => item); @@ -460,6 +466,8 @@ function downloadThumbnails() { {shell: true, detached: false} ); + // console.log(downloadProcess.ytDlpProcess.spawnargs[2]) + downloadProcess.on("ytDlpEvent", (eventType, eventData) => { // console.log(eventData); @@ -524,8 +532,10 @@ function saveLinks() { "-I", `"${playlistIndex}:${playlistEnd}"`, proxy ? "--no-check-certificate" : "", - "--proxy", + proxy ? "--proxy" : "", proxy, + "--compat-options", + "no-youtube-unavailable-videos", `"${url}"`, ].filter(item => item);