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

Add Additional Functionality

This commit is contained in:
deathbybandaid 2020-10-09 16:01:15 -04:00
parent ee5a124dd5
commit b12e825f3a
3 changed files with 28 additions and 1 deletions

View File

@ -22,3 +22,4 @@ reporting_manufacturer = BoronDust
reporting_model = fHDHR
reporting_firmware_ver = 20201001
reporting_tuner_type = Antenna
device_auth = fHDHR

View File

@ -135,6 +135,17 @@ class HDHR_HTTP_Server():
response=xmltv,
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'])
def debug_json():
base_url = request.headers["host"]
@ -148,6 +159,21 @@ class HDHR_HTTP_Server():
image, imagetype = hdhr.get_image(request.args)
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'])
def watch():
if 'method' in list(request.args.keys()) and 'channel' in list(request.args.keys()):

View File

@ -17,7 +17,7 @@ class Discover_JSON():
"TunerCount": self.config.dict["fhdhr"]["tuner_count"],
"FirmwareVersion": self.config.dict["dev"]["reporting_firmware_ver"],
"DeviceID": self.config.dict["main"]["uuid"],
"DeviceAuth": "fHDHR",
"DeviceAuth": self.config.dict["dev"]["device_auth"],
"BaseURL": "http://" + base_url,
"LineupURL": "http://" + base_url + "/lineup.json"
}