fix: perm removed praw async error
pull/418/head
Jason 3 years ago
parent ec4729bd06
commit 2b1f7183d4

@ -14,7 +14,7 @@ THEME="LIGHT"
# set to an int e.g. 1 or 29 and leave blank for once # set to an int e.g. 1 or 29 and leave blank for once
TIMES_TO_RUN="" TIMES_TO_RUN=""
MAX_COMMENT_LENGTH="500" MAX_COMMENT_LENGTH="500"
# Range is 0 -> 1 recommended around 0.8-1 # Range is 0 -> 1 recommended around 0.8-0.9
OPACITY="" OPACITY=""
# see TTSwrapper.py for all valid options # see TTSwrapper.py for all valid options

@ -1,8 +1,6 @@
import os
import time import time
from dotenv import load_dotenv from dotenv import load_dotenv
from os import system, getenv, name
from reddit.subreddit import get_subreddit_threads from reddit.subreddit import get_subreddit_threads
from utils.cleanup import cleanup from utils.cleanup import cleanup
from utils.console import print_markdown, print_step from utils.console import print_markdown, print_step
@ -36,16 +34,17 @@ def main():
def run_many(times): def run_many(times):
for x in range(times): for x in range(times):
x = x + 1
print_step( print_step(
f'on the {x}{("st" if x == 1 else ("nd" if x == 2 else ("rd" if x == 3 else "th")))} iteration') # correct 1st 2nd 3rd 4th 5th.... f'on the {x}{("st" if x == 1 else ("nd" if x == 2 else ("rd" if x == 3 else "th")))} iteration of {times}') # correct 1st 2nd 3rd 4th 5th....
os.system('cls' if os.name == 'nt' else 'clear') # clear terminal
main() main()
system('cls' if name == 'nt' else 'clear') # clear terminal
if __name__ == '__main__': if __name__ == '__main__':
try: try:
if os.getenv('TIMES_TO_RUN'): if getenv('TIMES_TO_RUN'):
run_many(int(os.getenv('TIMES_TO_RUN'))) run_many(int(getenv('TIMES_TO_RUN')))
else: else:
main() main()
except KeyboardInterrupt: except KeyboardInterrupt:

@ -31,7 +31,7 @@ def get_subreddit_threads():
passkey = getenv("REDDIT_PASSWORD") passkey = getenv("REDDIT_PASSWORD")
reddit = praw.Reddit(client_id=getenv("REDDIT_CLIENT_ID"), client_secret=getenv("REDDIT_CLIENT_SECRET"), reddit = praw.Reddit(client_id=getenv("REDDIT_CLIENT_ID"), client_secret=getenv("REDDIT_CLIENT_SECRET"),
user_agent="Accessing Reddit threads", username=getenv("REDDIT_USERNAME"), user_agent="Accessing Reddit threads", username=getenv("REDDIT_USERNAME"),
passkey=passkey, ) passkey=passkey, check_for_async=False,)
""" """
Ask user for subreddit input Ask user for subreddit input
""" """

@ -1 +1,2 @@
videos.json videos.json
#todo add videos on github

Loading…
Cancel
Save