fixed servings blank
This commit is contained in:
parent
b6b505c361
commit
e2b1115b3b
@ -218,13 +218,13 @@ def find_recipe_json(ld_json, url):
|
|||||||
else:
|
else:
|
||||||
ld_json['prepTime'] = 0
|
ld_json['prepTime'] = 0
|
||||||
|
|
||||||
|
ld_json['servings'] = 1
|
||||||
try:
|
try:
|
||||||
if 'recipeYield' in ld_json:
|
if 'recipeYield' in ld_json:
|
||||||
if type(ld_json['recipeYield']) == str:
|
if type(ld_json['recipeYield']) == str:
|
||||||
ld_json['servings'] = int(re.findall(r'\b\d+\b', ld_json['recipeYield'])[0])
|
ld_json['servings'] = int(re.findall(r'\b\d+\b', ld_json['recipeYield'])[0])
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(e)
|
print(e)
|
||||||
ld_json['servings'] = 1
|
|
||||||
|
|
||||||
for key in list(ld_json):
|
for key in list(ld_json):
|
||||||
if key not in [
|
if key not in [
|
||||||
|
Loading…
Reference in New Issue
Block a user