diff --git a/stream.py b/stream.py index f76d364..e03214a 100755 --- a/stream.py +++ b/stream.py @@ -211,9 +211,9 @@ class MainHandler(tornado.web.RequestHandler): ldata["proxied"] = isinstance(proxy.proxy, str) links = [ldata] resp = requests.post(proxy_server, json=links) - if isinstance(resp.text, list): + if isinstance(resp.text, str): new_links = json.loads(resp.text) - if len(new_links) == 1: + if isinstance(new_links, list) and len(new_links) == 1: upstream = new_links.pop() if data is None: self.redirect(upstream, status=303)