Skip to content

Commit

Permalink
handle vtuner api token requests
Browse files Browse the repository at this point in the history
A token request is now made at initialization. Reply to this
request with an arbitrary token.
  • Loading branch information
Nimn authored and milaq committed Jan 21, 2019
1 parent c085974 commit a1e6fdb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ycast.py
Original file line number Diff line number Diff line change
Expand Up @@ -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('<EncryptedToken>stub</EncryptedToken>', 'utf-8'))
elif self.path == '/' \
or self.path == '/' + YCAST_LOCATION \
or self.path == '/' + YCAST_LOCATION + '/'\
or self.path.startswith(VTUNER_INITURL):
Expand Down

0 comments on commit a1e6fdb

Please sign in to comment.