diff --git a/stream.py b/stream.py index 458b15d..62f75ba 100755 --- a/stream.py +++ b/stream.py @@ -75,7 +75,7 @@ if icecast_server is not None and stream_server is not None: template_html = None template_js = None -template_embed = tornado.template.Template('') +template_embed = tornado.template.Template('') videojs_version = None castjs_version = None @@ -218,7 +218,6 @@ class MainHandler(tornado.web.RequestHandler): elif isinstance(height_str, str): height = int((height // 9) * 9) width = int((height * 16) // 9) - origin = self.request.path if stream_server is not None: origin = f'{stream_server}{self.request.path}' @@ -227,7 +226,9 @@ class MainHandler(tornado.web.RequestHandler): embed_json["type"] = "video" embed_json["width"] = width embed_json["height"] = height - embed_json["html"] = str(template_embed.generate(origin=origin, provider=provider), "utf-8") + embed_json["provider_name"] = "stream.purser.it" + embed_json["provider_url"] = "https://stream.purser.it" + embed_json["html"] = str(template_embed.generate(origin=origin, provider=provider, width=width, height=height), "utf-8") self.set_header("Content-Type", "application/json; charset=utf-8") self.write(json.dumps(embed_json))