mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Update Boston Globe
This commit is contained in:
parent
6104475f5d
commit
31569649a1
@ -60,9 +60,12 @@ comics_to_fetch = {
|
|||||||
def extract_json(raw_html):
|
def extract_json(raw_html):
|
||||||
idx = raw_html.find('Fusion.contentCache={')
|
idx = raw_html.find('Fusion.contentCache={')
|
||||||
close_idx = raw_html.find('</script>', idx)
|
close_idx = raw_html.find('</script>', idx)
|
||||||
raw = raw_html[idx:close_idx].strip().rstrip(';')
|
raw = raw_html[idx:close_idx]
|
||||||
raw = raw[raw.find('{'):]
|
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))
|
# open('/t/raw.json', 'w').write(json.dumps(data, indent=2))
|
||||||
return data
|
return data
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user