mirror of
https://github.com/fHDHR/fHDHR_NextPVR.git
synced 2025-12-06 12:26:57 -05:00
Add Additional Functionality
This commit is contained in:
parent
ee5a124dd5
commit
b12e825f3a
@ -22,3 +22,4 @@ reporting_manufacturer = BoronDust
|
|||||||
reporting_model = fHDHR
|
reporting_model = fHDHR
|
||||||
reporting_firmware_ver = 20201001
|
reporting_firmware_ver = 20201001
|
||||||
reporting_tuner_type = Antenna
|
reporting_tuner_type = Antenna
|
||||||
|
device_auth = fHDHR
|
||||||
|
|||||||
@ -135,6 +135,17 @@ class HDHR_HTTP_Server():
|
|||||||
response=xmltv,
|
response=xmltv,
|
||||||
mimetype='application/xml')
|
mimetype='application/xml')
|
||||||
|
|
||||||
|
@app.route('/api/xmltv')
|
||||||
|
def api_xmltv():
|
||||||
|
if 'DeviceAuth' in list(request.args.keys()):
|
||||||
|
if request.args['DeviceAuth'] == hdhr.config.dict["dev"]["device_auth"]:
|
||||||
|
base_url = request.headers["host"]
|
||||||
|
xmltv = hdhr.get_xmltv(base_url)
|
||||||
|
return Response(status=200,
|
||||||
|
response=xmltv,
|
||||||
|
mimetype='application/xml')
|
||||||
|
return "not subscribed"
|
||||||
|
|
||||||
@app.route('/debug.json', methods=['GET'])
|
@app.route('/debug.json', methods=['GET'])
|
||||||
def debug_json():
|
def debug_json():
|
||||||
base_url = request.headers["host"]
|
base_url = request.headers["host"]
|
||||||
@ -148,6 +159,21 @@ class HDHR_HTTP_Server():
|
|||||||
image, imagetype = hdhr.get_image(request.args)
|
image, imagetype = hdhr.get_image(request.args)
|
||||||
return Response(image, content_type=imagetype, direct_passthrough=True)
|
return Response(image, content_type=imagetype, direct_passthrough=True)
|
||||||
|
|
||||||
|
@app.route('/auto/<channel>')
|
||||||
|
def auto(channel):
|
||||||
|
request_args = {
|
||||||
|
"channel": channel.replace('v', ''),
|
||||||
|
"method": hdhr.config.dict["fhdhr"]["stream_type"]
|
||||||
|
}
|
||||||
|
channel_id = request_args["channel"]
|
||||||
|
method, channelUri, content_type = hdhr.get_stream_info(request_args)
|
||||||
|
if channelUri:
|
||||||
|
if method == "direct":
|
||||||
|
return Response(hdhr.get_stream(channel_id, method, channelUri, content_type), content_type=content_type, direct_passthrough=True)
|
||||||
|
elif method == "ffmpeg":
|
||||||
|
return Response(stream_with_context(hdhr.get_stream(channel_id, method, channelUri, content_type)), mimetype="video/mpeg")
|
||||||
|
abort(503)
|
||||||
|
|
||||||
@app.route('/watch', methods=['GET'])
|
@app.route('/watch', methods=['GET'])
|
||||||
def watch():
|
def watch():
|
||||||
if 'method' in list(request.args.keys()) and 'channel' in list(request.args.keys()):
|
if 'method' in list(request.args.keys()) and 'channel' in list(request.args.keys()):
|
||||||
|
|||||||
@ -17,7 +17,7 @@ class Discover_JSON():
|
|||||||
"TunerCount": self.config.dict["fhdhr"]["tuner_count"],
|
"TunerCount": self.config.dict["fhdhr"]["tuner_count"],
|
||||||
"FirmwareVersion": self.config.dict["dev"]["reporting_firmware_ver"],
|
"FirmwareVersion": self.config.dict["dev"]["reporting_firmware_ver"],
|
||||||
"DeviceID": self.config.dict["main"]["uuid"],
|
"DeviceID": self.config.dict["main"]["uuid"],
|
||||||
"DeviceAuth": "fHDHR",
|
"DeviceAuth": self.config.dict["dev"]["device_auth"],
|
||||||
"BaseURL": "http://" + base_url,
|
"BaseURL": "http://" + base_url,
|
||||||
"LineupURL": "http://" + base_url + "/lineup.json"
|
"LineupURL": "http://" + base_url + "/lineup.json"
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user