Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get the video count of a playlist #15789

Closed
blueray453 opened this issue Mar 7, 2018 · 3 comments
Closed

Get the video count of a playlist #15789

blueray453 opened this issue Mar 7, 2018 · 3 comments

Comments

@blueray453
Copy link

@blueray453 blueray453 commented Mar 7, 2018

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 just want to know the number of videos in a playlist.

For Ex. when I start downloading a playlist, it shows
Course Name: Collected 61 video ids

I only want this line for my playlist. How can I do that?

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Mar 7, 2018

--dump-single-json and count the number of entries.

@dstftw dstftw closed this Mar 7, 2018
@blueray453
Copy link
Author

@blueray453 blueray453 commented Mar 7, 2018

How to count the number of entries?

@blueray453
Copy link
Author

@blueray453 blueray453 commented Mar 8, 2018

There is two possible solutions for future reference

  1. add --get-title or --get-id and pipe that into wc -l
  2. youtube-dl --dump-single-json WHATEVER | python -c 'import sys,json; print len(json.load(sys.stdin)["entries"])'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.