Some more testing with Safire's code:
Works well on Ubuntu 17.10:
Code: Select all
sander@sammie-1710:~$ python -c "import urllib2; req = urllib2.Request('https://www.binsearch.info/?action=nzb&402809786=1'); req.add_header('User-Agent', 'SABnzbd'); print urllib2.urlopen(req).read()[:200] "
<?xml version="1.0" encoding="iso-8859-1" ?>
<!DOCTYPE nzb PUBLIC "-//newzBin//DTD NZB 1.0//EN" "http://www.newzbin.com/DTD/nzb/nzb-1.0.dtd">
<!-- NZB Generated by Binsearch.info -->
<nzb xmlns="ht
sander@sammie-1710:~$
SSL handshake error on old Ubuntu 14.04 with old python 2.7.6:
Code: Select all
sander@haring:~$ python -c "import urllib2; req = urllib2.Request('https://www.binsearch.info/?action=nzb&402809786=1'); req.add_header('User-Agent', 'SABnzbd'); print urllib2.urlopen(req).read()[:200] "
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/python2.7/urllib2.py", line 127, in urlopen
return _opener.open(url, data, timeout)
File "/usr/lib/python2.7/urllib2.py", line 404, in open
response = self._open(req, data)
File "/usr/lib/python2.7/urllib2.py", line 422, in _open
'_open', req)
File "/usr/lib/python2.7/urllib2.py", line 382, in _call_chain
result = func(*args)
File "/usr/lib/python2.7/urllib2.py", line 1222, in https_open
return self.do_open(httplib.HTTPSConnection, req)
File "/usr/lib/python2.7/urllib2.py", line 1184, in do_open
raise URLError(err)
urllib2.URLError: <urlopen error [Errno 1] _ssl.c:510: error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure>
sander@haring:~$
OK with same old Ubuntu 14.04 with newer python 2.7.11:
Code: Select all
sander@haring:~$ python2711 -c "import urllib2; req = urllib2.Request('https://www.binsearch.info/?action=nzb&402809786=1'); req.add_header('User-Agent', 'SABnzbd'); print urllib2.urlopen(req).read()[:200] "
<?xml version="1.0" encoding="iso-8859-1" ?>
<!DOCTYPE nzb PUBLIC "-//newzBin//DTD NZB 1.0//EN" "http://www.newzbin.com/DTD/nzb/nzb-1.0.dtd">
<!-- NZB Generated by Binsearch.info -->
<nzb xmlns="ht
sander@haring:~$