From f608d43d27b51d9ac72947fedc0493eccce0c581 Mon Sep 17 00:00:00 2001 From: James Childs-Maidment Date: Sun, 6 Nov 2016 14:43:11 +1100 Subject: [PATCH] support for token in download url --- pyrebase/pyrebase.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pyrebase/pyrebase.py b/pyrebase/pyrebase.py index 0cd2871..e87f4e0 100644 --- a/pyrebase/pyrebase.py +++ b/pyrebase/pyrebase.py @@ -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):