- 想统计一下自己B站收藏了多少视频,感谢此项目https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/docs/fav/list.md的开发者搜集的b站api文档。
获取收藏夹视频
登录用户空间详细信息,获取用户mid
curl -G 'https://api.bilibili.com/x/space/myinfo' -b 'SESSDATA=xxx' # https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/docs/fav/info.md
查询用户mid=509372的所有创建收藏夹列表
curl -G 'https://api.bilibili.com/x/v3/fav/folder/created/list-all' --data-urlencode 'up_mid=509372' -b 'SESSDATA=xxx'
- 返回示例
{"code": 0,"message": "0","ttl": 1,"data": {"count": 38,"list": [{"id": ********,"fid": ********,"mid": ********,"attr": 1,"title": "默认收藏夹","fav_state": 0,"media_count": 1675},{"id": ********,"fid": ********,"mid": ********,"attr": 22,"title": "纪录片+长视频","fav_state": 0,"media_count": 30},… … ],"season": null}
}
字段 | 类型 | 内容 | 备注 |
---|---|---|---|
id | num | 收藏夹mlid(完整id) | 收藏夹原始id+创建者mid尾号2位 |
fid | num | 收藏夹原始id | |
mid | num | 创建者mid | |
attr | num | 属性位(?) | |
title | str | 收藏夹标题 | |
fav_state | num | 目标id是否存在于该收藏夹 | 存在于该收藏夹:1 不存在于该收藏夹:0 |
media_count | num | 收藏夹内容数量 |
还可查询收藏夹id=1052622027的全部内容id,查询的收藏夹id需要为公开的
-
sudo apt install curl
-
curl -G 'https://api.bilibili.com/x/v3/fav/resource/ids' --data-urlencode 'media_id=1052622027' --data-urlencode 'platform=web' -b 'SESSDATA=xxx'
-
返回值示例:
{"code":0,"message":"0","ttl":1,"data":[{"id":1600406925,"type":2,"bv_id":"BV1K2421c74w","bvid":"BV1K2421c74w"},{"id":1450565335,"type":2,"bv_id":"BV1Nv421y7AQ","bvid":"BV1Nv421y7AQ"},{"id":577895920,"type":2,"bv_id":"BV1Wz4y1N7dy","bvid":"BV1Wz4y1N7dy"},{"id":666604444,"type":2,"bv_id":"BV1Fa4y117ik","bvid":"BV1Fa4y117ik"},{"id":791393435,"type":2,"bv_id":"BV1eC4y127sq","bvid":"BV1eC4y127sq"},{"id":1300471746,"type":2,"bv_id":"BV12u4m1K7ft","bvid":"BV12u4m1K7ft"},{"id":1050261786,"type":2,"bv_id":"BV13H4y1Y7mx","bvid":"BV13H4y1Y7mx"},{"id":834236648,"type":2,"bv_id":"BV17g4y1f77V","bvid":"BV17g4y1f77V"},{"id":1200388092,"type":2,"bv_id":"BV1qF4m1T782","bvid":"BV1qF4m1T782"},{"id":1500297485,"type":2,"bv_id":"BV1kU421d7uM","bvid":"BV1kU421d7uM"},{"id":541129360,"type":2,"bv_id":"BV1ti4y1G7fB","bvid":"BV1ti4y1G7fB"},{"id":258155027,"type":2,"bv_id":"BV13a41197F1","bvid":"BV13a41197F1"},{"id":326260750,"type":2,"bv_id":"BV1nw411J7yU","bvid":"BV1nw411J7yU"},{"id":1300268455,"type":2,"bv_id":"BV11u4m1N7U5","bvid":"BV11u4m1N7U5"},{"id":1500340024,"type":2,"bv_id":"BV1yU421d7x2","bvid":"BV1yU421d7x2"},{"id":241538938,"type":2,"bv_id":"BV17e411n76o","bvid":"BV17e411n76o"},{"id":496341456,"type":2,"bv_id":"BV1uK411e7cN","bvid":"BV1uK411e7cN"},{"id":326036002,"type":2,"bv_id":"BV1Mw411g7p2","bvid":"BV1Mw411g7p2"},{"id":395907033,"type":2,"bv_id":"BV16o4y1B76s","bvid":"BV16o4y1B76s"},{"id":1950426872,"type":2,"bv_id":"BV1gC41147Pi","bvid":"BV1gC41147Pi"},{"id":1150022091,"type":2,"bv_id":"BV1uZ421r7bn","bvid":"BV1uZ421r7bn"},{"id":1550437469,"type":2,"bv_id":"BV1Ly421h72Z","bvid":"BV1Ly421h72Z"},{"id":1100418475,"type":2,"bv_id":"BV16A4m157Yn","bvid":"BV16A4m157Yn"},{"id":751550108,"type":2,"bv_id":"BV1Uk4y1D7R7","bvid":"BV1Uk4y1D7R7"},{"id":945572797,"type":2,"bv_id":"BV1rW4y1H7nz","bvid":"BV1rW4y1H7nz"},{"id":1100111173,"type":2,"bv_id":"BV1qA4m1L7HP","bvid":"BV1qA4m1L7HP"},{"id":881417084,"type":2,"bv_id":"BV1zK4y1q7H2","bvid":"BV1zK4y1q7H2"},{"id":1450361299,"type":2,"bv_id":"BV11v42117Np","bvid":"BV11v42117Np"},{"id":283626102,"type":2,"bv_id":"BV1Tc411b7qx","bvid":"BV1Tc411b7qx"},{"id":666723428,"type":2,"bv_id":"BV1ya4y1k7St","bvid":"BV1ya4y1k7St"},{"id":1800349904,"type":2,"bv_id":"BV1xt421p7ZW","bvid":"BV1xt421p7ZW"},{"id":368678011,"type":2,"bv_id":"BV1z94y1T7LC","bvid":"BV1z94y1T7LC"},{"id":1250284403,"type":2,"bv_id":"BV1qJ4m147u5","bvid":"BV1qJ4m147u5"},{"id":611824014,"type":2,"bv_id":"BV1R84y1g7Pf","bvid":"BV1R84y1g7Pf"},{"id":317339652,"type":2,"bv_id":"BV1WP411s7sX","bvid":"BV1WP411s7sX"},{"id":325095335,"type":2,"bv_id":"BV1aw411V7Hd","bvid":"BV1aw411V7Hd"},{"id":960024694,"type":2,"bv_id":"BV1fp4y1N71k","bvid":"BV1fp4y1N71k"},{"id":539036265,"type":2,"bv_id":"BV1si4y1W7pm","bvid":"BV1si4y1W7pm"},{"id":1850262267,"type":2,"bv_id":"BV1Qp421d7Uw","bvid":"BV1Qp421d7Uw"},{"id":283014317,"type":2,"bv_id":"BV1Tc411k74h","bvid":"BV1Tc411k74h"},{"id":321469014,"type":2,"bv_id":"BV1ew411Y7Zx","bvid":"BV1ew411Y7Zx"},{"id":1300449473,"type":2,"bv_id":"BV1hu4m1K7VS","bvid":"BV1hu4m1K7VS"},{"id":1100312463,"type":2,"bv_id":"BV1ZA4m1V77v","bvid":"BV1ZA4m1V77v"},{"id":280980646,"type":2,"bv_id":"BV1gc41197hx","bvid":"BV1gc41197hx"},{"id":870777194,"type":2,"bv_id":"BV1xV4y1h7YV","bvid":"BV1xV4y1h7YV"},{"id":1550214271,"type":2,"bv_id":"BV1Sy421a78C","bvid":"BV1Sy421a78C"},{"id":666406156,"type":2,"bv_id":"BV1oa4y1C7Rf","bvid":"BV1oa4y1C7Rf"},{"id":1250136390,"type":2,"bv_id":"BV1kJ4m1b717","bvid":"BV1kJ4m1b717"},{"id":283930587,"type":2,"bv_id":"BV17c411s7y5","bvid":"BV17c411s7y5"},{"id":1850327376,"type":2,"bv_id":"BV1Gp421o75W","bvid":"BV1Gp421o75W"},{"id":1150474671,"type":2,"bv_id":"BV1SZ421U7ad","bvid":"BV1SZ421U7ad"},{"id":369064555,"type":2,"bv_id":"BV1194y1K7fK","bvid":"BV1194y1K7fK"},{"id":1850107930,"type":2,"bv_id":"BV1yp421Z76a","bvid":"BV1yp421Z76a"},{"id":1650464196,"type":2,"bv_id":"BV1mj421Q7NH","bvid":"BV1mj421Q7NH"},{"id":1750489866,"type":2,"bv_id":"BV1P4421w7Zc","bvid":"BV1P4421w7Zc"},{"id":81263689,"type":2,"bv_id":"BV1uJ411Y7Eg","bvid":"BV1uJ411Y7Eg"},{"id":544126464,"type":2,"bv_id":"BV14v4y1Z7fu","bvid":"BV14v4y1Z7fu"},{"id":878575332,"type":2,"bv_id":"BV1WN4y1v74a","bvid":"BV1WN4y1v74a"},{"id":284114206,"type":2,"bv_id":"BV1sc411x7gk","bvid":"BV1sc411x7gk"},{"id":238775473,"type":2,"bv_id":"BV1Le411m7F5","bvid":"BV1Le411m7F5"},{"id":326697346,"type":2,"bv_id":"BV1Ww411j7kX","bvid":"BV1Ww411j7kX"},{"id":788084544,"type":2,"bv_id":"BV1v14y1k72x","bvid":"BV1v14y1k72x"},{"id":857330096,"type":2,"bv_id":"BV1uV4y1W7cB","bvid":"BV1uV4y1W7cB"},{"id":705616341,"type":2,"bv_id":"BV14Q4y1n7jz","bvid":"BV14Q4y1n7jz"},{"id":323060035,"type":2,"bv_id":"BV1Bw411s7wj","bvid":"BV1Bw411s7wj"},{"id":673816286,"type":2,"bv_id":"BV1UU4y1G7WA","bvid":"BV1UU4y1G7WA"},{"id":1150063539,"type":2,"bv_id":"BV1DZ421B7Cs","bvid":"BV1DZ421B7Cs"},{"id":1150460863,"type":2,"bv_id":"BV1oZ421U7p9","bvid":"BV1oZ421U7p9"},{"id":914062019,"type":2,"bv_id":"BV1bM4y1W7Aw","bvid":"BV1bM4y1W7Aw"},{"id":916003380,"type":2,"bv_id":"BV1Nu4y1r746","bvid":"BV1Nu4y1r746"},{"id":966379133,"type":2,"bv_id":"BV1wW4y1w7dw","bvid":"BV1wW4y1w7dw"},{"id":794231712,"type":2,"bv_id":"BV1EC4y1k7ma","bvid":"BV1EC4y1k7ma"},{"id":1600199467,"type":2,"bv_id":"BV1X2421w7Sq","bvid":"BV1X2421w7Sq"},{"id":421596659,"type":2,"bv_id":"BV1T3411874j","bvid":"BV1T3411874j"},{"id":920852393,"type":2,"bv_id":"BV1Su4y1N76q","bvid":"BV1Su4y1N76q"},{"id":708265211,"type":2,"bv_id":"BV1RQ4y1773K","bvid":"BV1RQ4y1773K"},{"id":567942046,"type":2,"bv_id":"BV1kv4y1h7dH","bvid":"BV1kv4y1h7dH"},{"id":663892097,"type":2,"bv_id":"BV1Za4y1Z7Qp","bvid":"BV1Za4y1Z7Qp"},{"id":235160333,"type":2,"bv_id":"BV1de411X7R9","bvid":"BV1de411X7R9"},{"id":283463253,"type":2,"bv_id":"BV1jc411t7is","bvid":"BV1jc411t7is"},{"id":917325607,"type":2,"bv_id":"BV1hu4y1p7k4","bvid":"BV1hu4y1p7k4"},{"id":1650054573,"type":2,"bv_id":"BV1B7421K7Ch","bvid":"BV1B7421K7Ch"},{"id":810763828,"type":2,"bv_id":"BV1S34y1v7vt","bvid":"BV1S34y1v7vt"},{"id":567897048,"type":2,"bv_id":"BV1Ev4y1h72x","bvid":"BV1Ev4y1h72x"},{"id":916958057,"type":2,"bv_id":"BV1gu4y1475h","bvid":"BV1gu4y1475h"},{"id":581854932,"type":2,"bv_id":"BV1z64y1w7Tc","bvid":"BV1z64y1w7Tc"},{"id":326494884,"type":2,"bv_id":"BV1Qw41177xN","bvid":"BV1Qw41177xN"},{"id":1150132360,"type":2,"bv_id":"BV1GZ421z73H","bvid":"BV1GZ421z73H"},{"id":1300080890,"type":2,"bv_id":"BV15T4m1S7Ho","bvid":"BV15T4m1S7Ho"},{"id":937959599,"type":2,"bv_id":"BV1gT4y1Y7WK","bvid":"BV1gT4y1Y7WK"},{"id":945342891,"type":2,"bv_id":"BV13W4y1W7Qr","bvid":"BV13W4y1W7Qr"},{"id":496525948,"type":2,"bv_id":"BV15K411a7Jk","bvid":"BV15K411a7Jk"},{"id":341866282,"type":2,"bv_id":"BV1s94y1U7Bo","bvid":"BV1s94y1U7Bo"},{"id":965899432,"type":2,"bv_id":"BV1ZW4y1P7Fi","bvid":"BV1ZW4y1P7Fi"},{"id":539427024,"type":2,"bv_id":"BV1yi4y1p7Sa","bvid":"BV1yi4y1p7Sa"},{"id":411910338,"type":2,"bv_id":"BV1yV411S7ZV","bvid":"BV1yV411S7ZV"},{"id":413402159,"type":2,"bv_id":"BV1xV411r7YY","bvid":"BV1xV411r7YY"},{"id":1700239255,"type":2,"bv_id":"BV1SK42117zj","bvid":"BV1SK42117zj"},{"id":836924817,"type":2,"bv_id":"BV1xg4y1e7Xj","bvid":"BV1xg4y1e7Xj"},{"id":957735873,"type":2,"bv_id":"BV1xp4y1E7fb","bvid":"BV1xp4y1E7fb"},{"id":1300161623,"type":2,"bv_id":"BV18T4m1S7E9","bvid":"BV18T4m1S7E9"},{"id":1950074651,"type":2,"bv_id":"BV1EC411r7QP","bvid":"BV1EC411r7QP"},{"id":326758911,"type":2,"bv_id":"BV1Yw411j7VE","bvid":"BV1Yw411j7VE"},{"id":451096613,"type":2,"bv_id":"BV1Jj411J7qQ","bvid":"BV1Jj411J7qQ"},{"id":1750042836,"type":2,"bv_id":"BV1ex42197fD","bvid":"BV1ex42197fD"},{"id":533270811,"type":2,"bv_id":"BV1yu411w7xC","bvid":"BV1yu411w7xC"},{"id":365893446,"type":2,"bv_id":"BV1394y1G7bf","bvid":"BV1394y1G7bf"},{"id":283475907,"type":2,"bv_id":"BV1nc411t77z","bvid":"BV1nc411t77z"},{"id":836906437,"type":2,"bv_id":"BV1bg4y1e7RP","bvid":"BV1bg4y1e7RP"},{"id":555728883,"type":2,"bv_id":"BV1sv4y1M7aw","bvid":"BV1sv4y1M7aw"},{"id":471364389,"type":2,"bv_id":"BV1LT411j77s","bvid":"BV1LT411j77s"},{"id":577654068,"type":2,"bv_id":"BV1KB4y1d7iu","bvid":"BV1KB4y1d7iu"},{"id":976804486,"type":2,"bv_id":"BV1o44y1a7TX","bvid":"BV1o44y1a7TX"},{"id":454126030,"type":2,"bv_id":"BV1g5411y7fy","bvid":"BV1g5411y7fy"},{"id":1900242449,"type":2,"bv_id":"BV1Cm41197A9","bvid":"BV1Cm41197A9"},{"id":875925499,"type":2,"bv_id":"BV1QN4y1U7Fj","bvid":"BV1QN4y1U7Fj"},{"id":326663969,"type":2,"bv_id":"BV1ww411j77Z","bvid":"BV1ww411j77Z"},{"id":538728268,"type":2,"bv_id":"BV1Ki4y1i7ZT","bvid":"BV1Ki4y1i7ZT"},{"id":836156134,"type":2,"bv_id":"BV1tg4y1S74V","bvid":"BV1tg4y1S74V"},{"id":539040342,"type":2,"bv_id":"BV1xi4y1W7v2","bvid":"BV1xi4y1W7v2"},{"id":835921548,"type":2,"bv_id":"BV1Zg4y1D7GW","bvid":"BV1Zg4y1D7GW"},{"id":953655846,"type":2,"bv_id":"BV16s4y1g7RL","bvid":"BV16s4y1g7RL"},{"id":270605825,"type":2,"bv_id":"BV1Vc411T7UZ","bvid":"BV1Vc411T7UZ"},{"id":923769777,"type":2,"bv_id":"BV1VT4y1H7Bb","bvid":"BV1VT4y1H7Bb"},{"id":280701589,"type":2,"bv_id":"BV1ic411R71E","bvid":"BV1ic411R71E"},{"id":326820728,"type":2,"bv_id":"BV1Qw411j76B","bvid":"BV1Qw411j76B"},{"id":923881684,"type":2,"bv_id":"BV1kT4y1879y","bvid":"BV1kT4y1879y"},{"id":751739921,"type":2,"bv_id":"BV1Tk4y1S721","bvid":"BV1Tk4y1S721"},{"id":369459490,"type":2,"bv_id":"BV1SZ4y1E7K2","bvid":"BV1SZ4y1E7K2"},{"id":458862642,"type":2,"bv_id":"BV1j5411J7yJ","bvid":"BV1j5411J7yJ"},{"id":241671318,"type":2,"bv_id":"BV1oe411n72U","bvid":"BV1oe411n72U"},{"id":581760581,"type":2,"bv_id":"BV1g64y1w7uG","bvid":"BV1g64y1w7uG"},{"id":496813571,"type":2,"bv_id":"BV1cK411h7s9","bvid":"BV1cK411h7s9"},{"id":270484296,"type":2,"bv_id":"BV1Rc411J7FW","bvid":"BV1Rc411J7FW"},{"id":538998199,"type":2,"bv_id":"BV1Ai4y1W79j","bvid":"BV1Ai4y1W79j"},{"id":411742357,"type":2,"bv_id":"BV1yV411Q7zK","bvid":"BV1yV411Q7zK"},{"id":666563751,"type":2,"bv_id":"BV1qa4y1y7gY","bvid":"BV1qa4y1y7gY"},{"id":284243321,"type":2,"bv_id":"BV1uc411v77q","bvid":"BV1uc411v77q"},{"id":947964823,"type":2,"bv_id":"BV1Fs4y1t7qG","bvid":"BV1Fs4y1t7qG"},{"id":650457046,"type":2,"bv_id":"BV1pY4y1Z7jR","bvid":"BV1pY4y1Z7jR"},{"id":757386930,"type":2,"bv_id":"BV1264y1U7Hy","bvid":"BV1264y1U7Hy"},{"id":620110456,"type":2,"bv_id":"BV1p84y1R7pW","bvid":"BV1p84y1R7pW"},{"id":869620322,"type":2,"bv_id":"BV1UV4y127hx","bvid":"BV1UV4y127hx"},{"id":452383429,"type":2,"bv_id":"BV1Pj411W74E","bvid":"BV1Pj411W74E"},{"id":539128737,"type":2,"bv_id":"BV1yi4y1W7EQ","bvid":"BV1yi4y1W7EQ"},{"id":836789634,"type":2,"bv_id":"BV1yg4y1Y7kA","bvid":"BV1yg4y1Y7kA"},{"id":880832935,"type":2,"bv_id":"BV1AK4y167qj","bvid":"BV1AK4y167qj"},{"id":496459508,"type":2,"bv_id":"BV1YK411e7ae","bvid":"BV1YK411e7ae"},{"id":666831910,"type":2,"bv_id":"BV14a4y1C7BJ","bvid":"BV14a4y1C7BJ"},{"id":751700796,"type":2,"bv_id":"BV1Rk4y1U7aB","bvid":"BV1Rk4y1U7aB"},{"id":746944085,"type":2,"bv_id":"BV1yC4y1V7kS","bvid":"BV1yC4y1V7kS"},{"id":751708260,"type":2,"bv_id":"BV1ok4y1U7Co","bvid":"BV1ok4y1U7Co"},{"id":666455822,"type":2,"bv_id":"BV1wa4y1y7oL","bvid":"BV1wa4y1y7oL"},{"id":453648268,"type":2,"bv_id":"BV1h5411i7x8","bvid":"BV1h5411i7x8"},{"id":96638