aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>2013-07-01 17:19:33 +0200
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>2013-07-01 17:19:33 +0200
commitd828f3a5500b29f30c702e6aa34add6e29370b2e (patch)
tree27be3fb878969d9a08251191ebcc1169ec64b6e0
parentbcd6e4bd07fb924e3de37ed46f21c46debdebaa8 (diff)
YoutubeIE: use a negative index when accessing the last element of the format list
-rw-r--r--youtube_dl/extractor/youtube.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/youtube_dl/extractor/youtube.py b/youtube_dl/extractor/youtube.py
index 656f46f21..6782bbff6 100644
--- a/youtube_dl/extractor/youtube.py
+++ b/youtube_dl/extractor/youtube.py
@@ -586,7 +586,7 @@ class YoutubeIE(InfoExtractor):
if req_format is None or req_format == 'best':
video_url_list = [(existing_formats[0], url_map[existing_formats[0]])] # Best quality
elif req_format == 'worst':
- video_url_list = [(existing_formats[len(existing_formats)-1], url_map[existing_formats[len(existing_formats)-1]])] # worst quality
+ video_url_list = [(existing_formats[-1], url_map[existing_formats[-1]])] # worst quality
elif req_format in ('-1', 'all'):
video_url_list = [(f, url_map[f]) for f in existing_formats] # All formats
else: