update rss_proxy.py
* fixed broken guid rewrite in las commit
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user