File size: 814 Bytes
2d0f335
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
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')


if __name__=="__main__":
    download_files_from_url()