Spaces:
Runtime error
Runtime error
File size: 955 Bytes
6129b93 e926f6f b994a17 e926f6f 4b177dd b994a17 4b177dd e926f6f 4b177dd 6129b93 4b177dd e926f6f 4b177dd 6129b93 4b177dd e926f6f 4b177dd b994a17 4b177dd b994a17 e926f6f |
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 |
import os
import zipfile
import sys
ZIP_NAME = "musicnbrain.zip"
MARKER = ".unzipped_ok"
def unzip_once():
print("Starting unzip script...")
if not os.path.exists(ZIP_NAME):
print(f"'{ZIP_NAME}' not found — nothing to unzip.")
return
if os.path.exists(MARKER):
print("Already unzipped. Skipping.")
return
try:
with zipfile.ZipFile(ZIP_NAME, "r") as zf:
print(f"Extracting {ZIP_NAME}...")
zf.extractall(".")
print("Extraction complete.")
os.remove(ZIP_NAME)
print("Deleted zip file.")
open(MARKER, "w").close()
print("Created marker file.")
print("\nExtracted files:")
for root, dirs, files in os.walk("."):
for file in files:
print(os.path.join(root, file))
except Exception as e:
print("Unzip failed:", e)
if __name__ == "__main__":
unzip_once()
sys.exit(0)
|