From 1d78b1c59282ede4b1e0d29c9328dcd3400188be Mon Sep 17 00:00:00 2001 From: Jason Schwarzenberger Date: Tue, 10 Nov 2020 15:34:21 +1300 Subject: [PATCH] fix favicon url. --- apiserver/feeds/news.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apiserver/feeds/news.py b/apiserver/feeds/news.py index 255b552..9bf1a84 100644 --- a/apiserver/feeds/news.py +++ b/apiserver/feeds/news.py @@ -145,7 +145,9 @@ class _Base: favicon = soup.find_all('link', rel="shortcut icon", href=True) others = soup.find_all('link', rel="icon", href=True) icons = icon32 + icon16 + favicon + others + base_url = '/'.join(ref.split('/')[:3]) icons = list(set([i.get('href') for i in icons])) + icons = [i if i.startswith('http') else base_url + i for i in icons] if icons: s['icon'] = icons[0]