test-stfzip / download.py
yerang's picture
Update download.py
f132617 verified
raw
history blame contribute delete
760 Bytes
import os
import gdown
import zipfile
def download_files_from_url():
os.makedirs('/tmp/stf',exist_ok=True)
os.makedirs('/tmp/stf/TEMP',exist_ok=True)
file_id=os.getenv('DOWNLOAD_1')
url = f"https://drive.google.com/uc?id={file_id}"
gdown.download(url, '/tmp/stf-api-alternative.zip', quiet=False)
zipfile.ZipFile('/tmp/stf-api-alternative.zip', 'r').extractall('/tmp/stf/')
file_id=os.getenv('DOWNLOAD_2')
url = f"https://drive.google.com/uc?id={file_id}"
gdown.download(url, '/tmp/stf/089.pth', quiet=False)
file_id=os.getenv('DOWNLOAD_3')
url = f"https://drive.google.com/uc?id={file_id}"
gdown.download(url, '/tmp/stf/TEMP/0157.pth', quiet=False)
os.remove('/tmp/stf-api-alternative.zip')