forked from Huanshere/VideoLingo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdelete_retry_dubbing.py
32 lines (28 loc) · 1.01 KB
/
delete_retry_dubbing.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import os, sys
import shutil
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
def delete_dubbing_files():
files_to_delete = [
os.path.join("output", "dub.wav"),
os.path.join("output", "output_dub.mp4")
]
for file_path in files_to_delete:
if os.path.exists(file_path):
try:
os.remove(file_path)
print(f"Deleted: {file_path}")
except Exception as e:
print(f"Error deleting {file_path}: {str(e)}")
else:
print(f"File not found: {file_path}")
segs_folder = os.path.join("output", "audio", "segs")
if os.path.exists(segs_folder):
try:
shutil.rmtree(segs_folder)
print(f"Deleted folder and contents: {segs_folder}")
except Exception as e:
print(f"Error deleting folder {segs_folder}: {str(e)}")
else:
print(f"Folder not found: {segs_folder}")
if __name__ == "__main__":
delete_dubbing_files()