Forums

[Errno 111] Connection refused

I'm using python opensubtitles API to download subtitles from the web. Everything works fine on localhost, but when I try to deploy on pythonanywhere I get this error. [Errno 111] Connection refused. I tried to contact opensubtitles support, but they think it's a network/server issue, but not on their side (ie. they're not blocking the connection), which is reinforced by the fact that it works on localhost. I'm pasting the complete error stack.

/pythonopensubtitles/opensubtitles.py", line 30, in login self.language, Settings.USER_AGENT) File "/usr/lib/python2.7/xmlrpclib.py", line 1224, in call return self.__send(self.__name, args) File "/usr/lib/python2.7/xmlrpclib.py", line 1578, in __request verbose=self.__verbose File "/usr/lib/python2.7/xmlrpclib.py", line 1264, in request return self.single_request(host, handler, request_body, verbose) File "/usr/lib/python2.7/xmlrpclib.py", line 1292, in single_request self.send_content(h, request_body) File "/usr/lib/python2.7/xmlrpclib.py", line 1439, in send_content connection.endheaders(request_body) File "/usr/lib/python2.7/httplib.py", line 969, in endheaders self._send_output(message_body) File "/usr/lib/python2.7/httplib.py", line 829, in _send_output self.send(msg) File "/usr/lib/python2.7/httplib.py", line 791, in send self.connect() File "/usr/lib/python2.7/httplib.py", line 772, in connect self.timeout, self.source_address) File "/usr/lib/python2.7/socket.py", line 571, in create_connection raise err error: [Errno 111] Connection refused

Hi kprz,

Please see this wiki post for more details. Unfortunately, we only allow anonymous users to connect to a predefined whitelist.