diff --git a/src/parsing/utils.py b/src/parsing/utils.py index edd6cdbc2e..65abede732 100644 --- a/src/parsing/utils.py +++ b/src/parsing/utils.py @@ -258,8 +258,8 @@ class EntryParsed: enclosures: list[Enclosure] = None content = ( - entry.get('content') # Atom - or entry.get('summary', '') # Atom summary or RSS description + entry.get('content') # Atom: ; JSON Feed: .content_html, .content_text + or entry.get('summary', '') # Atom: ; RSS: ) if isinstance(content, list) and len(content) > 0: # Atom @@ -271,6 +271,9 @@ class EntryParsed: else: content = content[0] content = content.get('value', '') + elif isinstance(content, dict): # JSON Feed + # TODO: currently feedparser always prefer content_text rather than content_html, we'd like to change that + content = content.get('value', '') EntryParsed.content = await html_validator(content) EntryParsed.link = entry.get('link') or entry.get('guid')