Use content field within atom feeds

merge-requests/30/head
Bob Mottram 2023-06-27 22:27:51 +01:00
parent 4d447f3cbc
commit 95bfd678b0
1 changed files with 11 additions and 0 deletions

View File

@ -988,6 +988,11 @@ def _atom_feed_to_dict(base_dir: str, domain: str, xml_str: str,
description = atom_item.split('<summary>')[1]
description = remove_html(description.split('</summary>')[0])
description = unescaped_text(description)
elif '<content' in atom_item and '</content>' in atom_item:
description = atom_item.split('<content', 1)[1]
description = description.split('>', 1)[1]
description = remove_html(description.split('</content>')[0])
description = unescaped_text(description)
else:
if '<media:description>' in atom_item and \
'</media:description>' in atom_item:
@ -1212,6 +1217,12 @@ def _atom_feed_yt_to_dict(base_dir: str, domain: str, xml_str: str,
description = description.split('</summary>')[0]
description = unescaped_text(description)
description = remove_html(description)
elif '<content' in atom_item and '</content>' in atom_item:
description = atom_item.split('<content', 1)[1]
description = description.split('>', 1)[1]
description = description.split('</content>')[0]
description = unescaped_text(description)
description = remove_html(description)
link, _ = get_link_from_rss_item(atom_item, None, None)
if not link: