updates
This commit is contained in:
parent
61e3fc1f8e
commit
6067b22605
|
@ -23,12 +23,18 @@ def gdrive_download(id='1HaXkef9z6y5l4vUnCYgdmEAj61c6bfWO', name='coco.zip'):
|
||||||
"curl -Lb ./cookie -s \"https://drive.google.com/uc?export=download&confirm=`awk '/download/ {print $NF}' ./cookie`&id=%s\" -o %s" % (
|
"curl -Lb ./cookie -s \"https://drive.google.com/uc?export=download&confirm=`awk '/download/ {print $NF}' ./cookie`&id=%s\" -o %s" % (
|
||||||
id, name),
|
id, name),
|
||||||
'rm ./cookie']
|
'rm ./cookie']
|
||||||
[os.system(x) for x in s] # run commands
|
r = sum([os.system(x) for x in s]) # run commands, get return zeros
|
||||||
|
|
||||||
# Attempt small file download
|
# Attempt small file download
|
||||||
if not os.path.exists(name): # file size < 40MB
|
if not os.path.exists(name): # file size < 40MB
|
||||||
s = 'curl -f -L -o %s https://drive.google.com/uc?export=download&id=%s' % (name, id)
|
s = 'curl -f -L -o %s https://drive.google.com/uc?export=download&id=%s' % (name, id)
|
||||||
os.system(s)
|
r = os.system(s)
|
||||||
|
|
||||||
|
# Check for errors
|
||||||
|
if r != 0:
|
||||||
|
os.system('rm ' + name) # remove partial downloads
|
||||||
|
print('ERROR: Download failure. ')
|
||||||
|
return
|
||||||
|
|
||||||
# Unzip if archive
|
# Unzip if archive
|
||||||
if name.endswith('.zip'):
|
if name.endswith('.zip'):
|
||||||
|
|
Loading…
Reference in New Issue