From 31569649a10333675bd7f55325e763937297f4b2 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 19 Aug 2021 20:18:22 +0530 Subject: [PATCH] Update Boston Globe --- recipes/boston.com.recipe | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/recipes/boston.com.recipe b/recipes/boston.com.recipe index d3af09a604..e5e54b4c53 100644 --- a/recipes/boston.com.recipe +++ b/recipes/boston.com.recipe @@ -60,9 +60,12 @@ comics_to_fetch = { def extract_json(raw_html): idx = raw_html.find('Fusion.contentCache={') close_idx = raw_html.find('', idx) - raw = raw_html[idx:close_idx].strip().rstrip(';') + raw = raw_html[idx:close_idx] raw = raw[raw.find('{'):] - data = json.loads(raw) + idx = raw.find(';Fusion') + raw = raw[:idx] + # open('/t/raw.html', 'w').write(raw) + data = json.loads(raw, strict=False) # open('/t/raw.json', 'w').write(json.dumps(data, indent=2)) return data