mirror of
https://github.com/SocialSisterYi/bilibili-API-collect.git
synced 2025-03-22 22:30:07 +08:00
* fix(video/collection.md): unclosed xml tags * feat(video/report.md): uuid not really random * feat: b23.tv short link * feat: login/moral/exp log * feat: v_voucher * feat: upload video cover & post * feat(creativecenter/upload.md): upload octet-stream * feat(creativecenter/upload.md): update some notes * feat(clientinfo/ip.md): another from live * feat: live web heartbeat * feat: update popular series & precious * fix(creativecenter/upload.md): mistakes in example * feat: merge duplicate fav info * feat(README.md): missing link to webmask * feat(search/hot.md): word_type * feat(login/login_action): recovery old api * feat(video/collection.md): series operation * feat: video season operation * feat: add & mod some links * feat(search/suggest.md): up to date * feat: web home header image * feat(misc/sign/bili_ticket.md): demo for nodejs * feat(creativecenter/upload.md): x-upos-auth validity period * feat: add referer & buvid3 to request header * feat: customer service message heartbeat & upload * feat(customerservice/msg.md): upload code 1200201 * feat(video/report.md): click/web/h5 * feat(video/report.md): view count desc * feat: laser2 * feat: wbi_key in bili_ticket * fix: typo & unclosed XML tags * feat(misc/sign/v_voucher): cookie x-bili-gaia-vtoken * feat(search/hot.md): square * feat(video/status_number.md): fold archive_stat/stat * feat(fav/info.md): resource/infos invalid type 21 * feat: /x/activity/subject/info * feat: lottery * feat(docs/misc/b23.tv): remove some unnecessary fields * feat(creativecenter/upload.md): types/predict * fix(video/collection.md): invalid end tag * feat: app version upgrade * feat(creativecenter/upload.md): tag/recommend #528 * feat(user/status_number.md): navnum * feat: /x/activity/page/list * feat(comment/list.md): desc about pagination_str * feat(comment/list.md): update example * feat(dynamic/all.md): #1082 * fix(comment/list.md): -352 not -412 * feat: #700 * feat(video/video_stream.md): #606 & cv949156 * feat(message/private_msg.md): single_unread freq * feat: getUserWallet * fix: broken form * feat(Layout.vue): copyright to 2024 * feat: /x/topic/pub/rcmd/search * feat: #425 * feat(misc/time_stamp.md): rtc/getTimestamp * fix(misc/time_stamp.md): missing end tag * feat: #745 * feat(dynamic/all.md): update feed/all * feat(danmaku/action.md): #220 * feat(live/info.md): gethistory from cv8186413 * fix(danmaku/action.md): missing end tag
4.4 KiB
4.4 KiB
b23.tv 短链
简述
b23.tv 是由 Bilibili 提供的短链服务, 主要用于站内长链接缩短便于分享, 目前仅在手机客户端生成
格式
目前已知的 b23.tv 短链格式有以下 3 种
-
任意短链, 路径由7位数字或大小写英文字母组成, 为防止滥用似乎有时效限制, 如 https://b23.tv/pigt3PQ
-
视频短链(AV号), 路径由字符串
av
尾随 视频 aid 组成, 如 https://b23.tv/av80433022 -
视频短链(BV号), 路径由字符串
BV
尾随 视频 bvid 组成, 如 https://b23.tv/BV1GJ411x7h7
生成
视频短链
-
直接手动拼接字符串即可
-
参见任意短链
任意短链
https://api.bilibili.com/x/share/click
https://api.biliapi.net/x/share/click
请求方式: POST
认证方式: 仅APP, 但实际上形同虚设
注: 该接口参数对照表基本失效, 基本无实用价值, 已被注释, 参见 #979 Nemo2011/bilibili-api#720
正文参数(application/x-www-form-urlencoded):
必要:
参数名 | 类型 | 内容 | 必要性 | 备注 |
---|---|---|---|---|
buvid | str | 设备 BUVID | 必要 | 实际任意非空字符串即可 |
build | num | 客户端版本号 | 必要 | 大于 5520400 的任意有效整数, 如 7710300 |
platform | str | 客户端平台 | 必要 | 实际任意非空字符串即可 |
share_channel | str | 分享方式? | 必要 | COPY |
share_mode | num | 分享模式? | 必要 | 任意有效正整数, 常见 1 , 3 , 4 |
share_id | str | 分享 ID | 必要 | 见下方对照表 |
oid | num | 对象 ID | 必要 | 见下方对照表 |
不必要:
参数名 | 类型 | 内容 | 必要性 | 备注 |
---|---|---|---|---|
object_extra_fields | obj | 额外字段? | 非必要 | 如 {"jumpfrom_id":30104} {"epid":"409808","cid":"1398781253"} {"season_type":"1","season_id":"39481","epid":"425006","dubbing_support":false,"background_audio":false,"role_audio_list":false} |
panel_type | num | 面板类型? | 非必要 | 1 |
share_title | str | 分享标题? | 非必要 | 分享标题 |
share_content | str | 分享内容? | 非必要 | 分享内容, 当 oid 存在时无意义 |
share_origin | str | 分享来源? | 非必要 | 如 vinfo_share dynamic vertical-three-point-panel vinfo_player |
share_pattern | num | 分享模式? | 非必要 | 0 |
share_session_id | str | 分享会话 ID? | 非必要 | 各部分用 - 分隔的小写的一串 UUID |
ts | num | UNIX 秒级时间戳 | 非必要 |
对照表:
类型 | 分享 ID (share_id) | 对象 ID (oid) |
---|---|---|
视频 | main.ugc-video-detail.0.0.pv | 视频 aid |
JSON回复:
根对象:
字段名 | 类型 | 内容 | 备注 |
---|---|---|---|
code | num | 0 | 恒为 0 |
message | str | 0 | 恒为 0 |
ttl | num | 1 | 恒为 1 |
data | obj | 信息本体 |
data
对象:
字段名 | 类型 | 内容 | 备注 |
---|---|---|---|
content | str | 短链内容 | 若失败则不存在 |
count | num | 0 | 恒为 0 |
示例:
为 av80433022
生成 b23.tv 短链
curl -X POST "http://api.biliapi.net/x/share/click" \
--data-urlencode "platform=unix" \
--data-urlencode "share_channel=COPY" \
--data-urlencode "share_id=main.ugc-video-detail.0.0.pv" \
--data-urlencode "share_mode=4" \
--data-urlencode "oid=80433022" \
--data-urlencode "buvid=qwq" \
--data-urlencode "build=6114514"
查看响应示例:
{
"code": 0,
"message": "0",
"ttl": 1,
"data": {
"content": "【【官方 MV】Never Gonna Give You Up - Rick Astley-哔哩哔哩】 https://b23.tv/5x4wy5f",
"count": 0
}
}