0

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
  • What do you mean by length? The number of videos or the duration of all videos? Commented Apr 26, 2021 at 18:06
  • @ReddyLutonadio I updated the question
    – fuumind
    Commented Apr 26, 2021 at 18:20
  • Can you if possible provide the link to a playlist that "did not finish even after an hour"? Commented Apr 26, 2021 at 18:27
  • Sure! youtube.com/c/thedavidpakmanshow/videos
    – fuumind
    Commented Apr 26, 2021 at 18:28
  • The link leads to videos but not a specific playlist. Which playlist(s) is/are problematic? Commented Apr 26, 2021 at 18:35

0

You must log in to answer this question.

Browse other questions tagged .