add content-type to upstream

This commit is contained in:
Roy Olav Purser 2021-11-19 11:04:48 +01:00
parent 6fa6426f79
commit 8d10c54636
Signed by: roypur
GPG Key ID: E14D26A036F21656

View File

@ -51,7 +51,11 @@ class ProxyElem():
data_list = []
for url in urls:
data = {}
data["upstream"] = url
if isinstance(url, str):
data["upstream"] = url
elif isinstance(url, tuple):
data["upstream"] = url[0]
data["ctype"] = url[1]
data["proxy"] = self.proxy
data["proxied"] = isinstance(self.proxy, str)
data_list.append(data)
@ -240,7 +244,7 @@ class MainHandler(tornado.web.RequestHandler):
provider_data = await stream_providers.get_seafile(handler.upstream, handler.proxy, logger)
else:
provider_data = await stream_providers.get_any(handler.upstream, handler.proxy, logger)
proxied = await handler.proxy.proxy_url([provider_data.upstream(), provider_data.thumbnail()])
proxied = await handler.proxy.proxy_url([(provider_data.upstream(), provider_data.proxy_ctype()), provider_data.thumbnail()])
video_info = {}
video_info["upstream"] = proxied[0]
video_info["poster"] = proxied[1]