From ccb23d59e1c7fc4604234aa49e0550e7d84cb7fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Hells=C3=A9n?= Date: Sat, 4 Dec 2021 21:59:22 +0100 Subject: [PATCH] Fix that you couldn't save thumbnail and create html when custom upload folder --- main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 383a449..fa4fc91 100644 --- a/main.py +++ b/main.py @@ -179,7 +179,7 @@ def generate_html( html_url = f"{domain}{filename}" filename += ".html" - with open(f"Uploads/{filename}", "w", encoding="utf-8") as file: + with open(f"{upload_folder}/{filename}", "w", encoding="utf-8") as file: file.write(video_html) return html_url @@ -220,6 +220,6 @@ def make_thumbnail(path_video: str, file_filename: str) -> str: str: Returns thumbnail filename. """ out_filename = f"{domain}{file_filename}.jpg" - ffmpeg.input(path_video, ss="1").output(f"Uploads/{file_filename}.jpg", vframes=1).run() + ffmpeg.input(path_video, ss="1").output(f"{upload_folder}/{file_filename}.jpg", vframes=1).run() return out_filename