diff --git a/docs/video/recommend.md b/docs/video/recommend.md index f2ab411..10b5e18 100644 --- a/docs/video/recommend.md +++ b/docs/video/recommend.md @@ -2,7 +2,7 @@ - [获取单视频推荐列表(web端)](#获取单视频推荐列表(web端)) - [获取首页视频推荐列表(web端)](#获取首页视频推荐列表(web端)) - +- [获取短视频模式视频列表](#获取短视频模式视频列表) --- ## 获取单视频推荐列表(web端) @@ -409,4 +409,499 @@ curl -G 'https://api.bilibili.com/x/web-interface/index/top/rcmd' \ } ``` - \ No newline at end of file + + + +## 获取短视频模式视频列表 + +> https://app.bilibili.com/x/v2/feed/index + +*请求方式:GET* + +认证方式:Cookie(SESSDATA) + +**url参数:** + +有大量不明意义的参数 备注仅供参考 + +| 参数名 | 类型 | 内容 | 必要性 | 备注 | +|--------------|-----|---------------------------|-----|------------------------------| +| fnval | num | 视频流格式标识 | 非必要 | 默认为272 | +| fnver | num | 视频流版本标识 | 非必要 | 恒为1 | +| force_host | num | 源url类型 | 非必要 | 0:无限制 1:使用http 2:使用https | +| fourk | num | 是否允许 4K 视频 | 非必要 | 画质最高 1080P:0(默认)
画质最高 4K:1 | +| guidance | num | 0 | 非必要 | | +| https_url_req | num | 0 | 非必要 | | +| inline_danmu | num | 2 | 非必要 | | +| inline_sound | num | 1 | 非必要 | | +| interest_id | num | 0 | 非必要 | | +| login_event | num | 登录状态 | 非必要 | 0为登录 1为未登录 | +| mobi_app | num | android | 非必要 | 设备类型 | +| network | num | wifi | 非必要 | 网络类型 | +| open_event | num | | 非必要 | | +| platform | num | android | 非必要 | 设备类型 | +| pull | boll | false | 非必要 | | +| qn | num | 32 | 非必要 | 似乎是画质 | +| recsys_mode | num | 0 | 非必要 | | +| s_locale | str | zh_CN | 非必要 | 语言 | +| video_mode | num | 1 | 非必要 | | +| voice_balance | num | 音量均衡? | 非必要 | 默认为1 | + + +**json回复:** + +根对象: + +| 字段 | 类型 | 内容 | 备注 | +|-------------|-------|------|----------------------| +| code | num | 返回值 | 0:成功 | +| message | str | 错误信息 | 默认为0 | +| ttl | num | 1 | | +| data | obj | | | + + +`data`对象: + +| 字段 | 类型 | 内容 | 备注 | +|-------------|-------|------|----------------------| +| config | obj | 一些界面相关的内容 | 此处省略 | +| items | array | 视频列表 | | + +`data`中的`items`数组的对象: + +以下为视频类型 + +| 字段 | 类型 | 内容 | 备注 | +|-------------|-------|------|----------------------| +| can_play | num | 1 | 字面意思 | +| card_goto | str | av | | +| card_type | str | 卡片类型 | 视频为small_cover_v2 | +| cover | str | 封面url | | +| cover_left_1_content_description | str | 播放量 | 8.9万观看 | +| cover_left_2_content_description | str | 弹幕数 | 250弹幕 | +| cover_left_text_1 | str | 播放量 | 8.9万 | +| cover_left_text_2 | str | 弹幕数 | 250 | +| cover_right_content_description | str | 视频长度 | 1分钟20秒 | +| cover_right_text | str | 视频长度 | 1:20 | +| desc_button | obj | up主信息 | | +| param | str | 视频aid | | +| player_args | obj | 视频信息 | | +| talk_back | str | | | +| title | str | 标题 | | +| uri | str | 跳转链接 | | + +`desc_button`对象: + +| 字段 | 类型 | 内容 | 备注 | +|-------------|-------|------|----------------------| +| event | str | | | +| text | str | up名称 | | +| type | num | 1 | | +| uri | str | 跳转链接 | | + + +`player_args`对象: + +| 字段 | 类型 | 内容 | 备注 | +|-------------|-------|------|----------------------| +| aid | num | 视频aid | | +| cid | num | 视频cid | | +| duration | num | 视频长度 | 秒数 | +| type | str | | | + + +**示例:** + +获取短视频模式视频列表 + +```shell +curl -G 'https://app.bilibili.com/x/v2/feed/index' +``` + +
+查看响应示例: + +```json +{ + "code": 0, + "message": "0", + "ttl": 1, + "data": { + "items": [ + { + "card_type": "small_cover_v2", + "card_goto": "av", + "goto": "av", + "param": "411978753", + "cover": "http://i2.hdslb.com/bfs/archive/a1bda1e57e6812ca8822a8839fc4a1d3539255a8.jpg", + "title": "帕 鲁 现 状", + "uri": "bilibili://video/411978753?cid=1423365216\u0026player_height=1920\u0026player_preload=%7B%22cid%22%3A1423365216%2C%22expire_time%22%3A1706633200%2C%22file_info%22%3A%7B%2216%22%3A%5B%7B%22timelength%22%3A79970%2C%22filesize%22%3A3782665%7D%5D%2C%2264%22%3A%5B%7B%22timelength%22%3A79900%2C%22filesize%22%3A9552030%7D%5D%7D%2C%22support_quality%22%3Anull%2C%22support_formats%22%3Anull%2C%22support_description%22%3Anull%2C%22quality%22%3A16%2C%22url%22%3A%22http%3A%2F%2Fcn-gdst-cm-01-12.bilivideo.com%2Fupgcxcode%2F16%2F52%2F1423365216%2F1423365216-1-16.mp4%3Fe%3Dig8euxZM2rNcNbRVhwdVhwdlhWdVhwdVhoNvNC8BqJIzNbfqXBvEuENvNC8aNEVEtEvE9IMvXBvE2ENvNCImNEVEIj0Y2J_aug859r1qXg8gNEVE5XREto8z5JZC2X2gkX5L5F1eTX1jkXlsTXHeux_f2o859IB_%5Cu0026uipk%3D5%5Cu0026nbs%3D1%5Cu0026deadline%3D1706636800%5Cu0026gen%3Dplayurlv2%5Cu0026os%3Dbcache%5Cu0026oi%3D0%5Cu0026trid%3D00000ccc07d4b7a34140a25493d51003bd95U%5Cu0026mid%3D0%5Cu0026platform%3D%5Cu0026upsig%3D2bf8e99202a181300981ab6ba9d2305d%5Cu0026uparams%3De%2Cuipk%2Cnbs%2Cdeadline%2Cgen%2Cos%2Coi%2Ctrid%2Cmid%2Cplatform%5Cu0026cdnid%3D6876%5Cu0026bvc%3Dvod%5Cu0026nettype%3D0%5Cu0026orderid%3D0%2C3%5Cu0026buvid%3D%5Cu0026build%3D0%5Cu0026f%3DU_0_0%5Cu0026bw%3D47881%5Cu0026logo%3D80000000%22%2C%22video_codecid%22%3A7%2C%22video_project%22%3Atrue%2C%22fnver%22%3A0%2C%22fnval%22%3A0%7D\u0026player_rotate=0\u0026player_width=1080\u0026report_flow_data=%7B%22flow_card_type%22%3A%22av%22%7D", + "three_point": { + "dislike_reasons": [ + { + "id": 4, + "name": "UP主:锤子game", + "toast": "将减少相似内容推荐" + }, + { + "id": 2, + "name": "分区:网络游戏", + "toast": "将减少相似内容推荐" + }, + { + "id": 3, + "name": "频道:搞笑", + "toast": "将减少相似内容推荐" + }, + { + "id": 12, + "name": "此类内容过多", + "toast": "将减少相似内容推荐" + }, + { + "id": 13, + "name": "推荐过", + "toast": "将减少相似内容推荐" + }, + { + "id": 1, + "name": "不感兴趣", + "toast": "将减少相似内容推荐" + } + ], + "feedbacks": [ + { + "id": 1, + "name": "恐怖血腥", + "toast": "将优化首页此类内容" + }, + { + "id": 2, + "name": "色情低俗", + "toast": "将优化首页此类内容" + }, + { + "id": 3, + "name": "封面恶心", + "toast": "将优化首页此类内容" + }, + { + "id": 4, + "name": "标题党/封面党", + "toast": "将优化首页此类内容" + } + ], + "watch_later": 1 + }, + "args": { + "up_id": 495695169, + "up_name": "锤子game", + "rid": 65, + "rname": "网络游戏", + "tid": 1833, + "tname": "搞笑", + "aid": 411978753 + }, + "player_args": { + "aid": 411978753, + "cid": 1423365216, + "type": "av", + "duration": 80 + }, + "idx": 1706629610, + "three_point_v2": [ + { + "title": "添加至稍后再看", + "type": "watch_later", + "icon": "https://i0.hdslb.com/bfs/activity-plat/static/ce06d65bc0a8d8aa2a463747ce2a4752/NyPAqcn0QF.png" + }, + { + "title": "反馈", + "subtitle": "(选择后将优化首页此类内容)", + "reasons": [ + { + "id": 1, + "name": "恐怖血腥", + "toast": "将优化首页此类内容" + }, + { + "id": 2, + "name": "色情低俗", + "toast": "将优化首页此类内容" + }, + { + "id": 3, + "name": "封面恶心", + "toast": "将优化首页此类内容" + }, + { + "id": 4, + "name": "标题党/封面党", + "toast": "将优化首页此类内容" + } + ], + "type": "feedback" + }, + { + "title": "不感兴趣", + "subtitle": "(选择后将减少相似内容推荐)", + "reasons": [ + { + "id": 4, + "name": "UP主:锤子game", + "toast": "将减少相似内容推荐" + }, + { + "id": 2, + "name": "分区:网络游戏", + "toast": "将减少相似内容推荐" + }, + { + "id": 3, + "name": "频道:搞笑", + "toast": "将减少相似内容推荐" + }, + { + "id": 12, + "name": "此类内容过多", + "toast": "将减少相似内容推荐" + }, + { + "id": 13, + "name": "推荐过", + "toast": "将减少相似内容推荐" + }, + { + "id": 1, + "name": "不感兴趣", + "toast": "将减少相似内容推荐" + } + ], + "type": "dislike" + } + ], + "talk_back": "视频,帕 鲁 现 状,32.5万观看,257弹幕,时长1分钟20秒,UP主锤子game,", + "report_flow_data": "{\"flow_card_type\":\"av\"}", + "cover_left_text_1": "32.5万", + "cover_left_icon_1": 1, + "cover_left_1_content_description": "32.5万观看", + "cover_left_text_2": "257", + "cover_left_icon_2": 3, + "cover_left_2_content_description": "257弹幕", + "cover_right_text": "1:20", + "cover_right_content_description": "1分钟20秒", + "desc_button": { + "text": "锤子game", + "uri": "bilibili://space/495695169", + "event": "nickname", + "type": 1 + }, + "official_icon": 16, + "can_play": 1, + "goto_icon": { + "icon_url": "https://i0.hdslb.com/bfs/activity-plat/static/20230227/0977767b2e79d8ad0a36a731068a83d7/077GOeHOfO.png", + "icon_night_url": "https://i0.hdslb.com/bfs/activity-plat/static/20230227/0977767b2e79d8ad0a36a731068a83d7/ldbCXtkoK2.png", + "icon_width": 16, + "icon_height": 16 + } + }, + { + "card_type": "small_cover_v2", + "card_goto": "av", + "goto": "av", + "param": "836990443", + "cover": "http://i1.hdslb.com/bfs/archive/d16a125d6ec1c68cc9e0815bc28dcb62a1df9932.jpg", + "title": "【Phigros自制/崩坏:星穹铁道】欢迎来到匹诺康尼! 不眠之夜 IN Lv.13", + "uri": "bilibili://video/836990443?cid=1422516399\u0026player_height=1080\u0026player_preload=%7B%22cid%22%3A1422516399%2C%22expire_time%22%3A1706633200%2C%22file_info%22%3A%7B%2216%22%3A%5B%7B%22timelength%22%3A102818%2C%22filesize%22%3A4441802%7D%5D%2C%2264%22%3A%5B%7B%22timelength%22%3A102748%2C%22filesize%22%3A12468618%7D%5D%7D%2C%22support_quality%22%3Anull%2C%22support_formats%22%3Anull%2C%22support_description%22%3Anull%2C%22quality%22%3A16%2C%22url%22%3A%22http%3A%2F%2Fupos-sz-mirrorali.bilivideo.com%2Fupgcxcode%2F99%2F63%2F1422516399%2F1422516399-1-16.mp4%3Fe%3Dig8euxZM2rNcNbRVhwdVhwdlhWdVhwdVhoNvNC8BqJIzNbfqXBvEuENvNC8aNEVEtEvE9IMvXBvE2ENvNCImNEVEIj0Y2J_aug859r1qXg8gNEVE5XREto8z5JZC2X2gkX5L5F1eTX1jkXlsTXHeux_f2o859IB_%5Cu0026uipk%3D5%5Cu0026nbs%3D1%5Cu0026deadline%3D1706636800%5Cu0026gen%3Dplayurlv2%5Cu0026os%3Dalibv%5Cu0026oi%3D0%5Cu0026trid%3D0ccc07d4b7a34140a25493d51003bd95U%5Cu0026mid%3D0%5Cu0026platform%3D%5Cu0026upsig%3D06ea793aa573018646c0096adf0dcb9e%5Cu0026uparams%3De%2Cuipk%2Cnbs%2Cdeadline%2Cgen%2Cos%2Coi%2Ctrid%2Cmid%2Cplatform%5Cu0026bvc%3Dvod%5Cu0026nettype%3D0%5Cu0026orderid%3D0%2C3%5Cu0026buvid%3D%5Cu0026build%3D0%5Cu0026f%3DU_0_0%5Cu0026bw%3D43547%5Cu0026logo%3D80000000%22%2C%22video_codecid%22%3A7%2C%22video_project%22%3Atrue%2C%22fnver%22%3A0%2C%22fnval%22%3A0%7D\u0026player_rotate=0\u0026player_width=1920\u0026report_flow_data=%7B%22flow_card_type%22%3A%22av%22%7D", + "three_point": { + "dislike_reasons": [ + { + "id": 4, + "name": "UP主:早期陈总", + "toast": "将减少相似内容推荐" + }, + { + "id": 2, + "name": "分区:音游", + "toast": "将减少相似内容推荐" + }, + { + "id": 3, + "name": "频道:音乐游戏", + "toast": "将减少相似内容推荐" + }, + { + "id": 12, + "name": "此类内容过多", + "toast": "将减少相似内容推荐" + }, + { + "id": 13, + "name": "推荐过", + "toast": "将减少相似内容推荐" + }, + { + "id": 1, + "name": "不感兴趣", + "toast": "将减少相似内容推荐" + } + ], + "feedbacks": [ + { + "id": 1, + "name": "恐怖血腥", + "toast": "将优化首页此类内容" + }, + { + "id": 2, + "name": "色情低俗", + "toast": "将优化首页此类内容" + }, + { + "id": 3, + "name": "封面恶心", + "toast": "将优化首页此类内容" + }, + { + "id": 4, + "name": "标题党/封面党", + "toast": "将优化首页此类内容" + } + ], + "watch_later": 1 + }, + "args": { + "up_id": 1515475415, + "up_name": "早期陈总", + "rid": 136, + "rname": "音游", + "tid": 10174, + "tname": "音乐游戏", + "aid": 836990443 + }, + "player_args": { + "aid": 836990443, + "cid": 1422516399, + "type": "av", + "duration": 103 + }, + "idx": 1706629609, + "three_point_v2": [ + { + "title": "添加至稍后再看", + "type": "watch_later", + "icon": "https://i0.hdslb.com/bfs/activity-plat/static/ce06d65bc0a8d8aa2a463747ce2a4752/NyPAqcn0QF.png" + }, + { + "title": "反馈", + "subtitle": "(选择后将优化首页此类内容)", + "reasons": [ + { + "id": 1, + "name": "恐怖血腥", + "toast": "将优化首页此类内容" + }, + { + "id": 2, + "name": "色情低俗", + "toast": "将优化首页此类内容" + }, + { + "id": 3, + "name": "封面恶心", + "toast": "将优化首页此类内容" + }, + { + "id": 4, + "name": "标题党/封面党", + "toast": "将优化首页此类内容" + } + ], + "type": "feedback" + }, + { + "title": "不感兴趣", + "subtitle": "(选择后将减少相似内容推荐)", + "reasons": [ + { + "id": 4, + "name": "UP主:早期陈总", + "toast": "将减少相似内容推荐" + }, + { + "id": 2, + "name": "分区:音游", + "toast": "将减少相似内容推荐" + }, + { + "id": 3, + "name": "频道:音乐游戏", + "toast": "将减少相似内容推荐" + }, + { + "id": 12, + "name": "此类内容过多", + "toast": "将减少相似内容推荐" + }, + { + "id": 13, + "name": "推荐过", + "toast": "将减少相似内容推荐" + }, + { + "id": 1, + "name": "不感兴趣", + "toast": "将减少相似内容推荐" + } + ], + "type": "dislike" + } + ], + "talk_back": "视频,【Phigros自制/崩坏:星穹铁道】欢迎来到匹诺康尼! 不眠之夜 IN Lv.13,22.8万观看,797弹幕,时长1分钟43秒,UP主早期陈总,", + "report_flow_data": "{\"flow_card_type\":\"av\"}", + "cover_left_text_1": "22.8万", + "cover_left_icon_1": 1, + "cover_left_1_content_description": "22.8万观看", + "cover_left_text_2": "797", + "cover_left_icon_2": 3, + "cover_left_2_content_description": "797弹幕", + "cover_right_text": "1:43", + "cover_right_content_description": "1分钟43秒", + "desc_button": { + "text": "早期陈总", + "uri": "bilibili://space/1515475415", + "event": "nickname", + "type": 1 + }, + "can_play": 1, + "goto_icon": { + "icon_url": "https://i0.hdslb.com/bfs/activity-plat/static/20230227/0977767b2e79d8ad0a36a731068a83d7/077GOeHOfO.png", + "icon_night_url": "https://i0.hdslb.com/bfs/activity-plat/static/20230227/0977767b2e79d8ad0a36a731068a83d7/ldbCXtkoK2.png", + "icon_width": 16, + "icon_height": 16 + } + } + ], + "config": { + "column": 2, + "autoplay_card": 2, + "feed_clean_abtest": 0, + "home_transfer_test": 0, + "auto_refresh_time": 1200, + "show_inline_danmaku": 1, + "toast": {}, + "is_back_to_homepage": true, + "enable_rcmd_guide": true, + "inline_sound": 2, + "auto_refresh_time_by_appear": 1200, + "auto_refresh_time_by_active": 1200, + "visible_area": 80, + "card_density_exp": 1, + "story_mode_v2_guide_exp": 6 + }, + "interest_choose": null + } +} +``` + +