fix: skip comments that are blank after sanitisation

This commit is contained in:
Callum Leslie committed 2022-07-11 17:52:12 +01:00
1 parent c617af98ce
commit 29de549ef3
1 file changed
+4
+4
View File
@@ -7,6 +7,7 @@ from praw.models import MoreComments
from utils.console import print_step, print_substep
from utils.subreddit import get_subreddit_undone
from utils.videos import check_done
from utils.voice import sanitize_text
def get_subreddit_threads(POST_ID: str):
@@ -95,6 +96,9 @@ def get_subreddit_threads(POST_ID: str):
if top_level_comment.body in ["[removed]", "[deleted]"]:
continue # # see https://github.com/JasonLovesDoggo/RedditVideoMakerBot/issues/78
if not top_level_comment.stickied:
sanitised = sanitize_text(top_level_comment.body)
if not sanitised or sanitised != " ":
continue
if len(top_level_comment.body) <= int(
settings.config["reddit"]["thread"]["max_comment_length"]
):