]> jfr.im git - yt-dlp.git/commitdiff
[Sponsorblock] Don't crash when duration is unknown
authorpukkandan <redacted>
Sat, 23 Apr 2022 16:45:00 +0000 (22:15 +0530)
committerpukkandan <redacted>
Sat, 23 Apr 2022 17:15:42 +0000 (22:45 +0530)
CLoses #3529

yt_dlp/postprocessor/sponsorblock.py

index 7749ffe054527d1c02eb1d54cfa73d6a20f25c83..7f75561dbd106b0818cc803ec3f68eadc4ab0676 100644 (file)
@@ -38,7 +38,7 @@ def run(self, info):
             return [], info
 
         self.to_screen('Fetching SponsorBlock segments')
-        info['sponsorblock_chapters'] = self._get_sponsor_chapters(info, info['duration'])
+        info['sponsorblock_chapters'] = self._get_sponsor_chapters(info, info.get('duration'))
         return [], info
 
     def _get_sponsor_chapters(self, info, duration):