crustymonkey / py-sonic

A python library to wrap the Subsonic REST API
http://stuffivelearned.org/doku.php?id=programming:python:py-sonic
GNU General Public License v3.0
57 stars 26 forks source link

Support for registered subsonic addresses #9

Closed Kygre closed 9 years ago

Kygre commented 9 years ago

Using:

Attempting to create a connection with a subsonic address fails: name.subsonic.org produces an error

Traceback (most recent call last): File "C:\Users\Supreme\Documents\Workspace\Test_Subsonic_API\root\Hello_Sub.py", line 16, in <module> pprint(conn.getStarred2()) File "C:\Users\Supreme\Documents\Workspace\Test_Subsonic_API\libsonic\connection.py", line 1820, in getStarred2 res = self._doInfoReq(req) File "C:\Users\Supreme\Documents\Workspace\Test_Subsonic_API\libsonic\connection.py", line 2394, in _doInfoReq res = self._opener.open(req) File "C:\Python27\lib\urllib2.py", line 431, in open response = self._open(req, data) File "C:\Python27\lib\urllib2.py", line 449, in _open '_open', req) File "C:\Python27\lib\urllib2.py", line 409, in _call_chain result = func(*args) File "C:\Python27\lib\urllib2.py", line 1227, in http_open return self.do_open(httplib.HTTPConnection, req) File "C:\Python27\lib\urllib2.py", line 1197, in do_open raise URLError(err) urllib2.URLError: <urlopen error [Errno 10061] No connection could be made because the target machine actively refused it>

crustymonkey commented 9 years ago

It looks like those connections actually hit an L7 http redirect that points to http:///?... This is not likely to work and should be completely avoided. Use the actual ip/port of your server, as the dns for name.subsonic.org does not resolve to the ip of your server. That or setup a dns name that actually points to the ip of your server. This won't be "fixed" as the name.subsonic.org thing is an ugly hack.