From 064a21a07ce97ff1cb2cf4542cec6fdf44727ff3 Mon Sep 17 00:00:00 2001 From: rembo10 Date: Mon, 6 Jul 2015 00:02:09 -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 6c8afda1..3916199a 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 and "text/html" in response.headers.get("content-type"): + if response.headers.get("content-type") == "text/html": try: soup = BeautifulSoup(response.content, "html5lib") except Exception: