How to use the tartube.media.Channel function in tartube

To help you get started, we’ve selected a few tartube examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github axcore / tartube / tartube / media.py View on Github external
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,
                )
github axcore / tartube / tartube / media.py View on Github external
+ ' 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: