1
0
mirror of https://github.com/fHDHR/fHDHR_NextPVR.git synced 2025-12-06 07:46:58 -05:00

Merge pull request #4 from deathbybandaid/dev

Just pull a single stream
This commit is contained in:
Deathbybandaid 2020-09-30 13:23:43 -04:00 committed by GitHub
commit 06df50d941
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 2 deletions

View File

@ -251,8 +251,7 @@ class HDHR_HTTP_Server():
if 'method' in list(request.args.keys()): if 'method' in list(request.args.keys()):
if 'channel' in list(request.args.keys()): if 'channel' in list(request.args.keys()):
station_list = hdhr.serviceproxy.get_channel_streams() channelUri = hdhr.serviceproxy.get_channel_stream(str(request.args["channel"]))
channelUri = station_list[str(request.args["channel"])]
if not channelUri: if not channelUri:
abort(404) abort(404)

View File

@ -181,6 +181,16 @@ class proxyserviceFetcher():
total_channels += 1 total_channels += 1
return total_channels 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): def get_channel_streams(self):
streamdict = {} streamdict = {}
for c in self.get_channels(): for c in self.get_channels():