From 92c4de2fe7a9e96d3a70853f98f16a8e5c57ec10 Mon Sep 17 00:00:00 2001 From: deathbybandaid Date: Wed, 30 Sep 2020 13:11:07 -0400 Subject: [PATCH] test --- fakehdhr/__init__.py | 3 +-- proxyservice/__init__.py | 10 ++++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/fakehdhr/__init__.py b/fakehdhr/__init__.py index e62d7a2..8c8442f 100644 --- a/fakehdhr/__init__.py +++ b/fakehdhr/__init__.py @@ -251,8 +251,7 @@ class HDHR_HTTP_Server(): if 'method' in list(request.args.keys()): if 'channel' in list(request.args.keys()): - station_list = hdhr.serviceproxy.get_channel_streams() - channelUri = station_list[str(request.args["channel"])] + channelUri = hdhr.serviceproxy.get_channel_stream(str(request.args["channel"])) if not channelUri: abort(404) diff --git a/proxyservice/__init__.py b/proxyservice/__init__.py index 9d32d1d..e228684 100644 --- a/proxyservice/__init__.py +++ b/proxyservice/__init__.py @@ -181,6 +181,16 @@ class proxyserviceFetcher(): total_channels += 1 return total_channels + def get_channel_stream(self, id): + url = ('%s%s:%s/live?channel=%s&client=%s' % + ("https://" if self.config["nextpvr"]["ssl"] else "http://", + self.config["nextpvr"]["address"], + str(self.config["nextpvr"]["port"]), + str(id), + str(id), + )) + return url + def get_channel_streams(self): streamdict = {} for c in self.get_channels():