baidu.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:baidutongji 作者: yelord 项目源码 文件源码
def prelogin(self):
        data = {'username': self.username,
                'token': self.token,
                'functionName': 'preLogin',
                'uuid': UUID,
                'request': {'osVersion': 'windows', 'deviceType': 'pc', 'clientVersion': '1.0'},
                }

        headers = {'UUID': UUID, 'account_type': ACCOUNT_TYPE,
                   'Content-Type': 'data/gzencode and rsa public encrypt;charset=UTF-8'
                   }

        # ??
        post_data = gzencode(json.dumps(data))
        # ??
        post_data = encrypt(post_data)

        resp = requests.post(LOGIN_URL, data=post_data, headers=headers)
        ret = json.loads(gzdecode(resp.content[8:]))
        print 'prelogin:', ret
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号