龙珠弹幕获取
谢邀,前几天在爬山,才回来。听说是 HTTP 协议的,我就直接用 Chrome 自带的开发者工具抓了下包。发现主要求是定时请求这个 url:http://mb.tga.plu.cn/chatroom/msgsv2/\u0026lt;roomid\u0026gt;/\u0026lt;timestamp\u0026gt;/\u0026lt;span\u0026gt;/_c_1wt078i
其中:roomid 可以在具体房间页面的 html 代码中搜索到:var roomInfo={... ,"RoomId":419332, ...}
timestamp 和 span 参数可以在第一次请求返回的数据中得到。第一次请求把 timestamp 和 span 设置为 0 即可,比如http://mb.tga.plu.cn/chatroom/msgsv2/419332/0/0/_c_1wt078i
然后就会得到一段被 _c_1wt078i() 包裹着的 JSON 数据{ "count": 4, "next": 3, "from": 1455797646, "msgs": }
count 就是返回的 msgs 数量,next 就是 下一次请求的url中的\u0026lt;span\u0026gt;参数from 就是 下一次请求的url中的\u0026lt;timestamp\u0026gt;参数msgs 包含了礼物和弹幕两种数据,都是简单的 JSON 格式,礼物在前,弹幕在后。抓取的时候,可能要设置下 Header 模拟成浏览器。以上 :)
■网友
一开始,我以为都是TCP协yi的然后wireshark抓包,看了下TCP里面没有,然后看http的,发现了内容那么我们就用httpanalyser抓http包,比较直观
发现 http://mb.tga.plu.cn/chatroom/msgsv2/394548/1455678297/3/_c_1wt078i 这个网站直接在游览器打开,就出现了许多弹幕的内容
【龙珠弹幕获取】
这里好像需要2个参数394548 _c_1wt078i ,这个1455678297一看就很像时间戳后来抓包发现394548是房间id _c_1wt078i是固定的房间ID那里获取呢?打开直播的点右键查看源代码 "defaultTitle": "主播现在不在,看下其它直播和视频吧","live":{"id":7957585,"title":"神级刀僵尸与极限跑酷","liveStreamType":"3","liveSourceType":"0","channels":} }; var subscriptionPermission = true; var roomInfo = {"CompetitionId":0,"ProvinceId":0,"CityId":0,"RoomSubscriptionPermissionValid":true,"RoomSubscriptionPermissionLevel":1,"BgPic":"http://res2.plures.net/content/roomimages/plot.png","UserId":18245174,"GameId":7,"LivePermission":25,"VideoPermission":1,"RoomPlayVideoType":4,"IsBulletScreen":true,"DailyPlayHourConfig":2,"UserQQ":"0","VerifiedInformation":"TPWS4赛季狙神争霸赛冠军|CFPL全明星狙神争霸前三|肆冷大西瓜","AnchorCertification":"","AnchorCategory":"Nothing","HostInfo":"000","VideoType":0,"LinkBBSId":0,"RoomTitleKey":"TGA肆冷","CreateTime":"\\/Date(-62135596800000-0000)\\/","Status":0,"ShopUrl":"","ShopName":"","Weibo":"","Flowers":0,"Eggs":0,"IsInvited":false,"IsLive":false,"IsValidLive":true,"ChannelName":"","RtmpAddress":"","StreamName":"","LiveCode":"","BoardCast_Title":"","BoardCast_TitleV2":"","BoardCast_Address":"","BoardCast_Topic":"","WeChatPic":"","UserTitle":"MasterStar","RoomId":263139,"Domain":"102492","Name":"刀尸魔-肆冷","Logo":"http://img.plures.net/2016/01/22/0928/0ec4/579d/fb62/63b6/f3c2/70c4/fc90.jpg","Desc":"肆冷粉丝群: 541351006","Type":1}; "defaultTitle": "主播现在不在,看下其它直播和视频吧","live":{"id":7957102,"title":"海王 陪伴您每一个早上!","liveStreamType":"9","liveSourceType":"8","channels":} }; var subscriptionPermission = true; var roomInfo = {"CompetitionId":0,"ProvinceId":0,"CityId":0,"RoomSubscriptionPermissionValid":true,"RoomSubscriptionPermissionLevel":3,"BgPic":"http://res2.plures.net/content/roomimages/plot.png","UserId":1622007,"GameId":4,"LivePermission":29,"VideoPermission":0,"RoomPlayVideoType":1,"IsBulletScreen":true,"DailyPlayHourConfig":2,"UserQQ":"0","VerifiedInformation":"全能王者|中国区冠军|世界亚军","AnchorCertification":"全能王者","AnchorCategory":"God","HostInfo":"","VideoType":0,"LinkBBSId":0,"RoomTitleKey":"LOL 职业选手 全能王者 海王 海王Seaking 世界亚军 中国冠军 声音 性感 磁性 ","CreateTime":"\\/Date(-62135596800000-0000)\\/","Status":0,"ShopUrl":"","ShopName":"","Weibo":"","Flowers":0,"Eggs":0,"IsInvited":false,"IsLive":false,"IsValidLive":true,"ChannelName":"","RtmpAddress":"","StreamName":"","LiveCode":"","BoardCast_Title":"","BoardCast_TitleV2":"","BoardCast_Address":"","BoardCast_Topic":"","WeChatPic":"","UserTitle":"LongZhuStar","RoomId":394548,"Domain":"haiwang","Name":"海王Seaking","Logo":"http://img.plures.net/2015/08/31/94ba/4400/458a/9570/8116/3d13/0487/5b36.jpg","Desc":"早8点-下午2点QQ粉丝四群:89013360五群:426110585","Type":1};发现了2个一个tx一个龙珠,房间id格式是不同的,百度得知龙珠直播由TX游戏竞技平台进行管理,直播房主也可以对自己的直播房间进行管理,所以有2个不同的格式。
推荐阅读
- 电商的初级产品经理怎样快速获取需求
- 从这张电脑桌面截图能获取使用者多少信息
- 怎样获取每日全球注册的域名或者怎样通过dns服务器获取每日在dns上新增的解析域名
- 违法|非法获取小区业主信息 一推销员被罚款两千元
- 哪里能获取美股月度成交金额的数据,找了好几个数据库都只有成交量
- 新网站这么做,才能快速获取排名
- 目前p2p的线上、线下客户获取成本分别是多少以后变化趋势是
- 狂追进度!凌晨,弹幕刷屏…场外这一幕火了
- 我国近海共有多少浮标这些数据怎样获取
- 网站完整源码能有途径获取吗