Пытаюсь авторизоваться на rutracker, не понимаю что не так?
#!/usr/bin/python
import urllib2
import urllib
theurl = 'http://login.rutracker.org/forum/login.php'
txdata = urllib.urlencode({'login_username' : 'username', 'login_password' : 'password'})
txheaders = {
'Host' : 'login.rutracker.org',
'User-Agent' : 'User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; ru; rv:1.9.2.10) Gecko/20100914 Firefox/3.6.10',
'Accept' : 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'Accept-Language' : 'ru-ru,ru;q=0.8,en-us;q=0.5,en;q=0.3',
'Accept-Encoding' : 'gzip,deflate',
'Accept-Charset' : 'windows-1251,utf-8;q=0.7,*;q=0.7',
'Keep-Alive' : '115',
'Connection': 'keep-alive',
'Referer' : 'http://login.rutracker.org/forum/login.php',
'Cookie' : 'spylog_test=1',
'Content-Type' : 'application/x-www-form-urlencoded',
# 'Content-Length' : '79'
}
req = urllib2.Request(theurl, txdata, txheaders)
handle = urllib2.urlopen(req)
print handle.info()
print handle.read()