mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-01-09 03:55:55 +01: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)
|
ie = NiconicoIE(self.ydl)
|
||||||
|
|
||||||
video_id = info_dict['id']
|
video_id = info_dict['id']
|
||||||
|
format_index = next((i for i, fmt in enumerate(info_dict['formats']) if fmt['format_id'] == info_dict['format_id']))
|
||||||
# Get format index
|
|
||||||
for format_index, fmt in enumerate(info_dict['formats']):
|
|
||||||
if fmt['format_id'] == info_dict['format_id']:
|
|
||||||
break
|
|
||||||
|
|
||||||
# Get video info
|
# Get video info
|
||||||
total_duration = 0
|
total_duration = 0
|
||||||
|
Loading…
Reference in New Issue
Block a user