Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _build_resumeable_media(self, upload_file):
resumable_upload_path = _safe_getitem(self._method_specs, 'mediaUpload', 'protocols', 'resumable', 'path') or ''
resumable_url = self._root_url[:-1] + resumable_upload_path
multipart = self.mediaUpload['protocols']['resumable'].get('multipart', False)
return ResumableUpload(upload_file, multipart=multipart, upload_path=resumable_url)
def _build_resumeable_media(self, upload_file, qualified_url):
# resumable_upload_path = _safe_getitem(self._method_specs, 'mediaUpload', 'protocols', 'resumable', 'path')
# resumable_url_base = self._root_url[:-1] + resumable_upload_path
resumable_url_base = self._root_url + "resumable/upload/" + self._service_path
resumable_url = qualified_url.replace(self._base_url, resumable_url_base)
multipart = self["mediaUpload"]["protocols"]["resumable"].get("multipart", True)
return ResumableUpload(
upload_file, multipart=multipart, upload_path=resumable_url
)