mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Store the downloaded images only if status_code == 200
This commit is contained in:
@@ -84,8 +84,9 @@ class ImageDownloader(BaseImageConverter):
|
||||
else:
|
||||
self.app.env.original_image_uri[path] = node['uri']
|
||||
|
||||
with open(path, 'wb') as f:
|
||||
f.write(r.content)
|
||||
if r.status_code == 200:
|
||||
with open(path, 'wb') as f:
|
||||
f.write(r.content)
|
||||
|
||||
last_modified = r.headers.get('last-modified')
|
||||
if last_modified:
|
||||
|
||||
Reference in New Issue
Block a user