derp
This commit is contained in:
parent
85b38527bc
commit
d12e9ca882
15
stream.py
15
stream.py
@ -322,21 +322,6 @@ class MainHandler(tornado.web.RequestHandler):
|
|||||||
self.set_header("Content-Type", "application/vnd.apple.mpegurl")
|
self.set_header("Content-Type", "application/vnd.apple.mpegurl")
|
||||||
else:
|
else:
|
||||||
self.set_header("Content-Type", ctype)
|
self.set_header("Content-Type", ctype)
|
||||||
ldata = {}
|
|
||||||
ldata["upstream"] = upstream
|
|
||||||
ldata["proxy"] = handler.proxy.proxy
|
|
||||||
ldata["proxied"] = isinstance(handler.proxy.proxy, str)
|
|
||||||
links = [ldata]
|
|
||||||
if isinstance(proxy_server, str):
|
|
||||||
try:
|
|
||||||
resp = requests.post(proxy_server, json=links)
|
|
||||||
if isinstance(resp.text, str):
|
|
||||||
new_links = json.loads(resp.text)
|
|
||||||
if isinstance(new_links, list) and len(new_links) == 1:
|
|
||||||
upstream = new_links.pop()
|
|
||||||
except Exception as e:
|
|
||||||
logger.info(e)
|
|
||||||
if data is None:
|
|
||||||
if redir:
|
if redir:
|
||||||
upstream = await handler.proxy.proxy_url(upstream, None)
|
upstream = await handler.proxy.proxy_url(upstream, None)
|
||||||
self.redirect(upstream, status=303)
|
self.redirect(upstream, status=303)
|
||||||
|
Loading…
Reference in New Issue
Block a user