From 60052ffca30ec33b79eb36b0fe4d49b338f73ca1 Mon Sep 17 00:00:00 2001 From: François Schmidts Date: Fri, 31 Jul 2015 13:21:33 +0200 Subject: ensuring the icon isn't empty and redoing a bit of logging --- pyaggr3g470r/lib/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pyaggr3g470r/lib/utils.py') diff --git a/pyaggr3g470r/lib/utils.py b/pyaggr3g470r/lib/utils.py index a51b6c3e..b937b5a9 100644 --- a/pyaggr3g470r/lib/utils.py +++ b/pyaggr3g470r/lib/utils.py @@ -48,7 +48,7 @@ def try_get_b64icon(url, *splits): response = requests.get(rb_url, verify=False, timeout=10) # if html in content-type, we assume it's a fancy 404 page content_type = response.headers.get('content-type', '') - if response.ok and 'html' not in content_type: + if response.ok and 'html' not in content_type and response.content: return content_type + ( '\n%s' % base64.b64encode(response.content).decode('utf8')) return None -- cgit