fixed URL import when ingredient is a string
This commit is contained in:
parent
47090ce863
commit
21740522bc
@ -69,8 +69,10 @@ def find_recipe_json(ld_json, url):
|
|||||||
if 'recipeIngredient' in ld_json:
|
if 'recipeIngredient' in ld_json:
|
||||||
# some pages have comma separated ingredients in a single array entry
|
# some pages have comma separated ingredients in a single array entry
|
||||||
if (len(ld_json['recipeIngredient']) == 1
|
if (len(ld_json['recipeIngredient']) == 1
|
||||||
and len(ld_json['recipeIngredient'][0]) > 30):
|
and type(ld_json['recipeIngredient']) == list):
|
||||||
ld_json['recipeIngredient'] = ld_json['recipeIngredient'][0].split(',') # noqa: E501
|
ld_json['recipeIngredient'] = ld_json['recipeIngredient'][0].split(',') # noqa: E501
|
||||||
|
elif type(ld_json['recipeIngredient']) == str:
|
||||||
|
ld_json['recipeIngredient'] = ld_json['recipeIngredient'].split(',')
|
||||||
|
|
||||||
for x in ld_json['recipeIngredient']:
|
for x in ld_json['recipeIngredient']:
|
||||||
if '\n' in x:
|
if '\n' in x:
|
||||||
|
Loading…
Reference in New Issue
Block a user