From 89d2da958bac7cd7129a13d3d22c85ba11e3c36b Mon Sep 17 00:00:00 2001 From: anthony lloyd Date: Sun, 10 Jul 2022 03:03:03 +1000 Subject: [PATCH] tweaks --- .config.template.toml | 4 ++-- TTS/engine_wrapper.py | 2 +- reddit/subreddit.py | 6 ++---- video_creation/final_video.py | 2 ++ 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.config.template.toml b/.config.template.toml index 192ae3d..ceb59c2 100644 --- a/.config.template.toml +++ b/.config.template.toml @@ -6,9 +6,9 @@ password = { optional = false, example = "fFAGRNJru1FTz70BzhT3Zg", explanation = 2fa = { optional = true, example = "True", explanation = "Whether you have Reddit 2FA enabled, Valid options are True and False", default = false, options = [true, false], type = "bool" } [reddit.thread] -random = { optional = true, example = "True", explanation = "If set to no, it will ask you a thread link to extract the thread, if yes it will randomize it.", default = false, options = [true, false, ], type = "bool" } +random = { optional = true, example = "True", explanation = "If set to false, it will ask you a thread link to extract the thread, if true it will randomize it.", default = true, options = [true, false], type = "bool" } subreddit = { optional = false, example = "AskReddit", explanation = "what subreddit to pull posts from, the name of the sub, not the URL", default = "", nmin = 3, nmax = 21,regex = "[_0-9a-zA-Z]+$", oob_error = "A subreddit name HAS to be between 3 and 20 characters" } -post_id = { optional = true, example = "urdtfx", explanation = "Used if you want to use a specific post.", default = "", regex = "^((?!://|://)[+a-zA-Z])*$" } +post_id = { optional = true, example = "urdtfx", explanation = "Used if you want to use a specific post.", regex = "^((?!://|://)[+a-zA-Z])*$" } max_comment_length = { optional = false, example = 500, explanation = "max number of characters a comment can have. default is 500", default = 500, type = "int", nmin = 10, nmax = 10000, oob_error = "the max comment length should be between 10 and 10000" } post_lang = { optional = true, example = "es-cr", explanation = "The language you would like to translate to.", default = "" } sort = { optional = true, example = "hot ,top, relevance, new", explanation = "method of sorting threads", default = "top", options = ["hot", "top", "relevance", "new"] } diff --git a/TTS/engine_wrapper.py b/TTS/engine_wrapper.py index afc1efb..f50e29f 100644 --- a/TTS/engine_wrapper.py +++ b/TTS/engine_wrapper.py @@ -18,7 +18,7 @@ from utils.console import print_step, print_substep from utils.voice import sanitize_text from utils import settings -DEFAULT_MAX_LENGTH: int = 50 # video length variable +DEFAULT_MAX_LENGTH: int = 45 # video length variable class TTSEngine: diff --git a/reddit/subreddit.py b/reddit/subreddit.py index 3ad604c..c807df1 100644 --- a/reddit/subreddit.py +++ b/reddit/subreddit.py @@ -62,10 +62,8 @@ def get_subreddit_threads(POST_ID: str): if POST_ID: # would only be called if there are multiple queued posts submission = reddit.submission(id=POST_ID) - elif ( - settings.config["reddit"]["thread"]["post_id"] - and len(settings.config["reddit"]["thread"]["post_id"].split("+")) == 1 - ): + elif (settings.config["reddit"]["thread"]["post_id"] + and len(settings.config["reddit"]["thread"]["post_id"].split("+")) == 1): submission = reddit.submission(id=settings.config["reddit"]["thread"]["post_id"]) comment_type = settings.config["reddit"]["thread"]["sort"] diff --git a/video_creation/final_video.py b/video_creation/final_video.py index f1e1f96..7853014 100755 --- a/video_creation/final_video.py +++ b/video_creation/final_video.py @@ -38,6 +38,8 @@ def name_normalize(name: str) -> str: name = re.sub(r"(\w+)\s?\/\s?(\w+)", r"\1 or \2", name) name = re.sub(r"\/", r"", name) + name = name[0:140] + lang = settings.config["reddit"]["thread"]["post_lang"] if lang: print_substep("Translating filename...")