From c069d8b5d0e9b93460f29029a6a58fc0e6d322da Mon Sep 17 00:00:00 2001 From: Marcel Date: Wed, 29 Jun 2022 20:12:32 +0200 Subject: [PATCH] Fixed #736 --- video_creation/final_video.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/video_creation/final_video.py b/video_creation/final_video.py index e065d5a..fca0e69 100755 --- a/video_creation/final_video.py +++ b/video_creation/final_video.py @@ -119,12 +119,13 @@ def make_final_video(number_of_clips: int, length: int, reddit_obj: dict[str]): title = re.sub(r"[^\w\s-]", "", reddit_obj["thread_title"]) idx = re.sub(r"[^\w\s-]", "", reddit_obj["thread_id"]) filename = f"{title}.mp4" + subreddit = os.getenv("SUBREDDIT"); save_data(filename, title, idx) - if not exists("./results"): + if not exists(f"./results/{subreddit}"): print_substep("The results folder didn't exist so I made it") - os.mkdir("./results") + os.mkdir(f"./results/{subreddit}") final.write_videofile( "assets/temp/temp.mp4", @@ -135,7 +136,7 @@ def make_final_video(number_of_clips: int, length: int, reddit_obj: dict[str]): threads=multiprocessing.cpu_count(), ) ffmpeg_tools.ffmpeg_extract_subclip( - "assets/temp/temp.mp4", 0, length, targetname=f"results/{filename}" + "assets/temp/temp.mp4", 0, length, targetname=f"results/{subreddit}/{filename}" ) # os.remove("assets/temp/temp.mp4")