From ceaa56c95b12549bf3ff8cfab112ffa0f15edcaa Mon Sep 17 00:00:00 2001 From: jerjou Date: Fri, 17 Jul 2020 14:44:23 -0400 Subject: [PATCH] Remove double-parentheses from thewoksoflife --- parsers/thewoksoflife.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/parsers/thewoksoflife.py b/parsers/thewoksoflife.py index 94f4be3..88f630a 100644 --- a/parsers/thewoksoflife.py +++ b/parsers/thewoksoflife.py @@ -3,4 +3,11 @@ import json from parsers.recipe import WpJsonRecipe class Thewoksoflife(WpJsonRecipe): - pass + def get_json_recipe(self, d): + recipe = super().get_json_recipe(d) + # thewoksoflife.com for some reason has double parentheses in its + # ingredients. Remove them. + recipe['ingredients'] = [ + ingredient.replace('((', '(').replace('))', ')') + for ingredient in recipe.get('ingredients', [])] + return recipe