2019-06-23, 06:24
Hi there,
Does anyone know where can I get the spotty source code, I cannot find it.
I am looking for it because Yesterday my Spotify Addons (LibreSpot and Spotify) stopped working and I found with my network sniffer a pattern that the apresolve returns a list of possible aps, but both AddOns are just trying to connect with the first one, they do not try another from the list as the official app does it, so I am currently hacking the JSON response and simulating that the localhost is the apresolve.
This line get the ap_list and removes all the servers that uses tcp:4070 and then creates the fake response file
curl -s 'http://apresolve.spotify.com' | python -c "import sys, json; print('{\'ap_list\':'+ str([url for url in json.load(sys.stdin)['ap_list'] if '4070' not in url]) + '}')" > /storage/files/file.json
this line makes the trick, so it "redirects" apresolve.spotify.com to localhost
echo "127.0.0.1 apresolve.spotify.com" >> /run/connman/hosts
And finally start a webserver that is publishing the fake response
httpd -c /storage/httpd.conf
my httpd.conf had this:
H:/storage/files/ # define the server root. It will override -h
A:127.0.0.1 # Allow just localhost requests
E404:/usr/www/error/404.html # /path/e404.html is the 404 (not found) error page
I:file.json # Show default file when a directory is requested
I put this on the autostart.sh script and it is working prety fast and stable, but Idont like to have workarounds working , so I would like to add a iteration to the spotty so try another ap from ap_list.
Any help help would be appreciated.
It has been tested on Linux x86_64 and LibreElec 9 on RPI2 and RPI3
Does anyone know where can I get the spotty source code, I cannot find it.
I am looking for it because Yesterday my Spotify Addons (LibreSpot and Spotify) stopped working and I found with my network sniffer a pattern that the apresolve returns a list of possible aps, but both AddOns are just trying to connect with the first one, they do not try another from the list as the official app does it, so I am currently hacking the JSON response and simulating that the localhost is the apresolve.
This line get the ap_list and removes all the servers that uses tcp:4070 and then creates the fake response file
curl -s 'http://apresolve.spotify.com' | python -c "import sys, json; print('{\'ap_list\':'+ str([url for url in json.load(sys.stdin)['ap_list'] if '4070' not in url]) + '}')" > /storage/files/file.json
this line makes the trick, so it "redirects" apresolve.spotify.com to localhost
echo "127.0.0.1 apresolve.spotify.com" >> /run/connman/hosts
And finally start a webserver that is publishing the fake response
httpd -c /storage/httpd.conf
my httpd.conf had this:
H:/storage/files/ # define the server root. It will override -h
A:127.0.0.1 # Allow just localhost requests
E404:/usr/www/error/404.html # /path/e404.html is the 404 (not found) error page
I:file.json # Show default file when a directory is requested
I put this on the autostart.sh script and it is working prety fast and stable, but Idont like to have workarounds working , so I would like to add a iteration to the spotty so try another ap from ap_list.
Any help help would be appreciated.
It has been tested on Linux x86_64 and LibreElec 9 on RPI2 and RPI3