From 054cc84186b75e1ea58169a0e2f8baac8f9b8573 Mon Sep 17 00:00:00 2001 From: null3000 <76852813+null3000@users.noreply.github.com> Date: Fri, 10 Jun 2022 23:15:19 +0200 Subject: [PATCH 1/2] Update subreddit.py --- reddit/subreddit.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/reddit/subreddit.py b/reddit/subreddit.py index c560293..a448dcd 100644 --- a/reddit/subreddit.py +++ b/reddit/subreddit.py @@ -67,13 +67,14 @@ def get_subreddit_threads(): for top_level_comment in submission.comments: if not top_level_comment.stickied: - content["comments"].append( - { - "comment_body": top_level_comment.body, - "comment_url": top_level_comment.permalink, - "comment_id": top_level_comment.id, - } - ) + if not comment.author == None: + content["comments"].append( + { + "comment_body": top_level_comment.body, + "comment_url": top_level_comment.permalink, + "comment_id": top_level_comment.id, + } + ) except AttributeError as e: pass From d907dc79177124e5e6d42ed78129816bbf10fd0e Mon Sep 17 00:00:00 2001 From: null3000 <76852813+null3000@users.noreply.github.com> Date: Mon, 13 Jun 2022 14:03:14 -0700 Subject: [PATCH 2/2] fixed error --- reddit/subreddit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reddit/subreddit.py b/reddit/subreddit.py index a448dcd..b01b058 100644 --- a/reddit/subreddit.py +++ b/reddit/subreddit.py @@ -67,7 +67,7 @@ def get_subreddit_threads(): for top_level_comment in submission.comments: if not top_level_comment.stickied: - if not comment.author == None: + if not top_level_comment.author == None: content["comments"].append( { "comment_body": top_level_comment.body,