pull/915/head
anthony lloyd 3 years ago
parent 3b1ae5d47d
commit 89d2da958b

@ -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"] }

@ -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:

@ -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"]

@ -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...")

Loading…
Cancel
Save