mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-01 04:10:06 -05:00
WIP
This commit is contained in:
@@ -2,13 +2,11 @@ import random
|
||||
import re
|
||||
from isodate import parse_duration as iso_parse_duration
|
||||
from isodate.isoerror import ISO8601Error
|
||||
from recipe_scrapers._exceptions import ElementNotFoundInHtml
|
||||
|
||||
from cookbook.helper.ingredient_parser import parse as parse_single_ingredient
|
||||
from cookbook.models import Keyword
|
||||
from django.utils.dateparse import parse_duration
|
||||
from html import unescape
|
||||
from recipe_scrapers._schemaorg import SchemaOrgException
|
||||
from recipe_scrapers._utils import get_minutes
|
||||
|
||||
|
||||
@@ -56,6 +54,7 @@ def get_from_scraper(scrape, space):
|
||||
recipe_json['cookTime'] = get_minutes(scrape.schema.data.get("cookTime")) or 0
|
||||
except Exception:
|
||||
recipe_json['cookTime'] = 0
|
||||
|
||||
if recipe_json['cookTime'] + recipe_json['prepTime'] == 0:
|
||||
try:
|
||||
recipe_json['prepTime'] = get_minutes(scrape.total_time()) or 0
|
||||
|
||||
Reference in New Issue
Block a user