diff --git a/proxy/rss_proxy.py b/proxy/rss_proxy.py index d3c8e08..5ea4aec 100755 --- a/proxy/rss_proxy.py +++ b/proxy/rss_proxy.py @@ -27,8 +27,10 @@ def init_proxy(app): # Получаем ленту proxies = {"http": PROXY_URL, "https": PROXY_URL} if PROXY_URL else None r = requests.get(url, timeout=10, proxies=proxies) - r.encoding = "windows-1251" if "windows-1251" in r.headers.get("content-type", "").lower() else r.apparent_encoding - xml_data = r.text.replace('', '') + _encode = r.apparent_encoding.lower() + r.encoding = _encode + xml_data = r.text.replace(f'', + '') # Разбираем XML root = ET.fromstring(xml_data)