Skip to content

Commit bd0685f

Browse files
committed
fix(upload): returns broken downloadUrl
1 parent 9307211 commit bd0685f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pydrive2/apiattr.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,10 @@ def __repr__(self):
8080

8181
def update(self, *args, **kwargs):
8282
"""Overwritten method of dictionary."""
83+
BAD_URL_PREFIX = "https://www.googleapis.comhttps:"
8384
for k, v in dict(*args, **kwargs).items():
85+
if k == "downloadUrl" and v.startswith(BAD_URL_PREFIX):
86+
v = v.replace(BAD_URL_PREFIX, "https://www.googleapis.com", 1)
8487
self[k] = v
8588

8689
def UpdateMetadata(self, metadata=None):

0 commit comments

Comments
 (0)