diff --git a/backend/stream.py b/backend/stream.py index 6ba586d..7195076 100755 --- a/backend/stream.py +++ b/backend/stream.py @@ -281,13 +281,12 @@ try: except Exception as e: logger.info(e) -async def rewrite(current, proxy): +async def rewrite(upstream, current, proxy): ndata = None text = None try: async with proxy.session() as session: - logger.info(current) - resp = await session.get(current) + resp = await session.get(upstream) text = await resp.text() logger.info(text) except Exception as e: @@ -386,7 +385,7 @@ class MainHandler(tornado.web.RequestHandler): ctype = await handler.proxy.content_type(upstream_proxy) data = None if "mpegurl" in ctype.lower(): - data = await rewrite(upstream, handler.proxy) + data = await rewrite(upstream_proxy, upstream, handler.proxy) if isinstance(data, str): self.set_header("Content-Type", "application/vnd.apple.mpegurl") self.write(data)