]> jfr.im git - yt-dlp.git/commitdiff
Fix live title for multiple formats
authorpukkandan <redacted>
Sat, 1 Jan 2022 21:33:26 +0000 (03:03 +0530)
committerpukkandan <redacted>
Sat, 1 Jan 2022 21:33:26 +0000 (03:03 +0530)
yt_dlp/YoutubeDL.py

index 9cec43680771ddf4022287f3a90647a5cfd09d8a..9ab8d7f08d5b3a7725978ae5ba9605d1677136c6 100644 (file)
@@ -2375,6 +2375,8 @@ def sanitize_numeric_fields(info):
         if info_dict.get('is_live'):
             get_from_start = bool(self.params.get('live_from_start'))
             formats = [f for f in formats if bool(f.get('is_from_start')) == get_from_start]
+            if not get_from_start:
+                info_dict['title'] += ' ' + datetime.datetime.now().strftime('%Y-%m-%d %H:%M')
 
         if not formats:
             self.raise_no_formats(info_dict)
@@ -2712,9 +2714,6 @@ def process_info(self, info_dict):
             if self._num_downloads >= int(max_downloads):
                 raise MaxDownloadsReached()
 
-        if info_dict.get('is_live') and not self.params.get('live_from_start'):
-            info_dict['title'] += ' ' + datetime.datetime.now().strftime('%Y-%m-%d %H:%M')
-
         # TODO: backward compatibility, to be removed
         info_dict['fulltitle'] = info_dict['title']