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():