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

How do I dump JSONs from a search as soon as they are available? #16235

Closed
costcoterrorist opened this issue Apr 20, 2018 · 1 comment
Closed

How do I dump JSONs from a search as soon as they are available? #16235

costcoterrorist opened this issue Apr 20, 2018 · 1 comment

Comments

@costcoterrorist
Copy link

@costcoterrorist costcoterrorist commented Apr 20, 2018

Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2018.04.16. 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 2018.04.16

Before submitting an issue make sure you have:

  • At least skimmed through the README, most notably the FAQ and BUGS sections
  • Searched the bugtracker for similar issues including closed ones
  • Checked that provided video/audio/playlist URLs (if any) are alive and playable in a browser

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

How do I dump video JSON's as they become available?

Running youtube-dl as a shell application with youtube-dl --dump-json "ytsearch8:vinesauce" dumps each JSON to stdout as soon as it finishes. However, running it as a python module causes it to be buffered until the entire search is finished:

ydl_opts = {
    'simulate': True
}
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
    print(ydl.extract_info('ytsearch8:vinesauce'))

How do I get JSON's as soon as they are available in a python script?

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Apr 20, 2018

By splitting into several requests.

@dstftw dstftw closed this Apr 20, 2018
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.