DenisT commited on
Commit
5f04dc5
·
1 Parent(s): 5ac7dcf

check if folder present

Browse files
Files changed (1) hide show
  1. endpoints/minecraft.py +5 -0
endpoints/minecraft.py CHANGED
@@ -22,6 +22,11 @@ async def create_minecraft_video(
22
  ):
23
 
24
  background_video_path = "./data/minecraft/videos/background_video.mp4"
 
 
 
 
 
25
  # Save the videos
26
  with open(background_video_path, "wb") as buffer:
27
  shutil.copyfileobj(video.file, buffer)
 
22
  ):
23
 
24
  background_video_path = "./data/minecraft/videos/background_video.mp4"
25
+
26
+ # Create the directory if it doesn't exist
27
+ if not os.path.exists("./data/minecraft/videos"):
28
+ os.makedirs("./data/minecraft/videos")
29
+
30
  # Save the videos
31
  with open(background_video_path, "wb") as buffer:
32
  shutil.copyfileobj(video.file, buffer)