Get total number of items in playlist #10536

Closed
opened 2026-02-21 05:34:45 -05:00 by deekerman · 2 comments
Owner

Originally created by @Rudloff on GitHub (Apr 25, 2017).

Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2017.04.17. If it's not read this FAQ entry and update. Issues with outdated version will be rejected.

  • I've verified and I assure that I'm running youtube-dl 2017.04.17

Before submitting an issue make sure you have:

  • At least skimmed through README and most notably FAQ and BUGS sections
  • Searched the bugtracker for similar issues including closed ones

What is the purpose of your issue?

  • Bug report (encountered problems with youtube-dl)
  • Site support request (request for adding support for a new site)
  • Feature request (request for a new functionality)
  • Question
  • Other

Description of your issue, suggested solution and other information

I'm trying to paginate playlists.
But when using --dump-single-json --playlist-end 5 on a long playlist, I don't have a way to know from the JSON if there are more videos in the playlist.
It would be useful to get either:

  • The total number of videos in the playlist.
  • A boolean that indicates if there are videos coming next in the playlist.
Originally created by @Rudloff on GitHub (Apr 25, 2017). ### Make sure you are using the *latest* version: run `youtube-dl --version` and ensure your version is *2017.04.17*. If it's not read [this FAQ entry](https://github.com/rg3/youtube-dl/blob/master/README.md#how-do-i-update-youtube-dl) and update. Issues with outdated version will be rejected. - [x] I've **verified** and **I assure** that I'm running youtube-dl **2017.04.17** ### Before submitting an *issue* make sure you have: - [x] At least skimmed through [README](https://github.com/rg3/youtube-dl/blob/master/README.md) and **most notably** [FAQ](https://github.com/rg3/youtube-dl#faq) and [BUGS](https://github.com/rg3/youtube-dl#bugs) sections - [x] [Searched](https://github.com/rg3/youtube-dl/search?type=Issues) the bugtracker for similar issues including closed ones ### What is the purpose of your *issue*? - [ ] Bug report (encountered problems with youtube-dl) - [ ] Site support request (request for adding support for a new site) - [x] Feature request (request for a new functionality) - [ ] Question - [ ] Other --- ### Description of your *issue*, suggested solution and other information I'm trying to paginate playlists. But when using `--dump-single-json --playlist-end 5` on a long playlist, I don't have a way to know from the JSON if there are more videos in the playlist. It would be useful to get either: * The total number of videos in the playlist. * A boolean that indicates if there are videos coming next in the playlist.
Author
Owner

@Tithen-Firion commented on GitHub (Apr 26, 2017):

I doubt this will be added. You are generating unnecessary traffic by loading playlist URL each time you download 5 more videos.

Use --flat-playlist --dump-single-json, this way you load playlist URL only once and you can easily count all the videos.

@Tithen-Firion commented on GitHub (Apr 26, 2017): I doubt this will be added. You are generating unnecessary traffic by loading playlist URL each time you download 5 more videos. Use `--flat-playlist --dump-single-json`, this way you load playlist URL only once and you can easily count all the videos.
Author
Owner

@Rudloff commented on GitHub (Apr 26, 2017):

Hum, you're right. I guess I can use --flat-playlist.
I thought it was gonna be slow for large playlists but turns out it's not.

@Rudloff commented on GitHub (Apr 26, 2017): Hum, you're right. I guess I can use `--flat-playlist`. I thought it was gonna be slow for large playlists but turns out it's not.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/youtube-dl-ytdl-org#10536
No description provided.