From 4fc0a646fc0df77993cf77e512ccfbc386adae83 Mon Sep 17 00:00:00 2001 From: Guilherme Pires Date: Fri, 16 Feb 2024 08:15:53 -0700 Subject: [PATCH] mkdir if it doesn't exist --- process_debates.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/process_debates.py b/process_debates.py index b3d2830..52dc9f9 100644 --- a/process_debates.py +++ b/process_debates.py @@ -107,6 +107,12 @@ def get_audio_and_video(url, audio_path, headers=None, gdrive_service=None): m3u8_path = audio_path.with_suffix(".m3u8") m3u8_orig_path = audio_path.with_suffix(".m3u8.orig") + # mkdir on gdrive in case it doesn't exist + cmd = [ + "rclone", "mkdir", f"debates:debates2024/{audio_path.stem}", + ] + subprocess.run(cmd, check=True) + if not m3u8_path.exists(): mp4_path = audio_path.with_suffix(".mp4")