You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 6, 2023. It is now read-only.
为什么我正确地输入了用户名和密码,然而却返回的用户名与密码不对啊?
`
from bilibili import bilibili
from printer import Printer
import base64
import configloader
import requests
username = '13408667618'
password = '13977586531W'
headers = {
'Accept': 'application/json, text/plain, /',
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36',
'Host': 'passport.bilibili.com',
'cookie': "sid=hxt5szbb"
}
s = requests.session()
url = "https://passport.bilibili.com/captcha"
res = s.get(url, headers=headers) # 用于获取验证码图片
tmp1 = base64.b64encode(res.content)
captcha = bilibili().cnn_captcha(tmp1)
temp_params = 'actionKey=' + bilibili().dic_bilibili[
'actionKey'] + '&appkey=' + bilibili().dic_bilibili['appkey'] + '&build=' + bilibili().dic_bilibili[
'build'] + '&captcha=' + captcha + '&device=' + bilibili().dic_bilibili[
'device'] + '&mobi_app=' +
bilibili().dic_bilibili['mobi_app'] + '&password=' + password + '&platform=' +
bilibili().dic_bilibili[
'platform'] + '&username=' + username
sign = bilibili().calc_sign(temp_params)
payload = temp_params + '&sign=' + sign
headers['Content-type'] = "application/x-www-form-urlencoded"
headers['cookie'] = "sid=hxt5szbb"
url = "https://passport.bilibili.com/api/v2/oauth2/login"
response = s.post(url, data=payload, headers=headers)
print(response.text)
print(response.json())
`
这个运行之后返回的结果是
此次登录出现验证码,识别结果为2B4MN {"ts":1534167028,"code":-629,"message":"账号或者密码错误"} {'ts': 1534167028, 'code': -629, 'message': '账号或者密码错误'}
求问一下问题在哪里。。。
The text was updated successfully, but these errors were encountered: