Elijas / auto-youtube-subscription-playlist-2

Script automatically adds videos to playlists from Youtube channels and/or subscriptions (Youtube Collections alternative).
MIT License
248 stars 54 forks source link

Bypass 200 video limit #72

Closed JesperDramsch closed 4 years ago

JesperDramsch commented 4 years ago

The original implementation uses sleep(1000) to avoid rate limiting during the video insertion into the playlist. While we can reduce this number (100 still worked fine for me) to get more videos in, we can use recursion to let the API "take the time it needs" and then insert the next video. This is the fastest execution time possible and leaves us with possibilities to extend the code dynamically.

victorjzsun commented 4 years ago

The recursive insertion of videos does have the benefit you suggest.

One thing to note is that this doesn't bypass the 200 video limit. This limit comes from the fact that the quota cost to insert a video is 50 units, and the max quota limit is 10000 (without any quota audits), so trying to insert more than 200 videos will cause an API quota error. This check shouldn't be removed from the addVideosToPlaylist function.