mirror of
https://github.com/meeb/tubesync.git
synced 2025-06-23 13:36:35 +00:00
Raise when status_code
is not 200: OK
This commit is contained in:
parent
f6b20c03e3
commit
3a0c4c8fb1
@ -65,6 +65,8 @@ def get_remote_image(url, force_rgb=True):
|
||||
'(KHTML, like Gecko) Chrome/69.0.3497.64 Safari/537.36')
|
||||
}
|
||||
r = requests.get(url, headers=headers, stream=True, timeout=60)
|
||||
if 200 != r.status_code:
|
||||
r.raise_for_status()
|
||||
r.raw.decode_content = True
|
||||
i = Image.open(r.raw)
|
||||
if force_rgb:
|
||||
|
Loading…
Reference in New Issue
Block a user