retry streamlink

This commit is contained in:
Roy Olav Purser 2021-05-15 01:22:34 +02:00
parent 8475d928a2
commit a6a7488438
Signed by: roypur
GPG Key ID: E14D26A036F21656

View File

@ -327,12 +327,15 @@ class MainHandler(tornado.web.RequestHandler):
async def handle_stream(self, handler, redir):
upstream = None
streams = None
for i in range(5):
try:
logger.info(handler.proxy)
streams = handler.proxy.stream().streams(handler.upstream)
except Exception as e:
logger.info(e)
else:
break
if streams is not None:
for key in reversed(streams):
stream = streams.get(key)
if hasattr(stream, "url"):