stops it from ever happening again
This commit is contained in:
Jason committed 2022-06-18 19:47:40 -04:00
1 parent 894bc306c3
commit 886b8114a5
2 files changed
+9 -2

No files matched your search

+1 -1
View File
@@ -19,7 +19,7 @@ THEME="LIGHT"
# used if you want to run multiple times. set to an int e.g. 4 or 29 and leave blank for 1
TIMES_TO_RUN=""
# max number of characters a comment can have.
MAX_COMMENT_LENGTH="500"
MAX_COMMENT_LENGTH="500" # default is 500
# Range is 0 -> 1 recommended around 0.8-0.9
OPACITY="1"
+8 -1
View File
@@ -15,6 +15,13 @@ def textify(text):
return "".join(filter(TEXT_WHITELIST.__contains__, text))
def try_env(param, backup):
try:
return environ[param]
except KeyError:
return backup
def get_subreddit_threads():
"""
Returns a list of threads from the AskReddit subreddit.
@@ -89,7 +96,7 @@ def get_subreddit_threads():
if top_level_comment.body in ["[removed]", "[deleted]"]:
continue # # see https://github.com/JasonLovesDoggo/RedditVideoMakerBot/issues/78
if not top_level_comment.stickied:
if len(top_level_comment.body) <= int(environ["MAX_COMMENT_LENGTH"]):
if len(top_level_comment.body) <= int(try_env("MAX_COMMENT_LENGTH", 500)):
content["comments"].append(
{
"comment_body": top_level_comment.body,