From 0366e534d02f09f7d5f7ca60afb473744b0e707d Mon Sep 17 00:00:00 2001 From: Roy Olav Purser Date: Sun, 9 May 2021 11:14:45 +0200 Subject: [PATCH] move status print --- stream.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/stream.py b/stream.py index ebca68f..1d33235 100755 --- a/stream.py +++ b/stream.py @@ -48,10 +48,13 @@ if icecast_server is not None and stream_server is not None: def rewrite(current, proxy): resp = requests.head(current) - ctype = resp.headers.get("Content-Type", "text/plain").lower() + ctype = resp.headers.get("Content-Type") print(ctype) - if "mpegurl" not in ctype: + if ctype is None: return None + else: + if "mpegurl" not in ctype.lower(): + return None resp = requests.get(current) ndata = None if resp.text is not None: