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

Specifying file format should download correct video #311

Closed
kevinburke opened this issue Mar 17, 2012 · 2 comments
Closed

Specifying file format should download correct video #311

kevinburke opened this issue Mar 17, 2012 · 2 comments
Labels

Comments

@kevinburke
Copy link

@kevinburke kevinburke commented Mar 17, 2012

The first time I tried to download a video I ran youtube-dl with the -F flag and got this list of options:

35  :   flv [480x854]
44  :   webm    [480x854]
34  :   flv [360x640]
18  :   mp4 [360x640]
43  :   webm    [360x640]
5   :   flv [240x400]

I then tried running youtube-dl -f mp4 and got the following message:

ERROR: requested format not available

Which seems odd because it was just shown in the list above.

I'd like to propose one of the following two options:

  1. Accept a video format like flv or mp4 as an argument to -f

If there's only one specified resolution for the file format it's easy to choose which one to download. Otherwise, choose the same resolution you would without passing any options to the function.

  1. Show a better error message

If the user specifies a format that's also a value in self._video_extensions, tell them they should try an integer instead and show the list of integers and video resolutions they should try.

Would be happy to submit a pull request, just curious about what you think the interface should look like.

Kevin

@tomxtobin
Copy link

@tomxtobin tomxtobin commented Apr 19, 2013

I'm puzzled, too, as to why there isn't a simple "download the best quality version of format X" option, instead of needing to specify numerical codes.

I work around it with the following shell script which I've called youtube-mp4, which always grabs the best available MP4 file:

#!/bin/sh
youtube-dl -f $(youtube-dl -F $1 | grep -E 'mp4' -m 1 | grep -E '^[0-9]+' -o) $1

You could generalize the script to accept a format parameter, but I'm only ever interested in MP4.

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Jan 26, 2015

This has been supported for some time. Currently 'mp4', 'flv', 'webm', '3gp', 'm4a', 'mp3', 'ogg', 'aac' and 'wav' are supported. Thanks for the report!

If you find some common extension that is not recognized, feel free to open a new issue or submit a PR.

@jaimeMF jaimeMF closed this Jan 26, 2015
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
3 participants
You can’t perform that action at this time.