node-ytpl icon indicating copy to clipboard operation
node-ytpl copied to clipboard

Support for deleted videos

Open JackReevies opened this issue 3 years ago • 3 comments

When viewing playlists in youtube, there's an option to "show unavailable videos", they show up as "deleted video" but still have their old id. My program caches videos in case they get removed from the platform, and in the case of an unavailable video, it looks up cache by the video's id. I would love it if ytpl had an option to also show removed videos in the playlist response

JackReevies avatar Jan 20 '22 19:01 JackReevies

looks like all you need to do is modifying this line https://github.com/TimeForANinja/node-ytpl/blob/master/lib/main.js#L100 to look sth like this

const json = await UTIL.doPost(BASE_API_URL + apiKey, { context, continuation: token, params: 'wgYCCAA%3D' }, opts.requestOptions);

🤔

TimeForANinja avatar Jan 21 '22 01:01 TimeForANinja

Thanks, I tried this, expecting it to only get some deleted videos, but it didn't grab any from it. I've been using https://www.youtube.com/playlist?list=PLw0UrUlz9vFpjaXKphZW53TDTMgB8INpM to test with, there are a fair few deleted videos here scattered throughout

JackReevies avatar Jan 22 '22 12:01 JackReevies

ok, little update on this we currently do web-scraping for the first 100 results and use the youtubei api for everything following the webscraping does not support deleted videos, so we would have to switch to the youtubei api for all information with that api all that's needed is

browseId: "VL" + plistID
params: "wgYCCAA%3D" || "wgYCCAE%3D"

TimeForANinja avatar Feb 17 '22 11:02 TimeForANinja