def __init__(self, file_id, action): # base auth = GDAuth() creds = auth.get_credentials() if creds is None: raise Exception("Failed to retrieve credentials") self.http = auth.get_authorized_http() base = GDBase() self.service = base.get_drive_service(self.http) self.root = base.get_root() self.file_id = base.get_id_from_url(file_id) self.action = action['name'] self.param = action['param']
def __init__(self, file_id, format, save_as): # base auth = GDAuth() self.credentials = auth.get_credentials() if self.credentials is None: raise Exception("Failed to retrieve credentials") self.http = auth.get_authorized_http() base = GDBase() self.service = base.get_drive_service(self.http) self.file_id = base.get_id_from_url(file_id) self.format = format if save_as is None: self.save_as = None else: self.save_as = os.path.abspath(save_as)