fnp
/
audio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a07174f
)
YT: Make sure responses ok.
author
Radek Czajka
<rczajka@rczajka.pl>
Thu, 28 May 2020 11:13:40 +0000
(13:13 +0200)
committer
Radek Czajka
<rczajka@rczajka.pl>
Thu, 28 May 2020 11:13:40 +0000
(13:13 +0200)
src/apiclient/models.py
patch
|
blob
|
history
diff --git
a/src/apiclient/models.py
b/src/apiclient/models.py
index
cc40143
..
49403f0
100644
(file)
--- 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 {}
)
'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:
if resumable_file_path:
location = response.headers['Location']
with open(resumable_file_path, 'rb') as f:
- re
turn
session.put(
+ re
sponse =
session.put(
url=location,
data=StreamingIterator(file_size, f),
headers={"Content-Type": "application/octet-stream"},
)
url=location,
data=StreamingIterator(file_size, f),
headers={"Content-Type": "application/octet-stream"},
)
+ response.raise_for_status()
+ return response