Skip to content

Instantly share code, notes, and snippets.

@yasinkuyu
Created September 8, 2017 21:51
Show Gist options
  • Save yasinkuyu/bc68a0fbf410bc2b28118e3baad6d7b3 to your computer and use it in GitHub Desktop.
Save yasinkuyu/bc68a0fbf410bc2b28118e3baad6d7b3 to your computer and use it in GitHub Desktop.
Get Luminati Proxy
@yasinkuyu
def get_luminati_ip():
username = 'lum-customer-XXX-zone-XXX'
password = 'XXXX'
port = 22225
session_id = random.random()
super_proxy_url = ('http://%s-session-%s:%[email protected]:%d' %
(username, session_id, password, port))
proxy_handler = urllib2.ProxyHandler({
'http': super_proxy_url,
'https': super_proxy_url,
})
opener = urllib2.build_opener(proxy_handler)
cont = opener.open('http://lumtest.com/myip.json').read()
data = json.loads(cont)
print data
return "%s:%s" % (data["ip"], data["asn"]["asnum"])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment