diff --git a/.config.template.toml b/.config.template.toml index 1060a09..32c0f7a 100644 --- a/.config.template.toml +++ b/.config.template.toml @@ -16,7 +16,7 @@ subreddit = { optional = false, regex = "[_0-9a-zA-Z]+$", nmin = 3, nmax = 21, e post_id = { optional = true, default = "", regex = "^((?!://|://)[+a-zA-Z])*$", explanation = "Used if you want to use a specific post.", example = "urdtfx" } max_comment_length = { default = 500, optional = false, nmin = 10, nmax = 10000, type = "int", explanation = "max number of characters a comment can have. default is 500", example = 500, oob_error = "the max comment length should be between 10 and 10000" } post_lang = { default = "", optional = true, explanation = "The language you would like to translate to.", example = "es-cr" } - +min_comments = { default = 20, optional = false, nmin = 15, nmax = 999999, type = "int", explanation = "The minimum number of comments a post should have to be included. default is 20", example = 29, oob_error = "the minimum number of comments should be between 15 and 999999" } [settings] allow_nsfw = { optional = false, type = "bool", default = false, example = false, options = [true, false, diff --git a/main.py b/main.py index 41ae8e1..0dbd2c9 100755 --- a/main.py +++ b/main.py @@ -16,7 +16,7 @@ from video_creation.final_video import make_final_video from video_creation.screenshot_downloader import download_screenshots_of_reddit_posts from video_creation.voices import save_text_to_mp3 -VERSION = "2.2.9" +VERSION = "2.2.10" print( """ ██████╗ ███████╗██████╗ ██████╗ ██╗████████╗ ██╗ ██╗██╗██████╗ ███████╗ ██████╗ ███╗ ███╗ █████╗ ██╗ ██╗███████╗██████╗ diff --git a/utils/subreddit.py b/utils/subreddit.py index 48dceba..6f9ed49 100644 --- a/utils/subreddit.py +++ b/utils/subreddit.py @@ -34,6 +34,9 @@ def get_subreddit_undone(submissions: list, subreddit): if submission.stickied: print_substep("This post was pinned by moderators. Skipping...") continue + if submission.num_comments < int(settings.config["reddit"]['thread']["min_comments"]): + print_substep(f'This post has under the specified minimum of comments ({settings.config["reddit"]["thread"]["min_comments"]}). Skipping...') + continue return submission print("all submissions have been done going by top submission order") return get_subreddit_undone( diff --git a/video_creation/final_video.py b/video_creation/final_video.py index de53a7a..264c5af 100755 --- a/video_creation/final_video.py +++ b/video_creation/final_video.py @@ -54,7 +54,6 @@ def make_final_video(number_of_clips: int, length: int, reddit_obj: dict, backgr #except (TypeError, KeyError): # print('No background audio volume found in config.toml. Using default value of 1.') # VOLUME_MULTIPLIER = 1 - print_step("Creating the final video 🎥") VideoFileClip.reW = lambda clip: clip.resize(width=W) VideoFileClip.reH = lambda clip: clip.resize(width=H) diff --git a/video_creation/voices.py b/video_creation/voices.py index 74894eb..ac33dd7 100644 --- a/video_creation/voices.py +++ b/video_creation/voices.py @@ -45,7 +45,6 @@ def save_text_to_mp3(reddit_obj) -> Tuple[int, int]: break print("Unknown Choice") text_to_mp3 = TTSEngine(get_case_insensitive_key_value(TTSProviders, choice), reddit_obj) - return text_to_mp3.run()