From 0dc32154f2ccce46daf1d5751a9d4f5426e6c5bc Mon Sep 17 00:00:00 2001 From: Callum Leslie Date: Sat, 4 Jun 2022 16:16:02 +0100 Subject: [PATCH] Code was placed in the wrong place --- main.py | 6 ++++++ video_creation/final_video.py | 6 +----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/main.py b/main.py index fc12206..3bc6c83 100644 --- a/main.py +++ b/main.py @@ -30,6 +30,12 @@ for val in REQUIRED_VALUES: print(f"Please set the variable \"{val}\" in your .env file.") configured = False +try: + float(os.getenv("OPACITY")) +except: + print(f"Please ensure that OPACITY is set between 0 and 1 in your .env file") + configured = False + if configured: reddit_object = get_subreddit_threads() length, number_of_comments = save_text_to_mp3(reddit_object) diff --git a/video_creation/final_video.py b/video_creation/final_video.py index 0a2afb0..1933db3 100644 --- a/video_creation/final_video.py +++ b/video_creation/final_video.py @@ -30,11 +30,7 @@ def make_final_video(number_of_clips): .resize(height=H) .crop(x1=1166.6, y1=0, x2=2246.6, y2=1920) ) - try: - float(os.getenv("OPACITY")) - except: - print(f"Please ensure that OPACITY is set between 0 and 1 in your .env file") - configured = False + # Gather all audio clips audio_clips = [] for i in range(0, number_of_clips):