update rss_proxy.py

* fixed broken guid rewrite in las commit
This commit is contained in:
2025-03-05 10:52:11 +03:00
parent 30883c2836
commit 72d6ede0e6

View File

@@ -83,12 +83,12 @@ def init_proxy(app):
description = item.find("description")
if description is not None:
new_guid = extract_viewtopic_link(description.text)
print(new_guid)
if new_guid:
print(f"Заменяю GUID: {guid.text}{new_guid}")
guid.attrib.clear()
guid.text = new_guid
guid.text = new_guid # 🔹 Теперь подмена делается ДО нормализации
# Нормализуем весь <item>
# 🔹 Теперь нормализуем весь item ПОСЛЕ замены guid
normalize_xml_texts(item)
item_str = ET.tostring(item, encoding="unicode")
@@ -102,3 +102,4 @@ def init_proxy(app):
except Exception as e:
return f"Error: {e}", 500