mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2024-11-19 20:10:25 +00:00
filter?
This commit is contained in:
parent
080c5d48ed
commit
72c431725a
@ -1311,7 +1311,7 @@ class YoutubeDL(object):
|
|||||||
# or video only (imgur)) we will fallback to best/worst
|
# or video only (imgur)) we will fallback to best/worst
|
||||||
# {video,audio}-only format
|
# {video,audio}-only format
|
||||||
elif ctx['incomplete_formats']:
|
elif ctx['incomplete_formats']:
|
||||||
return list(fmts)[format_idx]
|
return fmts[format_idx]
|
||||||
|
|
||||||
formats = list(ctx['formats'])
|
formats = list(ctx['formats'])
|
||||||
if not formats:
|
if not formats:
|
||||||
@ -1336,7 +1336,7 @@ class YoutubeDL(object):
|
|||||||
filter_f = lambda f: f['ext'] == format_spec
|
filter_f = lambda f: f['ext'] == format_spec
|
||||||
else:
|
else:
|
||||||
filter_f = lambda f: f['format_id'] == format_spec
|
filter_f = lambda f: f['format_id'] == format_spec
|
||||||
formats = best_worst(filter(filter_f, formats))
|
formats = best_worst(list(filter(filter_f, formats)))
|
||||||
for f in variadic(formats or []):
|
for f in variadic(formats or []):
|
||||||
yield f
|
yield f
|
||||||
elif selector.type == MERGE:
|
elif selector.type == MERGE:
|
||||||
|
Loading…
Reference in New Issue
Block a user