clip folder split

This commit is contained in:
t0is 2025-02-21 17:06:06 +01:00
parent 5614ba2c0a
commit ae08819e0e

View File

@ -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 = [