Need help fixin' a code in a Python Program
But can't post it on here.
So, pretty much...Artificial or Sk8er, IM me on MSN at xsilentshadowx@hotmail.com
Or any other trustworthy member, if I can preapprove it. The program can't really be stated at the moment...So yeah. >.<
Well actually...It's this login:
Code:
def login(self, username, password, sess):
"""Login to Gaiaonline with an Advanced Method"""
username = username.replace(' ', '+')
#Encrypt password
sPass = self.md5Digest(password) #Obtain salted password...
#URL to Post to
strURL = "http://www.gaiaonline.com/chat/gsi/gateway.php"
randTime = str(long(time.time())) + str(random.randrange(100, 999))
#Post data
pData = 'X=;' + randTime + '&v=phpobject&m=' + 'a:1:{i:0;a:2:{i:0;s:3:"108";i:1;a:2:{i:0;s:' + str(len(username)) + ':"' + username + '";i:1;s:32:"' + sPass +'";}}}'
#Set the referer in the HTTP Headers
sess.setReferer("http://s2.cdn.gaiaonline.com/images/Gaia_Flash/FISHING/bassken_game4.15.swf")
#Send the HTTP Request
strHTML = sess.get(strURL, pData)
if strHTML == None:
return None
strHTML = urllib.unquote_plus(strHTML)
if strHTML.find('did not match') > 0: #User/Pass missmatch
return False
elif strHTML.find('b:1;i:2') > 0: #Logged in
return True
return False
May be another problem, but I'm not sure. =/