Merge pull request #5523 from jaimeMF/remove-format-limit
Remove the --max-quality option
This commit is contained in:
commit
40b96352c9
7 changed files with 2 additions and 59 deletions
|
@ -64,7 +64,6 @@ from .utils import (
|
|||
sanitize_path,
|
||||
std_headers,
|
||||
subtitles_filename,
|
||||
takewhile_inclusive,
|
||||
UnavailableVideoError,
|
||||
url_basename,
|
||||
version_tuple,
|
||||
|
@ -135,7 +134,6 @@ class YoutubeDL(object):
|
|||
(or video) as a single JSON line.
|
||||
simulate: Do not download the video files.
|
||||
format: Video format code. See options.py for more information.
|
||||
format_limit: Highest quality format to try.
|
||||
outtmpl: Template for output names.
|
||||
restrictfilenames: Do not allow "&" and spaces in file names
|
||||
ignoreerrors: Do not stop on download errors.
|
||||
|
@ -1068,12 +1066,6 @@ class YoutubeDL(object):
|
|||
full_format_info.update(format)
|
||||
format['http_headers'] = self._calc_headers(full_format_info)
|
||||
|
||||
format_limit = self.params.get('format_limit', None)
|
||||
if format_limit:
|
||||
formats = list(takewhile_inclusive(
|
||||
lambda f: f['format_id'] != format_limit, formats
|
||||
))
|
||||
|
||||
# TODO Central sorting goes here
|
||||
|
||||
if formats[0] is not info_dict:
|
||||
|
|
|
@ -283,7 +283,6 @@ def _real_main(argv=None):
|
|||
'simulate': opts.simulate or any_getting,
|
||||
'skip_download': opts.skip_download,
|
||||
'format': opts.format,
|
||||
'format_limit': opts.format_limit,
|
||||
'listformats': opts.listformats,
|
||||
'outtmpl': outtmpl,
|
||||
'autonumber_size': opts.autonumber_size,
|
||||
|
|
|
@ -331,10 +331,6 @@ def parseOpts(overrideArguments=None):
|
|||
'--prefer-free-formats',
|
||||
action='store_true', dest='prefer_free_formats', default=False,
|
||||
help='Prefer free video formats unless a specific one is requested')
|
||||
video_format.add_option(
|
||||
'--max-quality',
|
||||
action='store', dest='format_limit', metavar='FORMAT',
|
||||
help='Highest quality format to download')
|
||||
video_format.add_option(
|
||||
'-F', '--list-formats',
|
||||
action='store_true', dest='listformats',
|
||||
|
|
|
@ -1128,15 +1128,6 @@ def shell_quote(args):
|
|||
return ' '.join(quoted_args)
|
||||
|
||||
|
||||
def takewhile_inclusive(pred, seq):
|
||||
""" Like itertools.takewhile, but include the latest evaluated element
|
||||
(the first element so that Not pred(e)) """
|
||||
for e in seq:
|
||||
yield e
|
||||
if not pred(e):
|
||||
return
|
||||
|
||||
|
||||
def smuggle_url(url, data):
|
||||
""" Pass additional data in a URL for internal use. """
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue