Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def set_rss(self, youtube_id):
"""Can be called by anything; called frequently by
downloads.VideoDownloader.extract_stdout_data().
Set the RSS feed, but only if it's not already set (to save time).
Args:
youtube_id (str): The YouTube channel or playlist ID
"""
if not self.rss:
if isinstance(self, Channel):
self.rss = utils.convert_youtube_id_to_rss(
'channel',
youtube_id,
)
else:
self.rss = utils.convert_youtube_id_to_rss(
'playlist',
youtube_id,
)
+ ' LIVE = livestream started',
)
if self.live_mode == 1:
live_str = '<' + _('WAITING') + '>'
elif self.live_mode == 2:
live_str = '<' + _('LIVE') + '>'
else:
live_str = ''
text \
= ' #' + str(self.dbid) + live_str + ': ' + self.name + '\n\n'
if self.parent_obj:
if isinstance(self.parent_obj, Channel):
text += _('Channel:') + ' '
elif isinstance(self.parent_obj, Playlist):
text += _('Playlist:') + ' '
else:
text += _('Folder:') + ' '
text += self.parent_obj.name + '\n\n'
translate_note = _(
'TRANSLATOR\'S NOTE 2: Source = video/channel/playlist URL',
)
text += _('Source:') + '\n'
if self.source is None:
text += '<' + _('unknown') + '>'
else: