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

Extract video and audio using the python package #18494

Closed
revolter opened this issue Dec 11, 2018 · 1 comment
Closed

Extract video and audio using the python package #18494

revolter opened this issue Dec 11, 2018 · 1 comment

Comments

@revolter
Copy link
Contributor

@revolter revolter commented Dec 11, 2018

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

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

The following sections concretize particular purposed issues, you can erase any section (the contents between triple ---) not applicable to your issue


Description of your issue, suggested solution and other information

How can I get an URL to the best video and audio format using the python package? I am currently using:

import youtube_dl

input_link = 'https://www.youtube.com/watch?v=rvWf62D1jw0'

with youtube_dl.YoutubeDL() as yt_dl:
    video_info = yt_dl.extract_info(input_link, download=False)
  1. I can't find documentation for the returned dictionary, so, for some URLs, there is a top level url key returned, for some, there isn't.
  2. What is the difference between formats and requested_formats?
  3. How could I know if the URL from a format in one of the mentioned lists contains video and audio?
  4. As, for the example link, some only contain video while some only contain audio. If I request them to get merged, how will the file be returned? I would like to avoid writing it to disk at all, even in a temporary file.
@dstftw
Copy link
Collaborator

@dstftw dstftw commented Dec 12, 2018

  1. https://github.com/rg3/youtube-dl#embedding-youtube-dl
  2. formats contains all formats, requested_formats - formats selected with format selector.
  3. By not having acodec or vcodec set to 'none'.
  4. File will not be returned.
@dstftw dstftw closed this Dec 12, 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.