-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdir_checker.py
More file actions
33 lines (29 loc) · 1.74 KB
/
Copy pathdir_checker.py
File metadata and controls
33 lines (29 loc) · 1.74 KB
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
33
import os
def ensure_directory_exists(directory_path):
if not os.path.exists(directory_path):
try:
os.makedirs(directory_path)
except OSError as e:
return False
def dir_checker():
base_path = os.path.abspath('') # Get the current script directory
channels = ["spiritual_mutation", "the_universe_decoded"]
for channel in channels:
ensure_directory_exists(os.path.join(base_path, f"channels/{channel}/audio/"))
ensure_directory_exists(os.path.join(base_path, f"channels/{channel}/deleted/images/"))
ensure_directory_exists(os.path.join(base_path, f"channels/{channel}/generated-images/"))
ensure_directory_exists(os.path.join(base_path, f"channels/{channel}/images/"))
ensure_directory_exists(os.path.join(base_path, f"channels/{channel}/images-short/"))
ensure_directory_exists(os.path.join(base_path, f"channels/{channel}/thumbnails/"))
ensure_directory_exists(os.path.join(base_path, f"channels/{channel}/videos/"))
ensure_directory_exists(os.path.join(base_path, "output/audio/"))
ensure_directory_exists(os.path.join(base_path, "output/temp/"))
ensure_directory_exists(os.path.join(base_path, "output/thumbnails/"))
ensure_directory_exists(os.path.join(base_path, f"output/videos/{channel}/"))
ensure_directory_exists(os.path.join(base_path, f"test/generated-images/{channel}/"))
ensure_directory_exists(os.path.join(base_path, f"test/generated-short-images/{channel}/"))
ensure_directory_exists(os.path.join(base_path, f"test/generated-thumbnails/{channel}/"))
ensure_directory_exists(os.path.join(base_path, "test/images/"))
# Example usage
if __name__ == "__main__":
dir_checker()