diff --git a/cookbook/helper/recipe_url_import.py b/cookbook/helper/recipe_url_import.py index 6cdf0107..34b91eec 100644 --- a/cookbook/helper/recipe_url_import.py +++ b/cookbook/helper/recipe_url_import.py @@ -6,6 +6,7 @@ from isodate.isoerror import ISO8601Error from cookbook.helper.ingredient_parser import parse as parse_single_ingredient from cookbook.models import Keyword from django.utils.dateparse import parse_duration +from recipe_scrapers._schemaorg import SchemaOrgException from recipe_scrapers._utils import get_minutes, normalize_string @@ -42,9 +43,9 @@ def get_from_scraper(scrape, space): pass try: - recipe_json['image'] = scrape.image() - except AttributeError: - pass + recipe_json['image'] = parse_image(scrape.image()) or '' + except (AttributeError, TypeError, SchemaOrgException): + recipe_json['image'] = '' keywords = [] try: