Browse Source

Fix curl download on Windows (#669)

5.0
Glenn Jocher 4 years ago
parent
commit
3fcd365ba3
1 changed files with 1 additions and 3 deletions
  1. +1
    -3
      utils/google_utils.py

+ 1
- 3
utils/google_utils.py View File

@@ -50,8 +50,7 @@ def gdrive_download(id='1n_oKgR81BJtqk75b00eAjdv03qVCQn2f', name='coco128.zip'):
out = "NUL" if platform.system() == "Windows" else "/dev/null"
os.system('curl -c ./cookie -s -L "drive.google.com/uc?export=download&id=%s" > %s ' % (id, out))
if os.path.exists('cookie'): # large file
s = 'curl -Lb ./cookie "drive.google.com/uc?export=download&confirm=%s&id=%s" -o %s' % (
get_token(), id, name)
s = 'curl -Lb ./cookie "drive.google.com/uc?export=download&confirm=%s&id=%s" -o %s' % (get_token(), id, name)
else: # small file
s = 'curl -s -L -o %s "drive.google.com/uc?export=download&id=%s"' % (name, id)
r = os.system(s) # execute, capture return values
@@ -80,7 +79,6 @@ def get_token(cookie="./cookie"):
return line.split()[-1]
return ""


# def upload_blob(bucket_name, source_file_name, destination_blob_name):
# # Uploads a file to a bucket
# # https://cloud.google.com/storage/docs/uploading-objects#storage-upload-object-python

Loading…
Cancel
Save