diff --git a/cli.py b/cli.py index 1851243..893e3c2 100644 --- a/cli.py +++ b/cli.py @@ -56,8 +56,7 @@ def program_options(): try: if args.create: - trial = 0 - while trial < 3: + while True: create = main( args.subreddit, args.background, @@ -68,7 +67,6 @@ def program_options(): if not create: try_again = input("Something went wrong! Try again? [y/N] > ").strip() if try_again in ["y", "Y"]: - trial += 1 continue break diff --git a/reddit/subreddit.py b/reddit/subreddit.py index 2ee9235..aac0b90 100644 --- a/reddit/subreddit.py +++ b/reddit/subreddit.py @@ -10,7 +10,6 @@ from prawcore.exceptions import ( BadRequest ) from dotenv import load_dotenv -from rich.console import Console from utils.console import print_step, print_substep @@ -24,8 +23,6 @@ def get_subreddit_threads(subreddit_, thread_link_, number_of_comments): Returns a list of threads from the AskReddit subreddit. """ - console = Console() - global submission load_dotenv() @@ -54,11 +51,11 @@ def get_subreddit_threads(subreddit_, thread_link_, number_of_comments): RequestException, BadRequest ): - console.print( + print_substep( "[bold red]There is something wrong with the .env file, kindly check:[/bold red]\n" + "1. ClientID\n" + "2. ClientSecret\n" - + "3. If these variables are fine, kindly check other variables." + + "3. If these variables are fine, kindly check other variables.\n" + "4. Check if the type of Reddit app created is script (personal use script)." ) diff --git a/video_creation/background.py b/video_creation/background.py index d328f82..74f1062 100644 --- a/video_creation/background.py +++ b/video_creation/background.py @@ -66,9 +66,9 @@ def download_background(background): print_substep("Background video downloaded successfully!", style_="bold green") cancel = False - if cancel: - # to prevent further error and processes from happening - raise SystemExit() + if cancel: + # to prevent further error and processes from happening + raise SystemExit() def chop_background_video(video_length): diff --git a/video_creation/final_video.py b/video_creation/final_video.py index 585e6bf..3a738ae 100644 --- a/video_creation/final_video.py +++ b/video_creation/final_video.py @@ -18,7 +18,6 @@ from utils.console import print_step, print_substep def make_final_video(number_of_clips, file_name): load_dotenv() - opacity = os.getenv("OPACITY") print_step("Creating the final video...")