mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Handle malformed data from NYT
This commit is contained in:
parent
0f4c2c23bd
commit
416986eb76
@ -203,7 +203,7 @@ class NewYorkTimes(BasicNewsRecipe):
|
|||||||
m = pat.search(key)
|
m = pat.search(key)
|
||||||
grouping, container, relation = map(int, m.groups())
|
grouping, container, relation = map(int, m.groups())
|
||||||
asset = sdata['asset']
|
asset = sdata['asset']
|
||||||
if asset['typename'] == 'Article' and grouping == 0:
|
if asset and asset['typename'] == 'Article' and grouping == 0:
|
||||||
if container not in sections:
|
if container not in sections:
|
||||||
sections[container] = []
|
sections[container] = []
|
||||||
sections[container].append(asset['id'].split(':', 1)[1])
|
sections[container].append(asset['id'].split(':', 1)[1])
|
||||||
|
@ -203,7 +203,7 @@ class NewYorkTimes(BasicNewsRecipe):
|
|||||||
m = pat.search(key)
|
m = pat.search(key)
|
||||||
grouping, container, relation = map(int, m.groups())
|
grouping, container, relation = map(int, m.groups())
|
||||||
asset = sdata['asset']
|
asset = sdata['asset']
|
||||||
if asset['typename'] == 'Article' and grouping == 0:
|
if asset and asset['typename'] == 'Article' and grouping == 0:
|
||||||
if container not in sections:
|
if container not in sections:
|
||||||
sections[container] = []
|
sections[container] = []
|
||||||
sections[container].append(asset['id'].split(':', 1)[1])
|
sections[container].append(asset['id'].split(':', 1)[1])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user