File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed
Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change 1515# multiple-provider agreement before returning an IP.
1616IP_ADDRESS_REGEX = re .compile ('\d{1,3}(?:\.\d{1,3}){3}' )
1717
18- USER_AGENT = 'Mozilla/5.0'
19-
20-
2118class GandiServerProxy (object ):
2219 '''
2320 Proxy calls to an internal xmlrpclib.ServerProxy instance, accounting for the
@@ -66,9 +63,8 @@ def get_external_ip_from_url(url):
6663 '''Get all the IP addresses found at a given URL.'''
6764
6865 # open the website, download its data, and return all IP strings found
69- opener = urllib2 .build_opener ()
70- opener .addheaders = [('User-agent' , USER_AGENT )]
71- data = opener .open (url , timeout = 10 ).read ()
66+ # we want to respect some site's filtering on User-Agent.
67+ data = urllib2 .urlopen (url , timeout = 10 ).read ()
7268 addys = IP_ADDRESS_REGEX .findall (data )
7369 return addys
7470
You can’t perform that action at this time.
0 commit comments