update rss_proxy.py
* testing fixes description
This commit is contained in:
@@ -53,7 +53,7 @@ def init_proxy(app):
|
|||||||
r = requests.get(url, timeout=10, proxies=proxies)
|
r = requests.get(url, timeout=10, proxies=proxies)
|
||||||
|
|
||||||
xml_data = r.text
|
xml_data = r.text
|
||||||
xml_data = xml_data.replace("&", "&")
|
# xml_data = xml_data.replace("&", "&")
|
||||||
_encoding = xml_data.split('encoding="')[1].split('"')[0]
|
_encoding = xml_data.split('encoding="')[1].split('"')[0]
|
||||||
if '<?xml version="1.0" encoding="' in xml_data:
|
if '<?xml version="1.0" encoding="' in xml_data:
|
||||||
xml_data = xml_data.replace(
|
xml_data = xml_data.replace(
|
||||||
@@ -93,6 +93,7 @@ def init_proxy(app):
|
|||||||
normalize_xml_texts(item)
|
normalize_xml_texts(item)
|
||||||
|
|
||||||
item_str = ET.tostring(item, encoding="unicode")
|
item_str = ET.tostring(item, encoding="unicode")
|
||||||
|
item_str = html.unescape(item_str)
|
||||||
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