ytdl-org / youtube-dl

Command-line program to download videos from YouTube.com and other video sites
http://ytdl-org.github.io/youtube-dl/
The Unlicense
132.39k stars 10.04k forks source link

--max-quality ignored when used without -f #5508

Closed Tailszefox closed 9 years ago

Tailszefox commented 9 years ago

Example:

$ youtube-dl -F https://www.youtube.com/watch\?v\=lYePxF7CJ6I                                                                                                                                                                           
[youtube] lYePxF7CJ6I: Downloading webpage
[youtube] lYePxF7CJ6I: Extracting video information
[youtube] lYePxF7CJ6I: Downloading DASH manifest
[info] Available formats for lYePxF7CJ6I:
format code  extension  resolution note
171          webm       audio only DASH audio  126k , audio@128k (44100Hz), 5.42MiB
140          m4a        audio only DASH audio  129k , m4a_dash container, aac  @128k (44100Hz), 6.14MiB
141          m4a        audio only DASH audio  255k , m4a_dash container, aac  @256k (44100Hz), 12.19MiB
160          mp4        256x144    DASH video  120k , 15fps, video only, 4.61MiB
278          webm       256x144    DASH video  134k , webm container, VP9, 15fps, video only, 3.03MiB
133          mp4        426x240    DASH video  274k , 30fps, video only, 9.92MiB
242          webm       426x240    DASH video  289k , 30fps, video only, 5.67MiB
243          webm       640x360    DASH video  485k , 30fps, video only, 10.02MiB
134          mp4        640x360    DASH video  603k , 30fps, video only, 11.21MiB
244          webm       854x480    DASH video  851k , 30fps, video only, 16.15MiB
135          mp4        854x480    DASH video 1109k , 30fps, video only, 20.30MiB
302          webm       1280x720   DASH video 2678k , VP9, 60fps, video only, 41.82MiB
298          mp4        1280x720   DASH video 3310k , h264, 60fps, video only, 61.45MiB
303          webm       1920x1080  DASH video 4966k , VP9, 60fps, video only, 79.56MiB
299          mp4        1920x1080  DASH video 5523k , h264, 60fps, video only, 107.74MiB
17           3gp        176x144    
36           3gp        320x240    
5            flv        400x240    
43           webm       640x360    
18           mp4        640x360    
22           mp4        1280x720   (best)
$ youtube-dl --max-quality 99 https://www.youtube.com/watch\?v\=lYePxF7CJ6I                                                                                                                                                             
[youtube] lYePxF7CJ6I: Downloading webpage
[youtube] lYePxF7CJ6I: Extracting video information
[youtube] lYePxF7CJ6I: Downloading DASH manifest
[download] Destination: LGR - Operation Frog - C64 Game Review-lYePxF7CJ6I.f299.mp4
[download] 100% of 107.74MiB in 01:15
[download] Destination: LGR - Operation Frog - C64 Game Review-lYePxF7CJ6I.f141.m4a
[download] 100% of 12.19MiB in 00:11
[ffmpeg] Merging formats into "LGR - Operation Frog - C64 Game Review-lYePxF7CJ6I.mp4"

Despite asking for a max-quality of 99 (ie everything that isn't DASH), I still get the 299 and 141 qualities.

This is regardless of the video or the argument passed to --max-quality:

$ youtube-dl --max-quality 199 https://www.youtube.com/watch\?v\=g1zerc7crGM                                                                                                                                                            
[youtube] g1zerc7crGM: Downloading webpage
[youtube] g1zerc7crGM: Extracting video information
[youtube] g1zerc7crGM: Downloading DASH manifest
[download] Destination: LGR - SimCity BuildIt Review-g1zerc7crGM.f299.mp4
[download] 100% of 155.75MiB in 01:51
[download] Destination: LGR - SimCity BuildIt Review-g1zerc7crGM.f141.m4a
[download] 100% of 11.06MiB in 00:15
[ffmpeg] Merging formats into "LGR - SimCity BuildIt Review-g1zerc7crGM.mp4"
Deleting original file LGR - SimCity BuildIt Review-g1zerc7crGM.f299.mp4 (pass -k to keep)
Deleting original file LGR - SimCity BuildIt Review-g1zerc7crGM.f141.m4a (pass -k to keep)

Using -f best seems to make --max-quality actually be taken into account:

$ youtube-dl --max-quality 43 -f best https://www.youtube.com/watch\?v\=lYePxF7CJ6I                                                                                                                                                     
[youtube] lYePxF7CJ6I: Downloading webpage
[youtube] lYePxF7CJ6I: Extracting video information
[youtube] lYePxF7CJ6I: Downloading DASH manifest
[download] Destination: LGR - Operation Frog - C64 Game Review-lYePxF7CJ6I.webm

All that being said, I realize that --max-quality is pretty much made obsolete by the new capabilities of -f. However, the option is still mentioned in the docs and help text, and simply gets ignored when used on its own, which is confusing.

The most simple way to solve this, I think, would be to simply remove the option, or mark it as deprecated. Maybe emit a warning or error when it's used, and ask the user to use -f instead.

jaimeMF commented 9 years ago

We've removed the option, you'll have to use -f best[<somefilter>] in the next version. Thanks for the report.