From dab3e64fef0eaf4ff06a434967cda0d309fb6718 Mon Sep 17 00:00:00 2001 From: Jason Date: Thu, 7 Jul 2022 21:35:41 -0400 Subject: [PATCH] style: reformatted. --- utils/subreddit.py | 4 ++-- utils/voice.py | 2 +- video_creation/final_video.py | 16 +++++++++++----- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/utils/subreddit.py b/utils/subreddit.py index 9c6ef31..48dceba 100644 --- a/utils/subreddit.py +++ b/utils/subreddit.py @@ -16,8 +16,8 @@ def get_subreddit_undone(submissions: list, subreddit): Any: The submission that has not been done """ # recursively checks if the top submission in the list was already done. - if not exists('./video_creation/data/videos.json'): - with open('./video_creation/data/videos.json', 'w+') as f: + if not exists("./video_creation/data/videos.json"): + with open("./video_creation/data/videos.json", "w+") as f: json.dump([], f) with open("./video_creation/data/videos.json", "r", encoding="utf-8") as done_vids_raw: done_videos = json.load(done_vids_raw) diff --git a/utils/voice.py b/utils/voice.py index e92f0f4..0272b09 100644 --- a/utils/voice.py +++ b/utils/voice.py @@ -45,7 +45,7 @@ def sleep_until(time): # Type check if not isinstance(end, (int, float)): - raise Exception('The time parameter is not a number or datetime object') + raise Exception("The time parameter is not a number or datetime object") # Now we wait while True: diff --git a/video_creation/final_video.py b/video_creation/final_video.py index 920f11b..f1e1f96 100755 --- a/video_creation/final_video.py +++ b/video_creation/final_video.py @@ -131,9 +131,11 @@ def make_final_video( threads=multiprocessing.cpu_count(), ) if settings.config["settings"]["background_audio"]: - print('[bold green] Merging background audio with video') + print("[bold green] Merging background audio with video") if not exists(f"assets/backgrounds/background.mp3"): - print_substep("Cannot find assets/backgrounds/background.mp3 audio file didn't so skipping.") + print_substep( + "Cannot find assets/backgrounds/background.mp3 audio file didn't so skipping." + ) ffmpeg_extract_subclip( "assets/temp/temp.mp4", 0, @@ -141,15 +143,19 @@ def make_final_video( targetname=f"results/{subreddit}/{filename}", ) else: - ffmpeg_merge_video_audio("assets/temp/temp.mp4", "assets/backgrounds/background.mp3", "assets/temp/temp_audio.mp4") - ffmpeg_extract_subclip( # check if this gets run + ffmpeg_merge_video_audio( + "assets/temp/temp.mp4", + "assets/backgrounds/background.mp3", + "assets/temp/temp_audio.mp4", + ) + ffmpeg_extract_subclip( # check if this gets run "assets/temp/temp_audio.mp4", 0, final.duration, targetname=f"results/{subreddit}/{filename}", ) else: - print('debug duck') + print("debug duck") ffmpeg_extract_subclip( "assets/temp/temp.mp4", 0,