From 7c990edeafd0136ef301bc1fae913d4b06067a12 Mon Sep 17 00:00:00 2001 From: rembo10 Date: Mon, 6 Jul 2015 00:34:16 -0700 Subject: [PATCH] Better fix for #2183 --- headphones/request.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/headphones/request.py b/headphones/request.py index 3916199a..1c6f0308 100644 --- a/headphones/request.py +++ b/headphones/request.py @@ -206,7 +206,7 @@ def server_message(response): message = None # First attempt is to 'read' the response as HTML - if response.headers.get("content-type") == "text/html": + if response.headers.get("content-type") and "text/html" in response.headers.get("content-type"): try: soup = BeautifulSoup(response.content, "html5lib") except Exception: