add nextcloud support
This commit is contained in:
parent
23596f3c1b
commit
cabccfa7b5
@ -22,6 +22,11 @@ providers["nrk"] = "https://tv.nrk.no"
|
|||||||
providers["svt"] = "https://svtplay.se"
|
providers["svt"] = "https://svtplay.se"
|
||||||
providers["youtube"] = "https://www.youtube.com/watch?v="
|
providers["youtube"] = "https://www.youtube.com/watch?v="
|
||||||
providers["twitch"] = "https://twitch.tv"
|
providers["twitch"] = "https://twitch.tv"
|
||||||
|
|
||||||
|
nextcloud_server = os.environ.get("NEXTCLOUD_SERVER")
|
||||||
|
if nextcloud_server is not None:
|
||||||
|
providers["nextcloud"] = nextcloud_server
|
||||||
|
|
||||||
playlist = None
|
playlist = None
|
||||||
icecast_server = os.environ.get("ICECAST_SERVER")
|
icecast_server = os.environ.get("ICECAST_SERVER")
|
||||||
stream_server = os.environ.get("STREAM_SERVER")
|
stream_server = os.environ.get("STREAM_SERVER")
|
||||||
@ -341,7 +346,10 @@ class MainHandler(tornado.web.RequestHandler):
|
|||||||
self.write("HTML template missing.")
|
self.write("HTML template missing.")
|
||||||
|
|
||||||
async def handle_stream(self, handler, redir):
|
async def handle_stream(self, handler, redir):
|
||||||
streams = None
|
upstream = None
|
||||||
|
if handler.provider == "nextcloud":
|
||||||
|
upstream = handler.upstream
|
||||||
|
else:
|
||||||
upstream = await stream_providers.get_any(handler.upstream, handler.proxy, logger)
|
upstream = await stream_providers.get_any(handler.upstream, handler.proxy, logger)
|
||||||
if upstream is None:
|
if upstream is None:
|
||||||
logger.info(f'invalid upstream ({handler.provider})')
|
logger.info(f'invalid upstream ({handler.provider})')
|
||||||
|
Loading…
Reference in New Issue
Block a user