import urllib.request, urllib.error, urllib.parse
opener = urllib.request.build_opener()
opener.addheaders = [('Referer', 'http://www.python.org/')]
opener.open('http://www.example.com/')
setting referral url in python urllib.urlretrieve