Extend #980 with --max-quality support
This commit is contained in:
parent
5d254f776a
commit
f4d96df0f1
4 changed files with 55 additions and 5 deletions
|
@ -488,7 +488,9 @@ class YoutubeDL(object):
|
|||
|
||||
format_limit = self.params.get('format_limit', None)
|
||||
if format_limit:
|
||||
formats = [f for f in formats if f['format_id'] <= format_limit]
|
||||
formats = list(takewhile_inclusive(
|
||||
lambda f: f['format_id'] != format_limit, formats
|
||||
))
|
||||
if self.params.get('prefer_free_formats'):
|
||||
def _free_formats_key(f):
|
||||
try:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue