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

Merge pull request #23 from deathbybandaid/dev

Add Additional Functionality
This commit is contained in:
Deathbybandaid 2020-10-09 16:21:53 -04:00 committed by GitHub
commit e80b99076e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 28 additions and 1 deletions

View File

@ -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

View File

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

View File

@ -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"
} }