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): async def handle_stream(self, handler, redir):
upstream = None upstream = None
try: streams = None
logger.info(handler.proxy) for i in range(5):
streams = handler.proxy.stream().streams(handler.upstream) try:
except Exception as e: streams = handler.proxy.stream().streams(handler.upstream)
logger.info(e) except Exception as e:
else: logger.info(e)
else:
break
if streams is not None:
for key in reversed(streams): for key in reversed(streams):
stream = streams.get(key) stream = streams.get(key)
if hasattr(stream, "url"): if hasattr(stream, "url"):