aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/YoutubeDL.py
diff options
context:
space:
mode:
Diffstat (limited to 'youtube_dl/YoutubeDL.py')
-rw-r--r--youtube_dl/YoutubeDL.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py
index f22a8bd0e..fd98321f1 100644
--- a/youtube_dl/YoutubeDL.py
+++ b/youtube_dl/YoutubeDL.py
@@ -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: