mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-21 20:46:36 -05:00
YoutubeIE: use a negative index when accessing the last element of the format list
This commit is contained in:
parent
bcd6e4bd07
commit
d828f3a550
1 changed files with 1 additions and 1 deletions
|
@ -586,7 +586,7 @@ def _real_extract(self, url):
|
||||||
if req_format is None or req_format == 'best':
|
if req_format is None or req_format == 'best':
|
||||||
video_url_list = [(existing_formats[0], url_map[existing_formats[0]])] # Best quality
|
video_url_list = [(existing_formats[0], url_map[existing_formats[0]])] # Best quality
|
||||||
elif req_format == 'worst':
|
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'):
|
elif req_format in ('-1', 'all'):
|
||||||
video_url_list = [(f, url_map[f]) for f in existing_formats] # All formats
|
video_url_list = [(f, url_map[f]) for f in existing_formats] # All formats
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue