首页 > 其他 > 详细

B站弹幕爬虫

时间:2019-11-16 21:59:49      阅读:107      评论:0      收藏:0      [点我收藏+]

curl "https://api.bilibili.com/x/player/pagelist?aid=11156770&jsonp=jsonp" -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:70.0) Gecko/20100101 Firefox/70.0" -H "Accept: */*" -H "Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2" --compressed -H "Origin: https://www.bilibili.com" -H "Connection: keep-alive" -H "Referer: https://www.bilibili.com/video/av11156770" -H "Cookie: _uuid=4AD4ADC1-5D9D-4E13-7AA5-E998F72379F804119infoc; buvid3=79B425F1-622D-4798-BB71-FA93D4720BD0190950infoc; LIVE_BUVID=AUTO2215649145029832; CURRENT_FNVAL=16; stardustvideo=1; rpdid=|(J~umR~Y|u)0J‘ulYRmuRlJ); fts=1564915598; CURRENT_QUALITY=80; UM_distinctid=16c61e4aee2211-03ff66775b94468-4c312272-e1000-16c61e4aee3ee; im_notify_type_95807857=0; sid=db74nzkd; finger=964b42c0; bp_t_offset_95807857=319067240609713254; INTVER=1"

{"code":0,"message":"0","ttl":1,"data":[{"cid":18459149,"page":1,"from":"vupload","part":"","duration":239,"vid":"","weblink":"","dimension":{"width":0,"height":0,"rotate":0}}]}

curl "https://api.bilibili.com/x/v1/dm/list.so?oid=18459149" -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:70.0) Gecko/20100101 Firefox/70.0" -H "Accept: */*" -H "Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2" --compressed -H "Origin: https://www.bilibili.com" -H "Connection: keep-alive" -H "Referer: https://www.bilibili.com/video/av11156770" -H "If-Modified-Since: Sat, 16 Nov 2019 21:33:45 GMT"

返回的为xml格式的弹幕,然后用xpath就可以解析了

 

 

B站弹幕爬虫

原文:https://www.cnblogs.com/dXIOT/p/11874081.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!