X-Git-Url: https://git.mdrn.pl/audio.git/blobdiff_plain/96f739b685941d100677a374cad55b84c96f180c..3c7adf8af63a913089eb5ec736443ea0c59a8d68:/src/apiclient/models.py diff --git a/src/apiclient/models.py b/src/apiclient/models.py index cc40143..49403f0 100644 --- a/src/apiclient/models.py +++ b/src/apiclient/models.py @@ -57,11 +57,14 @@ class YouTubeToken(models.Model): 'x-upload-content-type': 'application/octet-stream', } if resumable_file_path else {} ) + response.raise_for_status() if resumable_file_path: location = response.headers['Location'] with open(resumable_file_path, 'rb') as f: - return session.put( + response = session.put( url=location, data=StreamingIterator(file_size, f), headers={"Content-Type": "application/octet-stream"}, ) + response.raise_for_status() + return response