From ae08819e0e20fe663dfc2cd431585b386f5da480 Mon Sep 17 00:00:00 2001 From: t0is Date: Fri, 21 Feb 2025 17:06:06 +0100 Subject: [PATCH] clip folder split --- main.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index 458d09b..f6f6816 100644 --- a/main.py +++ b/main.py @@ -22,7 +22,8 @@ base_dirs = { "audio": os.path.join("audio", CHANNEL_NAME), "transcripts": os.path.join("transcripts", CHANNEL_NAME), "chat": os.path.join("chat", CHANNEL_NAME), - "clips": os.path.join("clips", CHANNEL_NAME) + "clips_transcript": os.path.join("clips", CHANNEL_NAME, "from_vod"), + "clips_chat": os.path.join("clips", CHANNEL_NAME, "from_chat") } # Create directories if they do not exist. @@ -143,7 +144,7 @@ def scrape_chat_log(vod_id, output_filename): def create_clip_from_vod(video_file, match_start, vod_id): clip_start = max(match_start - 15, 0) clip_duration = 60 # seconds - clip_dir = base_dirs["clips"] + clip_dir = base_dirs["clips_transcript"] os.makedirs(clip_dir, exist_ok=True) clip_filename = os.path.join(clip_dir, f"clip_{vod_id}_{int(match_start)}.mp4") command = [ @@ -189,7 +190,7 @@ def find_comments_by_keywords(chat_log, keywords): def create_clip_from_comment_timestamp(video_file, comment_timestamp, vod_id): clip_start = max(comment_timestamp - 15, 0) clip_duration = 60 # seconds - clip_dir = base_dirs["clips"] + clip_dir = base_dirs["clips_chat"] os.makedirs(clip_dir, exist_ok=True) clip_filename = os.path.join(clip_dir, f"clip_{vod_id}_{int(comment_timestamp)}.mp4") command = [