mirror of
https://github.com/fHDHR/fHDHR_NextPVR.git
synced 2025-12-06 08:26:57 -05:00
Improve Tuner Methods per Origin
This commit is contained in:
parent
72627510aa
commit
884d4b6e27
@ -164,7 +164,7 @@ class Channel():
|
||||
|
||||
@property
|
||||
def api_stream_url(self):
|
||||
return '/api/tuners?method=%s&channel=%s&origin=%s' % (self.fhdhr.config.dict["streaming"]["method"], self.dict["id"], self.origin)
|
||||
return '/api/tuners?method=stream&stream_method=%s&channel=%s&origin=%s' % (self.fhdhr.origins.origins_dict[self.origin].stream_method, self.dict["id"], self.origin)
|
||||
|
||||
@property
|
||||
def api_m3u_url(self):
|
||||
|
||||
@ -36,7 +36,7 @@ class Tuners():
|
||||
if origin and origin not in origin_methods:
|
||||
return "%s Invalid channels origin" % origin
|
||||
|
||||
if method in list(self.fhdhr.config.dict["streaming"]["valid_methods"].keys()):
|
||||
if method == "stream":
|
||||
|
||||
channel_number = request.args.get('channel', None, type=str)
|
||||
if not channel_number:
|
||||
@ -73,6 +73,13 @@ class Tuners():
|
||||
origin = chan_obj.origin
|
||||
channel_number = chan_obj.number
|
||||
|
||||
stream_method = request.args.get('stream_method', default=self.fhdhr.origins.origins_dict[origin].stream_method, type=str)
|
||||
if stream_method not in list(self.fhdhr.config.dict["streaming"]["valid_methods"].keys()):
|
||||
response = Response("Service Unavailable", status=503)
|
||||
response = Response("Service Unavailable", status=503)
|
||||
response.headers["X-fHDHR-Error"] = str("806 - Tune Failed")
|
||||
abort(response)
|
||||
|
||||
duration = request.args.get('duration', default=0, type=int)
|
||||
|
||||
transcode_quality = request.args.get('transcode', default=None, type=str)
|
||||
@ -86,7 +93,7 @@ class Tuners():
|
||||
stream_args = {
|
||||
"channel": channel_number,
|
||||
"origin": origin,
|
||||
"method": method,
|
||||
"method": stream_method,
|
||||
"duration": duration,
|
||||
"origin_quality": self.fhdhr.config.dict["streaming"]["origin_quality"],
|
||||
"transcode_quality": transcode_quality or self.fhdhr.config.dict["streaming"]["transcode_quality"],
|
||||
|
||||
@ -20,7 +20,7 @@ class Auto():
|
||||
|
||||
origin = self.source
|
||||
|
||||
redirect_url = "/api/tuners?method=%s" % (self.fhdhr.config.dict["streaming"]["method"])
|
||||
redirect_url = "/api/tuners?method=stream"
|
||||
|
||||
if channel.startswith("v"):
|
||||
channel_number = channel.replace('v', '')
|
||||
@ -40,6 +40,7 @@ class Auto():
|
||||
|
||||
redirect_url += "&channel=%s" % str(channel_number)
|
||||
redirect_url += "&origin=%s" % str(origin)
|
||||
redirect_url += "&stream_method=%s" % self.fhdhr.origins.origins_dict[origin].stream_method
|
||||
|
||||
duration = request.args.get('duration', default=0, type=int)
|
||||
if duration:
|
||||
|
||||
@ -20,7 +20,7 @@ class Tuner():
|
||||
|
||||
origin = self.source
|
||||
|
||||
redirect_url = "/api/tuners?method=%s" % (self.fhdhr.config.dict["streaming"]["method"])
|
||||
redirect_url = "/api/tuners?method=stream"
|
||||
|
||||
redirect_url += "&tuner=%s" % (tuner_number)
|
||||
|
||||
@ -42,6 +42,7 @@ class Tuner():
|
||||
|
||||
redirect_url += "&channel=%s" % str(channel_number)
|
||||
redirect_url += "&origin=%s" % str(origin)
|
||||
redirect_url += "&stream_method=%s" % self.fhdhr.origins.origins_dict[origin].stream_method
|
||||
|
||||
duration = request.args.get('duration', default=0, type=int)
|
||||
if duration:
|
||||
|
||||
@ -23,12 +23,9 @@ class RMG_Devices_DeviceKey_Media():
|
||||
response.headers["X-fHDHR-Error"] = "801 - Unknown devicekey"
|
||||
self.fhdhr.logger.error(response.headers["X-fHDHR-Error"])
|
||||
abort(response)
|
||||
|
||||
method = self.fhdhr.config.dict["streaming"]["method"]
|
||||
redirect_url = "/api/tuners?method=%s" % (method)
|
||||
|
||||
origin = devicekey.split(self.fhdhr.config.dict["main"]["uuid"])[-1]
|
||||
redirect_url += "&origin=%s" % (origin)
|
||||
|
||||
redirect_url = "/api/tuners?method=stream"
|
||||
|
||||
if str(channel).startswith('id://'):
|
||||
channel = str(channel).replace('id://', '')
|
||||
@ -36,7 +33,10 @@ class RMG_Devices_DeviceKey_Media():
|
||||
channel_tuple = channel.replace('triplet://', '').split(":")
|
||||
self.fhdhr.logger.error("Not Implemented %s" % ":".join(channel_tuple))
|
||||
abort(501, "Not Implemented %s" % ":".join(channel_tuple))
|
||||
|
||||
redirect_url += "&channel=%s" % (channel)
|
||||
redirect_url += "&origin=%s" % (origin)
|
||||
redirect_url += "&stream_method=%s" % self.fhdhr.origins.origins_dict[origin].stream_method
|
||||
|
||||
redirect_url += "&accessed=%s" % urllib.parse.quote(request.url)
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user