mirror of
https://github.com/fHDHR/fHDHR_NextPVR.git
synced 2025-12-06 13:06:59 -05:00
Merge pull request #23 from deathbybandaid/dev
Add Additional Functionality
This commit is contained in:
commit
e80b99076e
@ -22,3 +22,4 @@ reporting_manufacturer = BoronDust
|
||||
reporting_model = fHDHR
|
||||
reporting_firmware_ver = 20201001
|
||||
reporting_tuner_type = Antenna
|
||||
device_auth = fHDHR
|
||||
|
||||
@ -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()):
|
||||
|
||||
@ -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"
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user