This commit is contained in:
deathbybandaid 2021-02-04 09:24:11 -05:00
parent 93b9f03792
commit ab0c55bd4c

View File

@ -1,4 +1,6 @@
from flask import request, render_template, session
from flask import request, render_template_string, session
import pathlib
from io import StringIO
class Watch_HTML():
@ -11,6 +13,10 @@ class Watch_HTML():
def __init__(self, fhdhr, plugin_utils):
self.fhdhr = fhdhr
self.template_file = pathlib.Path(plugin_utils.config.dict["plugin_web_paths"][plugin_utils.namespace]["path"]).joinpath('webwatch.html')
self.template = StringIO()
self.template.write(open(self.template_file).read())
def __call__(self, *args):
return self.get(*args)
@ -23,4 +29,4 @@ class Watch_HTML():
watch_url = '%s/api/tuners?method=stream&channel=%s&origin=%s&stream_method=webwatch' % (base_url, channel_id, origin)
return render_template('webwatch.html', request=request, session=session, fhdhr=self.fhdhr, watch_url=watch_url)
return render_template_string(self.template.getvalue(), request=request, session=session, fhdhr=self.fhdhr, watch_url=watch_url)