From c88a435f1c73d749d3b74581617b38964a03a4b5 Mon Sep 17 00:00:00 2001 From: Simon Date: Mon, 19 Dec 2022 21:20:40 +0100 Subject: [PATCH] Sorry! Final fix for my mistakes --- video_creation/final_video.py | 4 ++-- video_creation/screenshot_downloader.py | 12 +++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/video_creation/final_video.py b/video_creation/final_video.py index 29b6eb1..5d9b74f 100755 --- a/video_creation/final_video.py +++ b/video_creation/final_video.py @@ -101,8 +101,8 @@ def make_final_video( # Gather all audio clips if settings.config["settings"]["storymode"]: if settings.config["settings"]["storymodemethod"] == 0: - audio_clips = [AudioFileClip(f"assets/temp/{id}/mp3/title.mp3")] - audio_clips.insert(1, AudioFileClip(f"assets/temp/{id}/mp3/postaudio.mp3")) + audio_clips = [AudioFileClip(f"assets/temp/{reddit_id}/mp3/title.mp3")] + audio_clips.insert(1, AudioFileClip(f"assets/temp/{reddit_id}/mp3/postaudio.mp3")) elif settings.config["settings"]["storymodemethod"] == 1: audio_clips = [ AudioFileClip(f"assets/temp/{reddit_id}/mp3/postaudio-{i}.mp3") diff --git a/video_creation/screenshot_downloader.py b/video_creation/screenshot_downloader.py index 6a0a3b5..6df08a9 100644 --- a/video_creation/screenshot_downloader.py +++ b/video_creation/screenshot_downloader.py @@ -50,20 +50,22 @@ def get_screenshots_of_reddit_posts(reddit_object: dict, screenshot_num: int): viewport=ViewportSize(width=W, height=H), device_scale_factor=dsf, ) - if settings.config["settings"]["storymodemethod"] == 1: - # for idx,item in enumerate(reddit_object["thread_post"]): - bgcolor = (255, 255, 255, 255) - txtcolor = (0, 0, 0) - imagemaker(theme=bgcolor, reddit_obj=reddit_object, txtclr=txtcolor) # set the theme and disable non-essential cookies if settings.config["settings"]["theme"] == "dark": cookie_file = open( "./video_creation/data/cookie-dark-mode.json", encoding="utf-8" ) + bgcolor = (33, 33, 36, 255) + txtcolor = (240, 240, 240) else: cookie_file = open( "./video_creation/data/cookie-light-mode.json", encoding="utf-8" ) + bgcolor = (255, 255, 255, 255) + txtcolor = (0, 0, 0) + if settings.config["settings"]["storymodemethod"] == 1: + # for idx,item in enumerate(reddit_object["thread_post"]): + imagemaker(theme=bgcolor, reddit_obj=reddit_object, txtclr=txtcolor) cookies = json.load(cookie_file) cookie_file.close()