mirror of
https://github.com/SocialSisterYi/bilibili-API-collect.git
synced 2024-12-27 13:00:29 +08:00
最新的短信登录接口 (#302)
This commit is contained in:
parent
05e7d447b0
commit
c25a8f4bf6
@ -3,8 +3,8 @@
|
||||
web端短信登录流程:
|
||||
|
||||
1. [完成人机验证](readme.md)
|
||||
2. 发送短信,使用国际地区代码`cid`+手机号码`tel`+登录密钥`key`+极验`challenge`+验证结果`validate`+验证结果`seccode`
|
||||
3. 提交短信验证码以验证登录操作,使用国际地区代码`cid`+手机号码`tel`+短信验证码`smsCode`
|
||||
2. 发送短信,使用国际地区代码`cid`+手机号码`tel`+登录密钥`token`+极验`challenge`+验证结果`validate`+验证结果`seccode`
|
||||
3. 提交短信验证码以验证登录操作,使用国际地区代码`cid`+手机号码`tel`+短信验证码`code`
|
||||
|
||||
---
|
||||
|
||||
@ -113,7 +113,8 @@ curl 'http://passport.bilibili.com/web/generic/country/list'
|
||||
| 参数名 | 类型 | 内容 | 必要性 | 备注 |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| tel | num | 手机号码 | 必要 | |
|
||||
| cid | num | 国际地区代码 | 必要 | |
|
||||
| cid | num | 国际地区代码 | 必要 | |
|
||||
| source | str | 固定为`main_web` | 必要 | |
|
||||
| token | str | 在获取gt,challenge处url有 | 必要 | |
|
||||
| challenge | str | 极验challenge | 必要 | 从B站API获取 |
|
||||
| validate | str | 极验结果 | 必要 | 从极验获取 |
|
||||
@ -135,12 +136,11 @@ captcha_key在下方传参时需要,请备用.
|
||||
例如手机号为`13888888888`,国际id为`1(中国大陆)`,登录秘钥为`aabbccdd`,极验challenge为`2333`,极验结果为`666666`,进行发送短信验证码操作
|
||||
|
||||
```shell
|
||||
curl 'http://passport.bilibili.com/web/sms/general/v2/send' \
|
||||
curl 'http://passport.bilibili.com/x/passport-login/web/sms/send' \
|
||||
--data-urlencode 'tel=13888888888' \
|
||||
--data-urlencode 'cid=1' \
|
||||
--data-urlencode 'type=21' \
|
||||
--data-urlencode 'captchaType=6' \
|
||||
--data-urlencode 'key=aabbccdd' \
|
||||
--data-urlencode 'source=main_web' \
|
||||
--data-urlencode 'token=aabbccdd' \
|
||||
--data-urlencode 'challenge=2333' \
|
||||
--data-urlencode 'validate=666666' \
|
||||
--data-urlencode 'seccode=666666|jordan'
|
||||
@ -161,7 +161,7 @@ curl 'http://passport.bilibili.com/web/sms/general/v2/send' \
|
||||
|
||||
## 使用短信验证码登录(web端)
|
||||
|
||||
> http://passport.bilibili.com/x/passport-login/web/login/sms
|
||||
> https://passport.bilibili.com/x/passport-login/web/login/sms
|
||||
|
||||
*请求方式:POST*
|
||||
|
||||
@ -176,8 +176,9 @@ curl 'http://passport.bilibili.com/web/sms/general/v2/send' \
|
||||
| cid | num | 国际地区代码 | 必要 | |
|
||||
| tel | num | 手机号码 | 必要 | |
|
||||
| code | num | 短信验证码 | 必要 | 超时时间为5min |
|
||||
| source | str | 固定为`main_web` | 必要 | |
|
||||
| captcha_key | str | 上方发送短信验证码时的一个参数 | 必要 | |
|
||||
| goUrl | str | 跳转url | 非必要 | 默认为https://www.bilibili.com |
|
||||
| go_url | str | 跳转url | 非必要 | 默认为https://www.bilibili.com |
|
||||
| keep | str | 未知 | 非必要 | 默认为true |
|
||||
|
||||
|
||||
@ -204,10 +205,10 @@ curl 'http://passport.bilibili.com/web/sms/general/v2/send' \
|
||||
使用手机号`13888888888`,短信验证码为`123456`,进行验证登录操作
|
||||
|
||||
```shell
|
||||
curl 'https://passport.bilibili.com/web/login/rapid'
|
||||
curl 'https://passport.bilibili.com/x/passport-login/web/login/sms'
|
||||
--data-urlencode 'cid=1' \
|
||||
--data-urlencode 'tel=13888888888' \
|
||||
--data-urlencode 'smsCode=123456'
|
||||
--data-urlencode 'code=123456'
|
||||
```
|
||||
|
||||
<details>
|
||||
@ -244,6 +245,7 @@ Set-Cookie: DedeUserID=***; Domain=.bilibili.com; Expires=Sat, 18-Jul-2020 09:57
|
||||
Set-Cookie: DedeUserID__ckMd5=***; Domain=.bilibili.com; Expires=Sat, 18-Jul-2020 09:57:57 GMT; Path=/
|
||||
Set-Cookie: SESSDATA=***; Domain=.bilibili.com; Expires=Sat, 18-Jul-2020 09:57:57 GMT; Path=/; HttpOnly
|
||||
Set-Cookie: bili_jct=***; Domain=.bilibili.com; Expires=Sat, 18-Jul-2020 09:57:57 GMT; Path=/
|
||||
Set-Cookie: sid=***; Domain=.bilibili.com; Expires=Sat, 18-Jul-2020 09:57:57 GMT; Path=/
|
||||
Expires: Mon, 13 Jul 2020 09:57:32 GMT
|
||||
Cache-Control: no-cache
|
||||
X-Cache-Webcdn: BYPASS from jd-sxhz-dx-w-01
|
||||
|
@ -19,7 +19,7 @@
|
||||
|
||||
### 申请验证码参数
|
||||
|
||||
> http://passport.bilibili.com/web/captcha/combine?plat=6
|
||||
> https://passport.bilibili.com/x/passport-login/captcha?source=main_web
|
||||
|
||||
*请求方式:GET*
|
||||
|
||||
@ -30,28 +30,30 @@
|
||||
| 字段 | 类型 | 内容 | 备注 |
|
||||
| ------ | ---- | -------- | --------- |
|
||||
| code | num | 返回值 | 0:成功 |
|
||||
| message | str | 返回信息 | |
|
||||
| ttl | num | 1 | **作用尚不明确** |
|
||||
| data | obj | 信息本体 | |
|
||||
|
||||
`data`对象:
|
||||
|
||||
| 字段 | 类型 | 内容 | 备注 |
|
||||
| -------- | ----- | ------ | -------- |
|
||||
| result | obj | 套了个娃 | |
|
||||
| type | num | 1 | **作用尚不明确** |
|
||||
| geetest | obj | 套了个娃 | |
|
||||
| tencent | obj | 套了个娃 | **作用尚不明确** |
|
||||
| token | str | 极验token | 与人机验证无关,与登录接口有关 |
|
||||
| type | str | 验证方式 | 用于判断使用哪一种验证方式,目前所见只有极验 |
|
||||
|
||||
`result`对象:
|
||||
`geetest`对象:
|
||||
|
||||
| 字段 | 类型 | 内容 | 备注 |
|
||||
| -------- | ----- | ------ | -------- |
|
||||
| success | num | 1 | **作用尚不明确** |
|
||||
| gt | str | 极验id | 一般为固定值 |
|
||||
| challenge | str | 极验KEY | 由B站后端产生用于人机验证 |
|
||||
| key | str | 登录秘钥 | 与人机验证无关,与登录接口有关,但与极验KEY对应 |
|
||||
|
||||
**示例:**
|
||||
|
||||
```shell
|
||||
curl 'https://passport.bilibili.com/web/captcha/combine?plat=6'
|
||||
curl 'https://passport.bilibili.com/x/passport-login/captcha?source=main_web'
|
||||
```
|
||||
|
||||
<details>
|
||||
@ -59,16 +61,20 @@ curl 'https://passport.bilibili.com/web/captcha/combine?plat=6'
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 0,
|
||||
"data": {
|
||||
"result": {
|
||||
"success": 1,
|
||||
"gt": "bd111e81eda1cbb9f54425aafc0908ac",
|
||||
"challenge": "2903a8eb967a1d990444cb23ea42f417",
|
||||
"key": "76fb59fbd83a4d9d816162c5156fc964"
|
||||
},
|
||||
"type": 1
|
||||
}
|
||||
"code": 0,
|
||||
"message": "0",
|
||||
"ttl": 1,
|
||||
"data": {
|
||||
"type": "geetest",
|
||||
"token": "00fbe75cc2864ba0af969231f193a974",
|
||||
"geetest": {
|
||||
"challenge": "a57d9be17505d4a15ed84694c48fbf74",
|
||||
"gt": "ac597a4506fee079629df5d8b66dd4fe"
|
||||
},
|
||||
"tencent": {
|
||||
"appid": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user