From 36c7baab8d0e726a0cfcbc447d94830746626829 Mon Sep 17 00:00:00 2001 From: Martin Rotter Date: Tue, 11 Apr 2023 08:17:52 +0200 Subject: [PATCH] fix translate py --- resources/scripts/scrapers/translate-feed.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/resources/scripts/scrapers/translate-feed.py b/resources/scripts/scrapers/translate-feed.py index 7c6845a6b..e665b5dc2 100644 --- a/resources/scripts/scrapers/translate-feed.py +++ b/resources/scripts/scrapers/translate-feed.py @@ -48,6 +48,7 @@ except ET.ParseError as err: translator = Translator() atom_ns = {"ns": "http://www.w3.org/2005/Atom"} +cont_ns = {"cont": "http://purl.org/rss/1.0/modules/content/"} def translate_string(to_translate): try: @@ -73,7 +74,11 @@ def process_article(article): title.text = translate_string(title.text) # RSS. - contents = article.find("description") + contents = article.find("cont:encoded", cont_ns) + + if contents is None: + # RSS. + contents = article.find("description") if contents is None: # ATOM.