Skip to content

Commit

Permalink
support for token in download url
Browse files Browse the repository at this point in the history
  • Loading branch information
thisbejim committed Nov 6, 2016
1 parent e079b30 commit f608d43
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pyrebase/pyrebase.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,11 +418,13 @@ def download(self, filename):
blob = self.bucket.get_blob(path)
blob.download_to_filename(filename)

def get_url(self):
def get_url(self, token):
path = self.path
self.path = None
if path.startswith('/'):
path = path[1:]
if token:
return "{0}/o/{1}?alt=media&token={2}".format(self.storage_bucket, quote(path, safe=''), token)
return "{0}/o/{1}?alt=media".format(self.storage_bucket, quote(path, safe=''))

def list_files(self):
Expand Down

0 comments on commit f608d43

Please sign in to comment.