Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cookbook/integration/recettetek.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import imghdr
import filetype
import json
import re
from io import BytesIO
Expand Down Expand Up @@ -128,7 +128,7 @@ def get_recipe_from_file(self, file):
url = file['originalPicture']
if validate_import_url(url):
response = requests.get(url)
if imghdr.what(BytesIO(response.content)) is not None:
if filetype.is_image(BytesIO(response.content)):
self.import_recipe_image(recipe, BytesIO(response.content), filetype=get_filetype(file['originalPicture']))
else:
raise Exception("Original image failed to download.")
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ gunicorn==22.0.0
lxml==5.3.0
Markdown==3.5.1
Pillow==11.1.0
psycopg2-binary==2.9.9
psycopg2-binary==2.9.10
python-dotenv==1.0.0
requests==2.32.3
six==1.16.0
Expand Down Expand Up @@ -45,6 +45,7 @@ pytubefix==8.12.0
aiohttp==3.10.11
inflection==0.5.1
redis==5.2.1
filetype==1.2.0

# Development
pytest==8.0.0
Expand Down