fix proxy ctype lookup

This commit is contained in:
Roy Olav Purser 2021-11-19 10:47:36 +01:00
parent 4413fddab4
commit 6fa6426f79
Signed by: roypur
GPG Key ID: E14D26A036F21656

View File

@ -85,9 +85,14 @@ class StreamData():
def upstream(self):
return self.values.get("upstream")
def ctype(self):
return self.values.get("ctype")
ctype = self.values.get("ctype")
proxy_ctype = self.values.get("proxy_ctype")
if isinstance(ctype, str) and isinstance(proxy_ctype, str):
if not ctype.startswith("audio/") and not ctype.startswith("video/"):
return proxy_ctype
return ctype
def proxy_ctype(self):
return self.values.get("ctype")
return self.values.get("proxy_ctype")
def thumbnail(self):
return self.values.get("thumbnail")
def title(self):
@ -169,8 +174,6 @@ class StreamProvider():
ctype = None
elif "mpegurl" in ctype:
ctype = "application/vnd.apple.mpegurl"
if ctype == "application/octet-stream" and isinstance(proxy_ctype, str):
ctype = proxy_ctype
return StreamData(data.upstream(), ctype, proxy_ctype, data.thumbnail(), data.title(), data.description(), data.override)
async def run(self):
data = None