mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-02 14:37:21 +00:00
pythonic way to get the format_index
This commit is contained in:
parent
dcefdfe508
commit
feaefd8ec6
|
@ -181,11 +181,7 @@ def real_download(self, filename, info_dict):
|
|||
ie = NiconicoIE(self.ydl)
|
||||
|
||||
video_id = info_dict['id']
|
||||
|
||||
# Get format index
|
||||
for format_index, fmt in enumerate(info_dict['formats']):
|
||||
if fmt['format_id'] == info_dict['format_id']:
|
||||
break
|
||||
format_index = next((i for i, fmt in enumerate(info_dict['formats']) if fmt['format_id'] == info_dict['format_id']))
|
||||
|
||||
# Get video info
|
||||
total_duration = 0
|
||||
|
|
Loading…
Reference in a new issue