Merge pull request #622 from smilerz/fix_url_import

updated url import and test due to updated recipe_scraper
This commit is contained in:
vabene1111 2021-05-21 08:25:00 +02:00 committed by GitHub
commit 286118093c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -46,7 +46,7 @@ def get_from_scraper(scrape, space):
servings = int(re.findall(r'\b\d+\b', servings)[0]) servings = int(re.findall(r'\b\d+\b', servings)[0])
except Exception: except Exception:
servings = 1 servings = 1
recipe_json['servings'] = servings recipe_json['servings'] = max(servings, 1)
try: try:
recipe_json['prepTime'] = get_minutes(scrape.schema.data.get("prepTime")) or 0 recipe_json['prepTime'] = get_minutes(scrape.schema.data.get("prepTime")) or 0

View File

@ -2218,12 +2218,12 @@ TASTE_OF_HOME = {
THE_SPRUCE_EATS = { THE_SPRUCE_EATS = {
'file': ['thespruceeats.html'], 'file': ['thespruceeats.html'],
'url': 'https://www.thespruceeats.com/creamy-potato-soup-with-ham-3059797', 'url': 'https://www.thespruceeats.com/creamy-potato-soup-with-ham-3059797',
"name": "", "name": "Creamy Potato Soup With Ham",
"description": "", "description": "",
"servings": 1, "servings": 6,
"prepTime": 0, "prepTime": 55,
"cookTime": 0, "cookTime": 0,
"image": "", "image": 'https://www.thespruceeats.com/thmb/KfpdKXpq4JYKIIyv8ZuKuR8GRkQ=/960x0/filters:no_upscale():max_bytes(150000):strip_icc():format(webp)/creamy-potato-soup-with-ham-3059797-stovetop-step-12-99dc3bf1962c4e26a2d225ee3c25ecad.jpg',
"keywords": [], "keywords": [],
"recipeIngredient": [ "recipeIngredient": [
{ {