Using youtube-dl, how do I get the length of an extremely long playlist

Using youtube-dl:s json capabilities together with jq like so:

youtube-dl -J --flat-playlist [playlist_url] | jq '.entries | length' 

I can get the number of videos in a playlist. This does consume an unnecessarily large ammount of bandwidth for the data desired but if the number of videos is low that is usually ok. For playlists with a significant number of videos the bandwidth cost becomes unreasonable. Also, the process does take an extremely long time to finish if there are many videos. One playlist I tried did not finish even after an hour, I had to ctrl-C the job.

Hence i wonder the following:

Is there a way to get the number of videos in a playlist that uses a more reasonable amount of bandwith and that will not take such a large amount of time to complete if the playlist contains a significant number of videos?

7

Reset to default

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like