use os to remove the already downloaded background

pull/280/head
iaacornus 3 years ago
parent 4ab24089d4
commit e9d3f63eda
No known key found for this signature in database
GPG Key ID: 281739AE7252598C

@ -1,7 +1,7 @@
import re import re
import os
from random import randrange from random import randrange
from pathlib import Path from pathlib import Path
from turtle import back
from yt_dlp import YoutubeDL from yt_dlp import YoutubeDL
from moviepy.video.io.ffmpeg_tools import ffmpeg_extract_subclip from moviepy.video.io.ffmpeg_tools import ffmpeg_extract_subclip
@ -31,10 +31,11 @@ def download_background(background):
background_check = Path("assets/mp4/background.mp4").is_file() background_check = Path("assets/mp4/background.mp4").is_file()
if background is not None or not background_check: if background is not None or not background_check:
if background_check: if background_check and background is not None:
print_substep( print_substep(
"Background video is already downloaded! Replacing ...", style="bold red" "Background video is already downloaded! Replacing ...", style="bold red"
) )
os.system("rm assets/mp4/background.mp4")
try: try:
with YoutubeDL(ydl_opts) as ydl: with YoutubeDL(ydl_opts) as ydl:

Loading…
Cancel
Save