From 459cfe231dc236a87f78d0b7f4b2be02e0198dc3 Mon Sep 17 00:00:00 2001 From: Roy Olav Purser Date: Wed, 12 May 2021 00:22:55 +0200 Subject: [PATCH] check content type --- stream.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/stream.py b/stream.py index 99690fa..f76d364 100755 --- a/stream.py +++ b/stream.py @@ -91,7 +91,6 @@ def upstream_type(current, proxy): return resp.headers.get("Content-Type", "binary/octet-stream") def rewrite(current, provider, proxy, ctype): - resp = requests.get(current, proxies=proxy.req) ndata = None if resp.text is not None: @@ -203,7 +202,7 @@ class MainHandler(tornado.web.RequestHandler): else: ctype = upstream_type(upstream, proxy) data = None - if "mpgurl" in ctype: + if "mpegurl" in ctype.lower(): data = rewrite(upstream, provider, proxy) else: ldata = {}