playlist_bot.py
def create_playlist(self, submission):
        """ For a reddit submission, create an associated youtube playlist """

        logging.info("--- EXECUTING FUNCTION CREATE_PLAYLIST FOR CLASS PLAYLISTBOT ---")

        youtube_links = []

        # submission.replace_more_comments(limit=None, threshold=0)
        all_comments = submission.comments
        # imported from praw.helpers
        flat_comments = flatten_tree(all_comments)

        for comment in flat_comments:
            if type(comment) != MoreComments and comment.score >= MINIMUM_COMMENT_UPVOTES:
                links_in_comment = YOUTUBE_REGEX.findall(comment.body)
                if links_in_comment:
                    youtube_links = youtube_links + links_in_comment

        new_playlist = Playlist(submission)
        for video_id in youtube_links:
            logging.info("Adding Video " + str(video_id) + " to Playlist - " + submission.title)
            new_playlist.add_video(video_id)

        return new_playlist
 For a reddit submission, create an associated youtube playlist 
For a reddit submission, create an associated youtube playlist
For a reddit submission create an associated youtube playlist
def create_playlist(self, submission):
        logging.info("--- EXECUTING FUNCTION CREATE_PLAYLIST FOR CLASS PLAYLISTBOT ---")
        youtube_links = []
        all_comments = submission.comments
        flat_comments = flatten_tree(all_comments)
        for comment in flat_comments:
            if type(comment) != MoreComments and comment.score >= MINIMUM_COMMENT_UPVOTES:
                links_in_comment = YOUTUBE_REGEX.findall(comment.body)
                if links_in_comment:
                    youtube_links = youtube_links + links_in_comment
        new_playlist = Playlist(submission)
        for video_id in youtube_links:
            logging.info("Adding Video " + str(video_id) + " to Playlist - " + submission.title)
            new_playlist.add_video(video_id)
        return new_playlist
def create_playlist ( self , submission ) : logging . info ( "--- EXECUTING FUNCTION CREATE_PLAYLIST FOR CLASS PLAYLISTBOT ---" ) youtube_links = [ ] all_comments = submission . comments flat_comments = flatten_tree ( all_comments ) for comment in flat_comments : if type ( comment ) != MoreComments and comment . score >= MINIMUM_COMMENT_UPVOTES : links_in_comment = YOUTUBE_REGEX . findall ( comment . body ) if links_in_comment : youtube_links = youtube_links + links_in_comment new_playlist = Playlist ( submission ) for video_id in youtube_links : logging . info ( "Adding Video " + str ( video_id ) + " to Playlist - " + submission . title ) new_playlist . add_video ( video_id ) return new_playlist
For a reddit submission, create an associated youtube playlist
For a reddit submission create an associated youtube playlist
""" For a reddit submission, create an associated youtube playlist """ # submission.replace_more_comments(limit=None, threshold=0) # imported from praw.helpers
self
submission