设为首页收藏本站

ZMX - IT技术交流论坛 - 无限Perfect,追求梦想 - itzmx.com

 找回密码
 注册论坛

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

用百度帐号登录

只需两步,快速登录

搜索
查看: 1392|回复: 0

steam通过api获取开发者用户名id来进行观察商店直播间页面实现发弹幕功能 获取个人信息页面 刷在线人数加人气值上热门首页

[复制链接]
 成长值: 249

签到天数: 4708 天

[LV.Master]伴坛终老

发表于 2022/6/14 00:25 | 显示全部楼层 |阅读模式 |Google Chrome 102.0.5005.63|Windows 10
天涯海角搜一下: 百度 谷歌 360 搜狗 有道 雅虎 必应 即刻
steam通过api获取开发者用户名id来进行观察商店直播间页面实现发弹幕功能 获取个人信息页面 刷在线人数加人气值上热门首页

可以参考我以前的帖子
https://bbs.itzmx.com/thread-93852-1-1.html

也就是说两种方式访问
win+r运行
steam://broadcast/watch/76561198122387352
浏览器
https://steamcommunity.com/broadcast/watch/76561198122387352

例如商店
https://store.steampowered.com/app/1035760

通过f12搜索getbroadcast
可获得关键api
https://steamcommunity.com/broadcast/getbroadcastmpd/?steamid=76561198235753944&broadcastid=0&viewertoken=0&watchlocation=6&sessionid=06682a65ccc9f86284678b2e
响应
  1. {success: "ready", retry: 0, broadcastid: "5538382875461850459", eresult: 1,…}
  2. broadcastid: "5538382875461850459"
  3. cdn_auth_url_parameters: null
  4. eresult: 1
  5. heartbeat_interval: 30
  6. hls_url: "https://steambroadcast.akamaized.net/broadcast/76561198235753944/7516846821693220674/hls_manifest/0/steambroadcast.akamaized.net/master.m3u8?broadcast_origin=repo-01-ord1.broadcast.steamcontent.com:80"
  7. is_replay: 0
  8. is_rtmp: 1
  9. is_webrtc: null
  10. num_viewers: 8
  11. retry: 0
  12. success: "ready"
  13. title: ""
  14. url: "https://steambroadcast.akamaized.net/broadcast/76561198235753944/7516846821693220674/manifest/0/steambroadcast.akamaized.net/?broadcast_origin=repo-01-ord1.broadcast.steamcontent.com:80"
  15. viewertoken: "5458208283125166650"
  16. webrtc_offer_sdp: null
  17. webrtc_session_id: null
  18. webrtc_turn_server: null
复制代码


关键api2
https://steamcommunity.com/broadcast/getbroadcastinfo/?steamid=76561198235753944&broadcastid=5538382875461850459&location=6
响应
  1. {success: 1, appid: "1035760", app_title: "微光之镜", title: "", viewer_count: 8, permission: 3,…}
  2. app_title: "微光之镜"
  3. appid: "1035760"
  4. is_online: true
  5. is_publisher: 1
  6. is_replay: 0
  7. is_rtmp: 1
  8. permission: 3
  9. seconds_delay: 10
  10. success: 1
  11. thumbnail_url: "https://steambroadcast.akamaized.net/broadcast/76561198235753944/5538382875461850459/thumbnail/?broadcast_origin=repo-01-ord1.broadcast.steamcontent.com:26443"
  12. title: ""
  13. update_interval: 60
  14. viewer_count: 8
复制代码


就可以很轻松得出,微光之镜的开发者id为76561198235753944
那么他的直播间就是https://steamcommunity.com/broadcast/watch/76561198235753944  个人信息页面就是https://steamcommunity.com/id/titidatiti

请求添加好友post https://steamcommunity.com/actions/AddFriendAjax
内容
sessionID: vj70uxjm81idltrxa6eg6154
steamid: 76561198235753944
accept_invite: 0

响应{"invited":["76561198235753944"],"success":1} 代表成功

刷直播间房间号在线人数api,反复刷新即可,可以用ab来刷,一台vps可以维持6000人数在线左右
https://steamcommunity.com/broadcast/getbroadcastmpd/?steamid=76561198235753944
例子
  1. yum -y install httpd-tools
  2. ab -n 100000 -c 100 "https://steamcommunity.com/broadcast/getbroadcastmpd/?steamid=76561198235753944"
复制代码

效果图
1.png

2.png
刷3W在线人数直接上首页排行榜榜一
https://web.archive.org/web/20220613180350/https://steamcommunity.com/broadcast/watch/76561198235753944
https://web.archive.org/web/20220613180418/https://steamcommunity.com/?subsection=broadcasts

欢迎光临IT技术交流论坛:http://bbs.itzmx.com/
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册论坛 新浪微博账号登陆用百度帐号登录

本版积分规则

手机版|Archiver|Mail me|网站地图|IT技术交流论坛 ( 闽ICP备13013206号-7 )

GMT+8, 2024/11/24 14:46 , Processed in 0.166672 second(s), 21 queries , MemCache On.

Powered by itzmx! X3.4

© 2011- sakura

快速回复 返回顶部 返回列表