Various data packet capture station B

EDITORIAL: Today the vast majority of websites use js to load the data, request the traditional method is very difficult to work, most of crawling into dynamic data types is now crawling method:

1. Selinium such as automated testing software to simulate browser, this method can be applied to almost all sites, but the drawback is that efficiency is too slow, crawling if there are other methods, the use of other priorities.

2. Web pages directly capture process, relatively high efficiency of this method, the only difficulty is how to get api, in particular, such as NetEase some encrypted cloud (have time to write all of it), it is sometimes difficult to resolve.

 

Preview: to  https://www.bilibili.com/video/av39807126  example,

        

 

Comments: After opening the B station is an ordinary video, when you click Next comment, Chrome network view,

 

Get https://api.bilibili.com/x/v2/reply?callback=jQuery17204374912045669581_1563294492420&jsonp=jsonp&pn=2&type=1&oid=39807126&sort=2&_=1563294527125  this long channeling something. Of course, certainly not open directly. We do not js request, will remove js parameters into https://api.bilibili.com/x/v2/reply?jsonp=jsonp&pn=2&type=1&oid=39807126&sort=2&_=1563294527125 ,

Comments can get json format. Where the parameter pn is the number of pages of commentary; oid is behind the string of numbers that video URL av; sort to see clearly that sort, it is sorted by time 0, 2 is based on heat; rearmost argument does not seem affected.

 

评论回复:就是评论后别人给你的回复的api。在有评论折叠的地方点击 点击查看 ,然后查看网络

同上可以得到api: https://api.bilibili.com/x/v2/reply/reply?jsonp=jsonp&pn=1&type=1&oid=39807126&ps=10&root=1384748331&_=1563295273867

最后的字符串可以不要,参数ps是啥我也不太清楚,想知道的小伙伴可以去看下 js 源码,应该能解出来;root是原始评论人的 rpid。

 

个人信息:

https://api.bilibili.com/x/space/acc/info?mid=264980&jsonp=jsonp,这个就不说了,和上面一样,点击用户直接查就可以找到了。

 

弹幕:我是通过 fiddler 获取的,Chrome上我好像没有看到?在fiddler选择框中输入 select xml 选中文件如下:

 

得到:http://api.bilibili.com/x/v1/dm/list.so?oid=103015334

研究了下这个是实时弹幕的api,一般视频上限就是1000,个别比如说很火的视频可能会上3000或者更高。

Guess you like

Origin www.cnblogs.com/brusally/p/11198512.html