Files
bilibili-API-collect/docs/broadcast/video_room.html
T

70 lines
39 KiB
HTML
Raw Normal View History

2026-01-22 17:37:01 +00:00
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<meta name="generator" content="VuePress 2.0.0-rc.24" />
<style>
:root {
--vp-c-bg: #fff;
}
[data-theme='dark'] {
--vp-c-bg: #1b1b1f;
}
html,
body {
background-color: var(--vp-c-bg);
}
</style>
<script>
const useChoice = localStorage.getItem('vuepress-color-scheme')
const systemStatus =
'matchMedia' in window
? window.matchMedia('(prefers-color-scheme: dark)').matches
: false
if (useChoice === 'light') {
document.documentElement.dataset.theme = 'light'
} else if (useChoice === 'dark' || systemStatus) {
document.documentElement.dataset.theme = 'dark'
}
</script>
<link rel="icon" href="/bilibili-API-collect/logo2.jpg"><title>视频实时信息 | BAC Document</title><meta name="description" content="社区开源的第三方哔哩哔哩 API 文档">
<link rel="preload" href="/bilibili-API-collect/assets/style-D1PJH1oj.css" as="style"><link rel="stylesheet" href="/bilibili-API-collect/assets/style-D1PJH1oj.css">
<link rel="modulepreload" href="/bilibili-API-collect/assets/app-Dgsdh8A6.js"><link rel="modulepreload" href="/bilibili-API-collect/assets/video_room.html-CJ-aNxn7.js">
<link rel="prefetch" href="/bilibili-API-collect/assets/CONTRIBUTING.html-Dg5RrJ0s.js" as="script"><link rel="prefetch" href="/bilibili-API-collect/assets/index.html-CyFjrwOB.js" as="script"><link rel="prefetch" href="/bilibili-API-collect/assets/index.html-DfGFo93u.js" as="script"><link rel="prefetch" href="/bilibili-API-collect/assets/splash.html-DTxmsPVe.js" as="script"><link rel="prefetch" href="/bilibili-API-collect/assets/ver.html-BK7Hl968.js" as="script"><link rel="prefetch" href="/bilibili-API-collect/assets/info.html-CRFYL4xy.js" as="script"><link rel="prefetch" href="/bilibili-API-collect/assets/list.html-67H6b90D.js" as="script"><link rel="prefetch" href="/bilibili-API-collect/assets/action.html-CkX_wc45.js" as="script"><link rel="prefetch" href="/bilibili-API-collect/assets/activity_list.html-Bekn3Lxe.js" as="script"><link rel="prefetch" href="/bilibili-API-collect/assets/info.html-DMnsBsuq.js" as="script"><link rel="prefetch" href="/bilibili-API-collect/assets/list.html-CBuhzqhd.js" as="script"><link rel="prefetch" href="/bilibili-API-collect/assets/recommend_author.html-DBwItBdc.js" as="script"><link rel="prefetch" href="/bilibili-API-collect/assets/action.html-C0ql065z.js" as="script"><link rel="prefetch" href="/bilibili-API-collect/assets/articles.html-zLkcz3pu.js" as="script"><link rel="prefetch" href="/bilibili-API-collect/assets/card.html-wL4C5GKc.js" as="script"><link rel="prefetch" href="/bilibili-API-collect/assets/category.html-Xldy-aPs.js" as="script"><link rel="prefetch" href="/bilibili-API-collect/assets/info.html-CB0fSHFP.js" as="script"><link rel="prefetch" href="/bilibili-API-collect/assets/view.html-COrufaKB.js" as="script"><link rel="prefetch" href="/bilibili-API-collect/assets/action.html-BeujPZDG.js" as="script"><link rel="prefetch" href="/bilibili-API-collect/assets/info.html-DvFa4PRS.js" as="script"><link rel="prefetch" href="/bilibili-API-collect/assets/music_list.html-DeijlME4.js" as="script"><link rel="prefetch" href="/bilibili-API-collect/assets/musicstream_url.html-qq6CNfyp.js" as="script"><link rel="prefetch" href="/bilibili-API-collect/assets/rank.html-DT2C28KO.js" as="script"><link rel="prefetch" href="/bilibili-API-collect/assets/status_number.html-DEiPXucy.js" as="script"><link rel="prefetch" href="/bilibili-API-collect/assets/follow.html-DOVJW4CZ.js" as="script"><link rel="prefetch" href="/bilibili-API-collect/assets/info.html-BLypTc8g.js" as="script"><link rel="prefetch" href="/bilibili-API-collect/assets/season_index.html-BSNCSXU1.js" as="script"><link rel="prefetch" href="/bilibili-API-collect/assets/timeline.html-CzpzQzIG.js" as="script"><link rel="prefetch" href="/bilibili-API-collect/assets/videostream_url.html-DlvjAVi_.js" as="script"><link rel="prefetch" href="/bilibili-API-collect/assets/banlist.html-Bx6m-UTQ.js" as="script"><link rel="prefetch" href="/bilibili-API-collect/assets/index.html-BMdR7u31.js" as="script"><link rel="prefetch" href="/bilibili-API-collect/assets/info.html-BHbw7wWp.js" as="script"><link rel="prefetch" href="/bilibili-API-collect/assets/videostream_url.html-DnLcd0On.js" as="script"><link rel="prefetch" href="/bilibili-API-collect/assets/ip.html-BZmNmhHk.js" as="script"><link rel="prefetch" href="/bilibili-API-collect/assets/action.html-D_ydhzqh.js" as="script"><link rel="prefetch" href="/bilibili-API-collect/assets/list.html-D36gw51A.js" as="script"><link rel="prefetch" href="/bilibili-API-collect/assets/index.html-BN64GETH.js" as="script"><link rel="prefetch" href="/bilibili-API-collect/assets/opus.html-CoQ5EdO3.js" as="script"><link rel="prefetch" href="/bilibili-API-collect/assets/railgun.html-2O05GCD4.js" as="script"><link rel="prefetch" href="/bilibili-API-collect/assets/season.html-B_fCwBA8.js" as="script"><link rel="prefetch" href="/bilibili-API-collect/assets/statistics_data.html-BWH8OqIZ.js" as="script"><link rel="prefetch" href="/bilibili-API-collect/assets/upload.html-DvDEkxhj.js" as="script"><link rel="prefetch" href="/bilibili-API-collect/assets/videos.html-4_uXrA4K.js" as="script"><link rel="prefetch" href="/bilibili-API-coll
</head>
<body>
<div id="app"><!--[--><div class="vp-theme-container external-link-icon" vp-container><!--[--><header class="vp-navbar" vp-navbar><div class="vp-toggle-sidebar-button" title="toggle sidebar" aria-expanded="false" role="button" tabindex="0"><div class="icon" aria-hidden="true"><span></span><span></span><span></span></div></div><span><a class="route-link" href="/bilibili-API-collect/"><img class="vp-site-logo" src="/bilibili-API-collect/logo2.jpg" alt="BAC Document"><span class="vp-site-name vp-hide-mobile" aria-hidden="true">BAC Document</span></a></span><div class="vp-navbar-items-wrapper" style=""><!--[--><!--]--><nav class="vp-navbar-items vp-hide-mobile" aria-label="site navigation"><!--[--><div class="vp-navbar-item"><a class="route-link auto-link" href="/bilibili-API-collect/" aria-label="首页"><!--[--><!--[--><!--]--><!--]-->首页<!--[--><!--[--><!--]--><!--]--></a></div><div class="vp-navbar-item"><a class="route-link auto-link" href="/bilibili-API-collect/#🍴目录" aria-label="目录"><!--[--><!--[--><!--]--><!--]-->目录<!--[--><!--[--><!--]--><!--]--></a></div><div class="vp-navbar-item"><a class="route-link auto-link" href="/bilibili-API-collect/CONTRIBUTING.html" aria-label="贡献指南"><!--[--><!--[--><!--]--><!--]-->贡献指南<!--[--><!--[--><!--]--><!--]--></a></div><div class="vp-navbar-item"><div class="vp-navbar-dropdown-wrapper"><button class="vp-navbar-dropdown-title" type="button" aria-label="相关社群"><span class="title">相关社群</span><span class="arrow down"></span></button><button class="vp-navbar-dropdown-title-mobile" type="button" aria-label="相关社群"><span class="title">相关社群</span><span class="right arrow"></span></button><ul class="vp-navbar-dropdown" style="display:none;"><!--[--><li class="vp-navbar-dropdown-item"><a class="auto-link external-link" href="http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&amp;k=ympvb3LAPT-Ulu3ezhGqbkJ8zXMKImOX&amp;authKey=z1KdkOdKO3wytN43m9K6On9nBtnDL4pAoD6VQHCipFBb9TasNDKuDHCmOE6TF3uc&amp;noverify=0&amp;group_code=191187164" aria-label="QQ交流群(综合技术交流)" rel="noopener noreferrer" target="_blank"><!--[--><!--[--><!--]--><!--]-->QQ交流群(综合技术交流)<!--[--><!--[--><!--]--><!--]--></a></li><li class="vp-navbar-dropdown-item"><a class="auto-link external-link" href="https://t.me/bilibili_API_collect_community" aria-label="Telegram交流群(Github Bot推送)" rel="noopener noreferrer" target="_blank"><!--[--><!--[--><!--]--><!--]-->Telegram交流群(Github Bot推送)<!--[--><!--[--><!--]--><!--]--></a></li><!--]--></ul></div></div><div class="vp-navbar-item"><a class="auto-link external-link" href="https://github.com/SocialSisterYi/bilibili-API-collect" aria-label="GitHub" rel="noopener noreferrer" target="_blank"><!--[--><!--[--><!--]--><!--]-->GitHub<!--[--><!--[--><!--]--><!--]--></a></div><!--]--></nav><!--[--><!--]--><button type="button" class="vp-toggle-color-mode-button" title="toggle color mode"><svg class="light-icon" viewbox="0 0 32 32" style=""><path d="M16 12.005a4 4 0 1 1-4 4a4.005 4.005 0 0 1 4-4m0-2a6 6 0 1 0 6 6a6 6 0 0 0-6-6z" fill="currentColor"></path><path d="M5.394 6.813l1.414-1.415l3.506 3.506L8.9 10.318z" fill="currentColor"></path><path d="M2 15.005h5v2H2z" fill="currentColor"></path><path d="M5.394 25.197L8.9 21.691l1.414 1.415l-3.506 3.505z" fill="currentColor"></path><path d="M15 25.005h2v5h-2z" fill="currentColor"></path><path d="M21.687 23.106l1.414-1.415l3.506 3.506l-1.414 1.414z" fill="currentColor"></path><path d="M25 15.005h5v2h-5z" fill="currentColor"></path><path d="M21.687 8.904l3.506-3.506l1.414 1.415l-3.506 3.505z" fill="currentColor"></path><path d="M15 2.005h2v5h-2z" fill="currentColor"></path></svg><svg class="dark-icon" viewbox="0 0 32 32" style="display:none;"><path d="M13.502 5.414a15.075 15.075 0 0 0 11.594 18.194a11.113 11.113 0 0 1-7.975 3.39c-.138 0-.278.005-.418 0a11.094 11.094 0 0 1-3.2-21.584M14.98 3a1.002 1.002 0 0 0-.175.016a13.096 13.096 0 0 0 1.825 25.981c.164.006.328 0 .49 0a13.072 13.072 0 0 0 10.703-5.555a1.01 1.01 0 0 0-.783-1.565A13.0
<span class="line"><span>00000010 00 00 7b 22 72 6f 6f 6d 5f 69 64 22 3a 22 76 69 |..{&quot;room_id&quot;:&quot;vi|</span></span>
<span class="line"><span>00000020 64 65 6f 3a 2f 2f 37 30 36 2f 33 37 32 34 37 32 |deo://706/372472|</span></span>
<span class="line"><span>00000030 33 22 2c 22 70 6c 61 74 66 72 6f 6d 22 3a 22 77 |3&quot;,&quot;platfrom&quot;:&quot;w|</span></span>
<span class="line"><span>00000040 65 62 22 2c 22 61 63 63 65 70 74 73 22 3a 5b 31 |eb&quot;,&quot;accepts&quot;:[1|</span></span>
<span class="line"><span>00000050 30 30 30 2c 31 30 31 35 5d 7d |000,1015]}|</span></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h2 id="认证包回复-下行" tabindex="-1"><a class="header-anchor" href="#认证包回复-下行"><span>认证包回复(下行)</span></a></h2><p><strong>正文内容json:</strong></p><p>根对象:</p><table><thead><tr><th>字段</th><th>类型</th><th>内容</th><th>备注</th></tr></thead><tbody><tr><td>code</td><td>num</td><td>返回值</td><td>0:成功</td></tr><tr><td>message</td><td>str</td><td>错误信息</td><td>默认为OK</td></tr><tr><td>version</td><td>num</td><td>版本号</td><td></td></tr></tbody></table><p>示例:</p><div class="language- line-numbers-mode" data-highlighter="shiki" data-ext="" style="background-color:#1E1E1E;color:#D4D4D4;"><pre class="shiki dark-plus vp-code"><code class="language-"><span class="line"><span>00000000 00 00 00 37 00 12 00 01 00 00 00 08 00 00 00 01 |...7............|</span></span>
<span class="line"><span>00000010 00 00 7b 22 63 6f 64 65 22 3a 30 2c 22 6d 65 73 |..{&quot;code&quot;:0,&quot;mes|</span></span>
<span class="line"><span>00000020 73 61 67 65 22 3a 22 4f 4b 22 2c 22 76 65 72 73 |sage&quot;:&quot;OK&quot;,&quot;vers|</span></span>
<span class="line"><span>00000030 69 6f 6e 22 3a 31 7d |ion&quot;:1}|</span></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h2 id="心跳包-上行" tabindex="-1"><a class="header-anchor" href="#心跳包-上行"><span>心跳包(上行)</span></a></h2><p>正文可为任意内容或为空</p><p><strong>示例:</strong></p><p>正文为空的示例</p><div class="language- line-numbers-mode" data-highlighter="shiki" data-ext="" style="background-color:#1E1E1E;color:#D4D4D4;"><pre class="shiki dark-plus vp-code"><code class="language-"><span class="line"><span>00000000 00 00 00 12 00 12 00 01 00 00 00 02 00 00 00 01 |................|</span></span>
<span class="line"><span>00000010 00 00 |..|</span></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div><div class="line-number"></div></div></div><p>正文为<code>[object Object]</code>的示例</p><div class="language- line-numbers-mode" data-highlighter="shiki" data-ext="" style="background-color:#1E1E1E;color:#D4D4D4;"><pre class="shiki dark-plus vp-code"><code class="language-"><span class="line"><span>00000000 00 00 00 21 00 12 00 01 00 00 00 02 00 00 00 01 |...!............|</span></span>
<span class="line"><span>00000010 00 00 5b 6f 62 6a 65 63 74 20 4f 62 6a 65 63 74 |..[object Object|</span></span>
<span class="line"><span>00000020 5d |]|</span></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h2 id="心跳包回复-实时观看数-下行" tabindex="-1"><a class="header-anchor" href="#心跳包回复-实时观看数-下行"><span>心跳包回复(实时观看数)(下行)</span></a></h2><p><strong>正文内容json:</strong></p><p>根对象:</p><table><thead><tr><th>字段</th><th>类型</th><th>内容</th><th>备注</th></tr></thead><tbody><tr><td>code</td><td>num</td><td>返回值</td><td>0:成功</td></tr><tr><td>message</td><td>str</td><td>错误信息</td><td>默认为OK</td></tr><tr><td>data</td><td>obj</td><td>信息本体</td><td></td></tr></tbody></table><p><code>data</code>对象:</p><table><thead><tr><th>字段</th><th>类型</th><th>内容</th><th>备注</th></tr></thead><tbody><tr><td>room</td><td>obj</td><td>视频实时观看信息</td><td></td></tr></tbody></table><p><code>data</code>中的<code>room</code>对象:</p><table><thead><tr><th>字段</th><th>类型</th><th>内容</th><th>备注</th></tr></thead><tbody><tr><td>online</td><td>num</td><td>实时观看人数</td><td></td></tr><tr><td>room_id</td><td>str</td><td>目标视频</td><td><code>video://{稿件avid}/{视频cid}</code></td></tr></tbody></table><p><strong>示例:</strong></p><p>当前视频<code>av706</code>实时观看人数为13</p><div class="language- line-numbers-mode" data-highlighter="shiki" data-ext="" style="background-color:#1E1E1E;color:#D4D4D4;"><pre class="shiki dark-plus vp-code"><code class="language-"><span class="line"><span>00000000 00 00 00 68 00 12 00 01 00 00 00 03 00 00 00 01 |...h............|</span></span>
<span class="line"><span>00000010 00 00 7b 22 63 6f 64 65 22 3a 30 2c 22 6d 65 73 |..{&quot;code&quot;:0,&quot;mes|</span></span>
<span class="line"><span>00000020 73 61 67 65 22 3a 22 30 22 2c 22 64 61 74 61 22 |sage&quot;:&quot;0&quot;,&quot;data&quot;|</span></span>
<span class="line"><span>00000030 3a 7b 22 72 6f 6f 6d 22 3a 7b 22 6f 6e 6c 69 6e |:{&quot;room&quot;:{&quot;onlin|</span></span>
<span class="line"><span>00000040 65 22 3a 31 33 2c 22 72 6f 6f 6d 5f 69 64 22 3a |e&quot;:13,&quot;room_id&quot;:|</span></span>
<span class="line"><span>00000050 22 76 69 64 65 6f 3a 2f 2f 37 30 36 2f 33 37 32 |&quot;video://706/372|</span></span>
<span class="line"><span>00000060 34 37 32 33 22 7d 7d 7d |4723&quot;}}}|</span></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h2 id="普通包-实时弹幕-下行" tabindex="-1"><a class="header-anchor" href="#普通包-实时弹幕-下行"><span>普通包(实时弹幕)(下行)</span></a></h2><p><strong>正文内容json:</strong></p><p>根数组:</p><table><thead><tr><th>项</th><th>类型</th><th>内容</th><th>备注</th></tr></thead><tbody><tr><td>0</td><td>str</td><td>弹幕属性信息</td><td>详见<a href="https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/danmaku/danmaku_xml.md" target="_blank" rel="noopener noreferrer">「弹幕」中的属性 p</a></td></tr><tr><td>1</td><td>str</td><td>弹幕内容</td><td></td></tr></tbody></table><p><strong>示例:</strong></p><p>弹幕属性为<code>0.25,1,25,16777215,1588433046,1588431486568150,0,33ad5d91,32134068443807747</code></p><p>弹幕内容为<code>此生无悔入东方,来世愿生幻想乡</code></p><div class="language- line-numbers-mode" data-highlighter="shiki" data-ext="" style="background-color:#1E1E1E;color:#D4D4D4;"><pre class="shiki dark-plus vp-code"><code class="language-"><span class="line"><span>00000000 00 00 00 91 00 12 00 01 00 00 03 e8 00 00 00 00 |................|</span></span>
<span class="line"><span>00000010 00 00 5b 22 30 2e 32 35 2c 31 2c 32 35 2c 31 36 |..[&quot;0.25,1,25,16|</span></span>
<span class="line"><span>00000020 37 37 37 32 31 35 2c 31 35 38 38 34 33 33 30 34 |777215,158843304|</span></span>
<span class="line"><span>00000030 36 2c 31 35 38 38 34 33 31 34 38 36 35 36 38 31 |6,15884314865681|</span></span>
<span class="line"><span>00000040 35 30 2c 30 2c 33 33 61 64 35 64 39 31 2c 33 32 |50,0,33ad5d91,32|</span></span>
<span class="line"><span>00000050 31 33 34 30 36 38 34 34 33 38 30 37 37 34 37 22 |134068443807747&quot;|</span></span>
<span class="line"><span>00000060 2c 22 e6 ad a4 e7 94 9f e6 97 a0 e6 82 94 e5 85 |,&quot;此 生 无 悔|</span></span>
<span class="line"><span>00000070 a5 e4 b8 9c e6 96 b9 ef bc 8c e6 9d a5 e4 b8 96 |入 东 方 ,来 世 |</span></span>
<span class="line"><span>00000080 e6 84 bf e7 94 9f e5 b9 bb e6 83 b3 e4 b9 a1 22 |愿 生 幻 想 乡&quot;|</span></span>
<span class="line"><span>00000090 5d |]|</span></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div></div><!--[--><!--]--></div><footer class="vp-page-meta"><div class="vp-meta-item edit-link"><a class="auto-link external-link label" href="https://github.com/SocialSisterYi/bilibili-API-collect/edit/master/docs/broadcast/video_room.md" aria-label="在 GitHub 上编辑此页" rel="noopener noreferrer" target="_blank"><!--[--><!--[--><svg class="edit-icon" viewbox="0 0 1024 1024"><g fill="currentColor"><path d="M430.818 653.65a60.46 60.46 0 0 1-50.96-93.281l71.69-114.012 7.773-10.365L816.038 80.138A60.46 60.46 0 0 1 859.225 62a60.46 60.46 0 0 1 43.186 18.138l43.186 43.186a60.46 60.46 0 0 1 0 86.373L588.879 565.55l-8.637 8.637-117.466 68.234a60.46 60.46 0 0 1-31.958 11.229z"></path><path d="M728.802 962H252.891A190.883 190.883 0 0 1 62.008 771.98V296.934a190.883 190.883 0 0 1 190.883-192.61h267.754a60.46 60.46 0 0 1 0 120.92H252.891a69.962 69.962 0 0 0-69.098 69.099V771.98a69.962 69.962 0 0 0 69.098 69.098h475.911A69.962 69.962 0 0 0 797.9 771.98V503.363a60.46 60.46 0 1 1 120.922 0V771.98A190.883 190.883 0 0 1 728.802 962z"></path></g></svg><!--]--><!--]-->在 GitHub 上编辑此页<!--[--><!--[--><!--]--><!--]--></a></div><div class="vp-meta-item git-info"><div class="vp-meta-item last-updated"><span class="meta-item-label">最近更新: </span><time class="meta-item-info" datetime="2023-02-23T03:48:58.000Z" data-allow-mismatch>2023/2/23 03:48</time></div><div class="vp-meta-item contributors"><span class="meta-item-label">Contributors: </span><span class="meta-item-info"><!--[--><!--[--><span class="contributor" title="email: 1440239038@qq.com">SocialSisterYi</span><!----><!--]--><!--]--></span></div></div></footer><!----><!--[--><!--[--><footer style="text-align:center;"> Copyright © 2020-2025 <a href="https://github.com/SocialSisterYi/">SocialSisterYi</a> | <a href="https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/LICENSE">CC-BY-NC-4.0 Licensed</a></footer><!--]--><!--]--></main><!--]--></div><!--[--><!----><!--]--><!--]--></div>
<script type="module" src="/bilibili-API-collect/assets/app-Dgsdh8A6.js" defer></script>
</body>
</html>