From a1e6fdb8f882631715efe66567f54cb4da6009cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89tienne=20Loks?= Date: Mon, 21 Jan 2019 02:46:37 +0100 Subject: [PATCH] handle vtuner api token requests A token request is now made at initialization. Reply to this request with an arbitrary token. --- ycast.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ycast.py b/ycast.py index 6963522..e31abab 100755 --- a/ycast.py +++ b/ycast.py @@ -38,7 +38,13 @@ class YCastServer(BaseHTTPRequestHandler): def do_GET(self): get_stations() self.address = 'http://' + self.headers['Host'] - if self.path == '/' \ + if self.path.startswith(VTUNER_INITURL + '?token='): + self.send_response(200) + self.send_header('Content-type', 'text/html') + self.end_headers() + self.wfile.write(bytes(XMLHEADER, 'utf-8')) + self.wfile.write(bytes('stub', 'utf-8')) + elif self.path == '/' \ or self.path == '/' + YCAST_LOCATION \ or self.path == '/' + YCAST_LOCATION + '/'\ or self.path.startswith(VTUNER_INITURL):