Don't create py34.Post for downloading images
py34.Post does extension scan, that is not required as it is saved inside the block data.
This commit is contained in:
@ -123,8 +123,7 @@ def get_image(post_id: int = None):
|
|||||||
if path.exists():
|
if path.exists():
|
||||||
return send_file(path)
|
return send_file(path)
|
||||||
else:
|
else:
|
||||||
post = py34.Post(entry.post, entry.dir, entry.image, entry.tags, entry.thumbnail)
|
image = py34.scraper.scraper.get(py34.url.ImageURL(entry.dir, entry.image, enttype2ext(entry.type)))
|
||||||
image = post.get_image_data()
|
|
||||||
with open(path, "wb") as file:
|
with open(path, "wb") as file:
|
||||||
file.write(image)
|
file.write(image)
|
||||||
return send_file(path)
|
return send_file(path)
|
||||||
|
|||||||
Reference in New Issue
Block a user