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?