Fix live title for multiple formats

This commit is contained in:
pukkandan 2022-01-02 03:03:26 +05:30
parent b8e976a445
commit 4c922dd3fc
No known key found for this signature in database
GPG Key ID: 0F00D95A001F4698
1 changed files with 2 additions and 3 deletions

View File

@ -2375,6 +2375,8 @@ class YoutubeDL(object):
if info_dict.get('is_live'): if info_dict.get('is_live'):
get_from_start = bool(self.params.get('live_from_start')) 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] 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: if not formats:
self.raise_no_formats(info_dict) self.raise_no_formats(info_dict)
@ -2712,9 +2714,6 @@ class YoutubeDL(object):
if self._num_downloads >= int(max_downloads): if self._num_downloads >= int(max_downloads):
raise MaxDownloadsReached() 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 # TODO: backward compatibility, to be removed
info_dict['fulltitle'] = info_dict['title'] info_dict['fulltitle'] = info_dict['title']