style: reformatted.

pull/908/head
Jason 2 years ago
parent a3ec449ee0
commit dab3e64fef

@ -16,8 +16,8 @@ def get_subreddit_undone(submissions: list, subreddit):
Any: The submission that has not been done Any: The submission that has not been done
""" """
# recursively checks if the top submission in the list was already done. # recursively checks if the top submission in the list was already done.
if not exists('./video_creation/data/videos.json'): if not exists("./video_creation/data/videos.json"):
with open('./video_creation/data/videos.json', 'w+') as f: with open("./video_creation/data/videos.json", "w+") as f:
json.dump([], f) json.dump([], f)
with open("./video_creation/data/videos.json", "r", encoding="utf-8") as done_vids_raw: with open("./video_creation/data/videos.json", "r", encoding="utf-8") as done_vids_raw:
done_videos = json.load(done_vids_raw) done_videos = json.load(done_vids_raw)

@ -45,7 +45,7 @@ def sleep_until(time):
# Type check # Type check
if not isinstance(end, (int, float)): 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 # Now we wait
while True: while True:

@ -131,9 +131,11 @@ def make_final_video(
threads=multiprocessing.cpu_count(), threads=multiprocessing.cpu_count(),
) )
if settings.config["settings"]["background_audio"]: 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"): 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( ffmpeg_extract_subclip(
"assets/temp/temp.mp4", "assets/temp/temp.mp4",
0, 0,
@ -141,7 +143,11 @@ def make_final_video(
targetname=f"results/{subreddit}/{filename}", targetname=f"results/{subreddit}/{filename}",
) )
else: else:
ffmpeg_merge_video_audio("assets/temp/temp.mp4", "assets/backgrounds/background.mp3", "assets/temp/temp_audio.mp4") 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_extract_subclip( # check if this gets run
"assets/temp/temp_audio.mp4", "assets/temp/temp_audio.mp4",
0, 0,
@ -149,7 +155,7 @@ def make_final_video(
targetname=f"results/{subreddit}/{filename}", targetname=f"results/{subreddit}/{filename}",
) )
else: else:
print('debug duck') print("debug duck")
ffmpeg_extract_subclip( ffmpeg_extract_subclip(
"assets/temp/temp.mp4", "assets/temp/temp.mp4",
0, 0,

Loading…
Cancel
Save