-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
84 lines (69 loc) · 2.24 KB
/
main.py
File metadata and controls
84 lines (69 loc) · 2.24 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
"""
Spotify Download Utils - Main Application
A modular tool for processing Spotify downloads: decompression, organization, and metadata enhancement.
"""
import sys
import os
# Add src directory to Python path
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'src'))
from src.config import (
COMPRESSED_FILES_FOLDER,
OUTPUT_FOLDER,
STRINGS_TO_REMOVE,
UNRAR_TOOL_PATH,
COMPRESSED_EXTENSIONS
)
from src.processors import (
uncompress_files,
process_loose_files,
rename_folders,
rename_files_with_track_numbers,
process_album_folders
)
def main():
"""
Main execution function.
Orchestrates the entire processing pipeline.
"""
try:
print("=" * 60)
print("🎵 Spotify Download Utils v2.0")
print("=" * 60)
print()
# Step 1: Decompress files
print("🚀 Step 1/5: Decompressing files...")
uncompress_files(
COMPRESSED_FILES_FOLDER,
OUTPUT_FOLDER,
UNRAR_TOOL_PATH,
COMPRESSED_EXTENSIONS
)
print("✅ Decompression finished.\n")
# Step 2: Process loose files
print("🚀 Step 2/5: Processing loose files...")
process_loose_files(
COMPRESSED_FILES_FOLDER,
OUTPUT_FOLDER,
STRINGS_TO_REMOVE
)
print("✅ Loose files processing finished.\n")
# Step 3: Rename folders
print("🚀 Step 3/5: Renaming folders...")
rename_folders(OUTPUT_FOLDER, STRINGS_TO_REMOVE)
print("✅ Folder renaming finished.\n")
# Step 4: Rename files with track numbers
print("🚀 Step 4/5: Adding track numbers to files...")
rename_files_with_track_numbers(OUTPUT_FOLDER)
print("✅ File renaming finished.\n")
# Step 5: Add album year
print("🚀 Step 5/5: Adding album years...")
process_album_folders(OUTPUT_FOLDER)
print("✅ Album year processing finished.\n")
print("=" * 60)
print("✅ All processing completed successfully!")
print("=" * 60)
except Exception as e:
print(f"\n❌ Error: {e}")
sys.exit(1)
if __name__ == "__main__":
main()