From c45a2262b390c8996aff0c85433c248f1432e1f4 Mon Sep 17 00:00:00 2001 From: iaacornus Date: Wed, 8 Jun 2022 12:14:12 +0800 Subject: [PATCH] avoid thread with zero comments as perhaps the reason to #376 --- reddit/subreddit.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/reddit/subreddit.py b/reddit/subreddit.py index aac0b90..e74a385 100644 --- a/reddit/subreddit.py +++ b/reddit/subreddit.py @@ -100,6 +100,11 @@ def get_subreddit_threads(subreddit_, thread_link_, number_of_comments): except FileNotFoundError: break + if len(submission.comments) == 0: + print_substep( + "The thread do not contain any comments. Searching for new one.", style_="bold" + ) + print_substep(f"Video will be: [cyan]{submission.title}[/cyan] :thumbsup:") try: