remove content-type starting with text

This commit is contained in:
Roy Olav Purser 2021-06-03 14:24:49 +02:00
parent cdc28ebc13
commit d3808c43f8
Signed by: roypur
GPG Key ID: E14D26A036F21656

View File

@ -123,8 +123,10 @@ class StreamProvider():
except Exception as e: except Exception as e:
self.logger.info("%s <%s>", e, self.upstream) self.logger.info("%s <%s>", e, self.upstream)
else: else:
ctype = resp.headers.get("Content-Type", "binary/octet-stream") ctype = resp.headers.get("Content-Type", "binary/octet-stream").lower()
if "mpegurl" in ctype.lower(): if ctype.startswith("text"):
ctype = None
elif "mpegurl" in ctype:
ctype = "application/vnd.apple.mpegurl" ctype = "application/vnd.apple.mpegurl"
return StreamData(data.upstream(), ctype, data.thumbnail(), data.title(), data.description(), data.override) return StreamData(data.upstream(), ctype, data.thumbnail(), data.title(), data.description(), data.override)
async def run(self): async def run(self):