]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/utils/_utils.py
Bugfix for b4e0d75848e9447cee2cd3646ce54d4744a7ff56
[yt-dlp.git] / yt_dlp / utils / _utils.py
index 10052009fcc5b3991ba74bbb430f0e73031e6215..de51f62083179d5d854d117954867fc08b57667f 100644 (file)
@@ -3758,8 +3758,6 @@ def __init__(self, chapters, ranges, from_info=False):
         self.chapters, self.ranges, self.from_info = chapters, ranges, from_info
 
     def __call__(self, info_dict, ydl):
-        if not any((self.ranges, self.chapters, self.from_info)):
-            yield {}
 
         warning = ('There are no chapters matching the regex' if info_dict.get('chapters')
                    else 'Cannot match chapters since chapter information is unavailable')
@@ -3779,9 +3777,11 @@ def __call__(self, info_dict, ydl):
 
         if self.from_info and (info_dict.get('start_time') or info_dict.get('end_time')):
             yield {
-                'start_time': info_dict.get('start_time'),
-                'end_time': info_dict.get('end_time'),
+                'start_time': info_dict.get('start_time') or 0,
+                'end_time': info_dict.get('end_time') or float('inf'),
             }
+        elif not self.ranges and not self.chapters:
+            yield {}
 
     @staticmethod
     def _handle_negative_timestamp(time, info):