update rss_proxy.py
* testing fixes description
This commit is contained in:
@@ -78,6 +78,7 @@ def init_proxy(app):
|
|||||||
cache_key = f"rss:item:{guid.text}"
|
cache_key = f"rss:item:{guid.text}"
|
||||||
cached_item = rdb.get(cache_key)
|
cached_item = rdb.get(cache_key)
|
||||||
|
|
||||||
|
|
||||||
if cached_item:
|
if cached_item:
|
||||||
cached_items.append(cached_item.decode())
|
cached_items.append(cached_item.decode())
|
||||||
else:
|
else:
|
||||||
@@ -94,6 +95,9 @@ def init_proxy(app):
|
|||||||
|
|
||||||
item_str = ET.tostring(item, encoding="unicode")
|
item_str = ET.tostring(item, encoding="unicode")
|
||||||
item_str = html.unescape(item_str)
|
item_str = html.unescape(item_str)
|
||||||
|
title = item.find("title")
|
||||||
|
|
||||||
|
title.text = normalize_text(title.text)
|
||||||
rdb.setex(cache_key, CACHE_TTL, item_str)
|
rdb.setex(cache_key, CACHE_TTL, item_str)
|
||||||
new_items.append(item_str)
|
new_items.append(item_str)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user