1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
import urllib
import urllib2
UA = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; de-DE; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3'
headers = { 'User-Agent' : UA }
url = 'https://uptobox.com/'
post_data = {}
post_data['op'] = 'login'
post_data['login'] = 'your_login' #to edit
post_data['password'] = 'your_mdp' #to edit
req = urllib2.Request(url, urllib.urlencode(post_data), headers)
req.add_header('cookie', 'xfss=XXXXXXXXXXX;') #to edit
try:
response = urllib2.urlopen(req)
except urllib2.URLError, e:
print "debug" + str(getattr(e, "code", None))
print "debug" + str(getattr(e, "reason", None))
sHtmlContent = response.read()
head = response.headers
cookies=response.info()['Set-Cookie']
response.close()
print cookies
print head
print 'Connected ' + str('op=my_account' in sHtmlContent) |
Partager