updates
This commit is contained in:
parent
09a89da8a8
commit
f0762134ce
|
@ -13,6 +13,7 @@ def gdrive_download(files=(('1HaXkef9z6y5l4vUnCYgdmEAj61c6bfWO', 'coco.zip'))):
|
||||||
# from utils.google_utils import *; gdrive_download()
|
# from utils.google_utils import *; gdrive_download()
|
||||||
|
|
||||||
for (id, name) in files:
|
for (id, name) in files:
|
||||||
|
print('Downloading ''https://drive.google.com/uc?export=download&id=%s'' as ''%s''...' % (id, name))
|
||||||
if os.path.exists(name): # remove existing
|
if os.path.exists(name): # remove existing
|
||||||
os.remove(name)
|
os.remove(name)
|
||||||
|
|
||||||
|
@ -22,10 +23,9 @@ def gdrive_download(files=(('1HaXkef9z6y5l4vUnCYgdmEAj61c6bfWO', 'coco.zip'))):
|
||||||
|
|
||||||
# Attempt large file download
|
# Attempt large file download
|
||||||
if not os.path.exists(name): # file size > 40MB
|
if not os.path.exists(name): # file size > 40MB
|
||||||
print('Google Drive file ''%s'' > 40 MB, attempting large file download...' % name)
|
|
||||||
s = ["curl -c ./cookie -s -L \"https://drive.google.com/uc?export=download&id=%s\" > /dev/null" % id,
|
s = ["curl -c ./cookie -s -L \"https://drive.google.com/uc?export=download&id=%s\" > /dev/null" % id,
|
||||||
"curl -Lb ./cookie \"https://drive.google.com/uc?export=download&confirm=`awk '/download/ {print $NF}' ./cookie`&id=%s\" -o %s" % (
|
"curl -Lb ./cookie \"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
|
[os.system(x) for x in s] # run commands
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue