Improve stream content parsing
This commit is contained in:
parent
34d973f14e
commit
d4867b6627
1 changed files with 11 additions and 9 deletions
|
@ -37,16 +37,18 @@ def parse(obj, raw, stream):
|
|||
obj.visual = ''
|
||||
|
||||
# Collect text in nested JSON content
|
||||
if 'content' in obj.raw:
|
||||
obj.content = obj.raw['content']
|
||||
elif 'fullContent' in obj.raw:
|
||||
obj.content = obj.raw['fullContent']
|
||||
else:
|
||||
if 'summary' in obj.raw:
|
||||
if 'content' in obj.raw['summary']:
|
||||
obj.content = obj.raw['summary']['content']
|
||||
else:
|
||||
obj.content = obj.raw['summary']
|
||||
elif 'content' in obj.raw:
|
||||
if 'content' in obj.raw['content']:
|
||||
obj.content = obj.raw['content']['content']
|
||||
else:
|
||||
obj.content = obj.raw['content']
|
||||
elif 'fullContent' in obj.raw:
|
||||
obj.content = obj.raw['fullContent']
|
||||
else:
|
||||
obj.content = ''
|
||||
|
||||
|
|
Loading…
Reference in a new issue