新博客地址:http://gorthon.sinaapp.com/
# _*_ encoding:utf-8 _*_
# author: 书记
# email: bh2[at]qq[dot]com
import json
import re
import urllib2
from hashlib import md5
import poster
from netbase import Net
class CloudDisk(object):
def __init__(self, email, pwd):
# 对密码进行md5 hash
self.pwd = md5(pwd).hexdigest()
self.email = email
self.n= Net()
self.login()
#self.reward()
self.upload()
def login(self):
print self.email, 'login...'
# 获取token:
html = self.n.get('https://login.360.cn/?o=sso&m=getToken&func=QHPass.loginUtils.tokenCallback&userName=%s&rand=0.6075735737103969&callback=QiUserJsonP1348367367684' % self.email)
token = eval(re.findall(r'(\{.*\})', html)[0])['token']