import{_ as r,c as o,a,b as l,d as n,e as d,w as e,r as u,o as i}from"./app-CDdN0tOz.js";const p={};function m(D,t){const s=u("RouteLink");return i(),o("div",null,[t[73]||(t[73]=a(`<h1 id="视频观看数据上报" tabindex="-1"><a class="header-anchor" href="#视频观看数据上报"><span>视频观看数据上报</span></a></h1><h2 id="上报观看进度-双端" tabindex="-1"><a class="header-anchor" href="#上报观看进度-双端"><span>上报观看进度（双端）</span></a></h2><blockquote><p>https://api.bilibili.com/x/v2/history/report</p></blockquote><p><em>请求方式：POST</em></p><p>认证方式：APP或Cookie（SESSDATA）</p><p><strong>正文参数（ application/x-www-form-urlencoded ）：</strong></p><table><thead><tr><th>参数名</th><th>类型</th><th>内容</th><th>必要性</th><th>备注</th></tr></thead><tbody><tr><td>access_key</td><td>str</td><td>APP登录Token</td><td>APP方式必要</td><td></td></tr><tr><td>aid</td><td>num</td><td>稿件avid</td><td>必要</td><td></td></tr><tr><td>cid</td><td>num</td><td>视频cid</td><td>必要</td><td>用于识别分P</td></tr><tr><td>progress</td><td>num</td><td>观看进度</td><td>非必要</td><td>单位为秒<br>默认为0</td></tr><tr><td>platform</td><td>str</td><td>平台标识</td><td>非必要</td><td>可为android</td></tr><tr><td>csrf</td><td>str</td><td>CSRF Token（位于cookie）</td><td>Cookie方式必要</td><td></td></tr></tbody></table><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：成功 <br>-101：账号未登录<br>-111：csrf校验失败<br>-400：请求错误</td></tr><tr><td>message</td><td>str</td><td>错误信息</td><td>默认为0</td></tr><tr><td>ttl</td><td>num</td><td>1</td><td></td></tr></tbody></table><p><strong>示例：</strong></p><p>记录视频<code>av13662970</code>（<code>cid=126654047</code>）的观看记录位于<code>1248</code>秒</p><p>Cookie方式：</p><div class="language-shell line-numbers-mode" data-highlighter="shiki" data-ext="shell" style="background-color:#1E1E1E;color:#D4D4D4;"><pre class="shiki dark-plus vp-code"><code class="language-shell"><span class="line"><span style="color:#DCDCAA;">curl</span><span style="color:#CE9178;"> &#39;https://api.bilibili.com/x/v2/history/report&#39;</span><span style="color:#D7BA7D;"> \\</span></span>
<span class="line"><span style="color:#D4D4D4;">--data-urlencode </span><span style="color:#CE9178;">&#39;aid=13662970&#39;</span><span style="color:#D7BA7D;"> \\</span></span>
<span class="line"><span style="color:#D4D4D4;">--data-urlencode </span><span style="color:#CE9178;">&#39;cid=126654047&#39;</span><span style="color:#D7BA7D;"> \\</span></span>
<span class="line"><span style="color:#D4D4D4;">--data-urlencode </span><span style="color:#CE9178;">&#39;progress=1248&#39;</span><span style="color:#D7BA7D;"> \\</span></span>
<span class="line"><span style="color:#D4D4D4;">--data-urlencode </span><span style="color:#CE9178;">&#39;platform=android&#39;</span><span style="color:#D7BA7D;"> \\</span></span>
<span class="line"><span style="color:#D4D4D4;">--data-urlencode </span><span style="color:#CE9178;">&#39;csrf=xxx&#39;</span><span style="color:#D7BA7D;"> \\</span></span>
<span class="line"><span style="color:#D4D4D4;">-b </span><span style="color:#CE9178;">&#39;SESSDATA=xxx&#39;</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><p>APP方式：</p><div class="language-shell line-numbers-mode" data-highlighter="shiki" data-ext="shell" style="background-color:#1E1E1E;color:#D4D4D4;"><pre class="shiki dark-plus vp-code"><code class="language-shell"><span class="line"><span style="color:#DCDCAA;">curl</span><span style="color:#CE9178;"> &#39;https://api.bilibili.com/x/v2/history/report&#39;</span><span style="color:#D7BA7D;"> \\</span></span>
<span class="line"><span style="color:#D4D4D4;">--data-urlencode </span><span style="color:#CE9178;">&#39;access_key=xxx&#39;</span><span style="color:#D7BA7D;"> \\</span></span>
<span class="line"><span style="color:#D4D4D4;">--data-urlencode </span><span style="color:#CE9178;">&#39;aid=13662970&#39;</span><span style="color:#D7BA7D;"> \\</span></span>
<span class="line"><span style="color:#D4D4D4;">--data-urlencode </span><span style="color:#CE9178;">&#39;cid=126654047&#39;</span><span style="color:#D7BA7D;"> \\</span></span>
<span class="line"><span style="color:#D4D4D4;">--data-urlencode </span><span style="color:#CE9178;">&#39;progress=1248&#39;</span><span style="color:#D7BA7D;"> \\</span></span>
<span class="line"><span style="color:#D4D4D4;">--data-urlencode </span><span style="color:#CE9178;">&#39;platform=android&#39;</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><details><summary>查看响应示例：</summary><div class="language-json line-numbers-mode" data-highlighter="shiki" data-ext="json" style="background-color:#1E1E1E;color:#D4D4D4;"><pre class="shiki dark-plus vp-code"><code class="language-json"><span class="line"><span style="color:#D4D4D4;">{</span></span>
<span class="line"><span style="color:#9CDCFE;">    &quot;code&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#B5CEA8;">0</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">    &quot;message&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#CE9178;">&quot;0&quot;</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">    &quot;ttl&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#B5CEA8;">1</span></span>
<span class="line"><span style="color:#D4D4D4;">}</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></div></details><h2 id="上报视频播放心跳-web端" tabindex="-1"><a class="header-anchor" href="#上报视频播放心跳-web端"><span>上报视频播放心跳（web端）</span></a></h2><blockquote><p>https://api.bilibili.com/x/click-interface/web/heartbeat</p></blockquote><p><em>请求方式：POST</em></p><p>认证方式：仅可Cookie（SESSDATA）</p><p>默认间隔15秒一次, 亦可记录播放历史</p><p>该接口较为复杂, 且参数计算方法均为推测, 实际过程不明, 可能含有错误, 若要正式使用可以把已播放的持续时间全都设为相同值</p><p><strong>URL参数:</strong></p>`,24)),l("table",null,[t[22]||(t[22]=l("thead",null,[l("tr",null,[l("th",null,"参数名"),l("th",null,"类型"),l("th",null,"内容"),l("th",null,"必要性"),l("th",null,"备注")])],-1)),l("tbody",null,[t[12]||(t[12]=l("tr",null,[l("td",null,"w_start_ts"),l("td",null,"num"),l("td",null,[n("参见请求正文同名无"),l("code",null,"w_"),n("前缀参数")]),l("td",null,"非必要"),l("td",null,"UNIX 秒级时间戳")],-1)),t[13]||(t[13]=l("tr",null,[l("td",null,"w_mid"),l("td",null,"num"),l("td",null,[n("参见请求正文同名无"),l("code",null,"w_"),n("前缀参数")]),l("td",null,"非必要"),l("td")],-1)),t[14]||(t[14]=l("tr",null,[l("td",null,"w_aid"),l("td",null,"num"),l("td",null,[n("参见请求正文同名无"),l("code",null,"w_"),n("前缀参数")]),l("td",null,"非必要"),l("td")],-1)),t[15]||(t[15]=l("tr",null,[l("td",null,"w_dt"),l("td",null,"num"),l("td",null,"2"),l("td",null,"非必要"),l("td")],-1)),t[16]||(t[16]=l("tr",null,[l("td",null,"w_realtime"),l("td",null,"num"),l("td",null,[n("参见请求正文同名无"),l("code",null,"w_"),n("前缀参数")]),l("td",null,"非必要"),l("td",null,"单位 秒")],-1)),t[17]||(t[17]=l("tr",null,[l("td",null,"w_playedtime"),l("td",null,"num"),l("td",null,[n("参见请求正文同名无"),l("code",null,"w_"),n("前缀参数")]),l("td",null,"非必要"),l("td",null,"单位 秒")],-1)),t[18]||(t[18]=l("tr",null,[l("td",null,"w_real_played_time"),l("td",null,"num"),l("td",null,[n("参见请求正文同名无"),l("code",null,"w_"),n("前缀参数")]),l("td",null,"非必要"),l("td",null,"单位 秒")],-1)),t[19]||(t[19]=l("tr",null,[l("td",null,"w_video_duration"),l("td",null,"num"),l("td",null,[n("参见请求正文同名无"),l("code",null,"w_"),n("前缀参数")]),l("td",null,"非必要"),l("td",null,"单位 秒")],-1)),t[20]||(t[20]=l("tr",null,[l("td",null,"w_last_play_progress_time"),l("td",null,"num"),l("td",null,[n("参见请求正文同名无"),l("code",null,"w_"),n("前缀参数")]),l("td",null,"非必要"),l("td",null,"单位 秒")],-1)),t[21]||(t[21]=l("tr",null,[l("td",null,"web_location"),l("td",null,"num"),l("td",null,"网页位置"),l("td",null,"非必要"),l("td",null,"视频详情页播放器: 1315873")],-1)),l("tr",null,[t[2]||(t[2]=l("td",null,"w_rid",-1)),t[3]||(t[3]=l("td",null,"num",-1)),t[4]||(t[4]=l("td",null,"WBI 签名",-1)),t[5]||(t[5]=l("td",null,"非必要",-1)),l("td",null,[t[1]||(t[1]=n("参见")),d(s,{to:"/docs/misc/sign/wbi.html"},{default:e(()=>t[0]||(t[0]=[n("WBI 签名")])),_:1,__:[0]})])]),l("tr",null,[t[8]||(t[8]=l("td",null,"wts",-1)),t[9]||(t[9]=l("td",null,"num",-1)),t[10]||(t[10]=l("td",null,"UNIX 秒级时间戳",-1)),t[11]||(t[11]=l("td",null,"非必要",-1)),l("td",null,[t[7]||(t[7]=n("参见")),d(s,{to:"/docs/misc/sign/wbi.html"},{default:e(()=>t[6]||(t[6]=[n("WBI 签名")])),_:1,__:[6]})])])])]),t[74]||(t[74]=l("p",null,[l("strong",null,"正文参数（ application/x-www-form-urlencoded ）：")],-1)),l("table",null,[t[53]||(t[53]=l("thead",null,[l("tr",null,[l("th",null,"参数名"),l("th",null,"类型"),l("th",null,"内容"),l("th",null,"必要性"),l("th",null,"备注")])],-1)),l("tbody",null,[t[29]||(t[29]=l("tr",null,[l("td",null,"aid"),l("td",null,"num"),l("td",null,"稿件avid"),l("td",null,"必要（可选）"),l("td",null,"avid与bvid任选一个(网页端请求默认仅使用aid)")],-1)),t[30]||(t[30]=l("tr",null,[l("td",null,"bvid"),l("td",null,"str"),l("td",null,"稿件bvid"),l("td",null,"必要（可选）"),l("td",null,"avid与bvid任选一个")],-1)),t[31]||(t[31]=l("tr",null,[l("td",null,"cid"),l("td",null,"num"),l("td",null,"视频cid"),l("td",null,"非必要"),l("td",null,"用于识别分P")],-1)),t[32]||(t[32]=l("tr",null,[l("td",null,"epid"),l("td",null,"num"),l("td",null,"番剧epid"),l("td",null,"非必要"),l("td")],-1)),t[33]||(t[33]=l("tr",null,[l("td",null,"sid"),l("td",null,"num"),l("td",null,"番剧ssid"),l("td",null,"非必要"),l("td")],-1)),t[34]||(t[34]=l("tr",null,[l("td",null,"mid"),l("td",null,"num"),l("td",null,"当前用户mid"),l("td",null,"非必要"),l("td")],-1)),t[35]||(t[35]=l("tr",null,[l("td",null,"played_time"),l("td",null,"num"),l("td",null,"视频播放进度"),l("td",null,"非必要"),l("td",null,[n("单位 秒"),l("br"),n("播放完成为 -1")])],-1)),t[36]||(t[36]=l("tr",null,[l("td",null,"realtime"),l("td",null,"num"),l("td",null,"本轮页面会话真实播放时间"),l("td",null,"非必要"),l("td",null,"单位 秒")],-1)),t[37]||(t[37]=l("tr",null,[l("td",null,"real_played_time"),l("td",null,"num"),l("td",null,"本轮页面会话真实视频播放持续时间"),l("td",null,"非必要"),l("td",null,"单位 秒")],-1)),t[38]||(t[38]=l("tr",null,[l("td",null,"refer_url"),l("td",null,"str"),l("td",null,"与请求头 Referer 字段相同"),l("td",null,"非必要"),l("td")],-1)),l("tr",null,[t[25]||(t[25]=l("td",null,"quality",-1)),t[26]||(t[26]=l("td",null,"num",-1)),t[27]||(t[27]=l("td",null,"视频清晰度",-1)),t[28]||(t[28]=l("td",null,"非必要",-1)),l("td",null,[t[24]||(t[24]=n("参见")),d(s,{to:"/docs/video/videostream_url.html#qn%E8%A7%86%E9%A2%91%E6%B8%85%E6%99%B0%E5%BA%A6%E6%A0%87%E8%AF%86"},{default:e(()=>t[23]||(t[23]=[n("qn视频清晰度标识")])),_:1,__:[23]})])]),t[39]||(t[39]=l("tr",null,[l("td",null,"video_duration"),l("td",null,"num"),l("td",null,"视频时长"),l("td",null,"非必要"),l("td",null,"单位 秒")],-1)),t[40]||(t[40]=l("tr",null,[l("td",null,"last_play_progress_time"),l("td",null,"num"),l("td",null,"play_time 与 本轮页面会话开始时 played_time 之和"),l("td",null,"非必要"),l("td",null,"单位 秒")],-1)),t[41]||(t[41]=l("tr",null,[l("td",null,"max_play_progress_time"),l("td",null,"num"),l("td",null,"本轮页面会话所有最大 last_play_progress_time 与 本轮页面会话开始时 played_time 之和"),l("td",null,"非必要"),l("td",null,"单位 秒")],-1)),t[42]||(t[42]=l("tr",null,[l("td",null,"start_ts"),l("td",null,"num"),l("td",null,"开始播放时刻"),l("td",null,"非必要"),l("td",null,"时间戳")],-1)),t[43]||(t[43]=l("tr",null,[l("td",null,"type"),l("td",null,"num"),l("td",null,"视频类型"),l("td",null,"非必要"),l("td",null,[n("3：投稿视频"),l("br"),n("4：剧集"),l("br"),n("10：课程")])],-1)),t[44]||(t[44]=l("tr",null,[l("td",null,"sub_type"),l("td",null,"num"),l("td",null,"剧集副类型"),l("td",null,"非必要"),l("td",null,[n("0: 普通投稿视频"),l("br"),n("1：番剧"),l("br"),n("2：电影"),l("br"),n("3：纪录片"),l("br"),n("4：国创"),l("br"),n("5：电视剧"),l("br"),n("7：综艺")])],-1)),t[45]||(t[45]=l("tr",null,[l("td",null,"dt"),l("td",null,"num"),l("td",null,"2"),l("td",null,"非必要"),l("td")],-1)),t[46]||(t[46]=l("tr",null,[l("td",null,"outer"),l("td",null,"num"),l("td",null,"0"),l("td",null,"非必要"),l("td")],-1)),t[47]||(t[47]=l("tr",null,[l("td",null,"spmid"),l("td",null,"str"),l("td",null,"333.788.0.0"),l("td",null,"非必要"),l("td",null,"作用尚不明确")],-1)),t[48]||(t[48]=l("tr",null,[l("td",null,"from_spmid"),l("td",null,"str"),l("td",null,"播放来源?"),l("td",null,"非必要"),l("td",null,[n("也可为空, 如: "),l("code",null,"444.41.list.card_archive.click"),n(),l("code",null,"333.999.0.0")])],-1)),t[49]||(t[49]=l("tr",null,[l("td",null,"session"),l("td",null,"str"),l("td",null,"会话信息?"),l("td",null,"非必要"),l("td",null,"一串无分隔小写 UUID")],-1)),t[50]||(t[50]=l("tr",null,[l("td",null,"extra"),l("td",null,"obj"),l("td",null,"额外信息, 如播放器版本"),l("td",null,"非必要"),l("td",null,[n("如: "),l("code",null,'{"player_version":"4.8.36"}')])],-1)),t[51]||(t[51]=l("tr",null,[l("td",null,"play_type"),l("td",null,"num"),l("td",null,"播放动作"),l("td",null,"非必要"),l("td",null,[n("0：播放中"),l("br"),n("1：开始播放"),l("br"),n("2：暂停"),l("br"),n("3：继续播放"),l("br"),n("4: 结束播放")])],-1)),t[52]||(t[52]=l("tr",null,[l("td",null,"csrf"),l("td",null,"str"),l("td",null,"CSRF Token (即 Cookie 中 bili_jct)"),l("td",null,"非必要"),l("td")],-1))])]),t[75]||(t[75]=a(`<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：成功<br>-400：请求错误</td></tr><tr><td>message</td><td>str</td><td>错误信息</td><td>默认为0</td></tr><tr><td>ttl</td><td>num</td><td>1</td><td></td></tr></tbody></table><p><strong>示例：</strong></p><p>上报一次视频<code>av2</code>/<code>BV1xx411c7mD</code>的心跳数据</p><div class="language-shell line-numbers-mode" data-highlighter="shiki" data-ext="shell" style="background-color:#1E1E1E;color:#D4D4D4;"><pre class="shiki dark-plus vp-code"><code class="language-shell"><span class="line"><span style="color:#DCDCAA;">curl</span><span style="color:#CE9178;"> &#39;https://api.bilibili.com/x/click-interface/web/heartbeat&#39;</span><span style="color:#D7BA7D;"> \\</span></span>
<span class="line"><span style="color:#D4D4D4;">--data-urlencode </span><span style="color:#CE9178;">&#39;aid=2&#39;</span><span style="color:#D7BA7D;"> \\</span></span>
<span class="line"><span style="color:#D4D4D4;">--data-urlencode </span><span style="color:#CE9178;">&#39;bvid=BV1xx411c7mD&#39;</span><span style="color:#D7BA7D;"> \\</span></span>
<span class="line"><span style="color:#D4D4D4;">--data-urlencode </span><span style="color:#CE9178;">&#39;cid=62131&#39;</span><span style="color:#D7BA7D;"> \\</span></span>
<span class="line"><span style="color:#D4D4D4;">--data-urlencode </span><span style="color:#CE9178;">&#39;played_time=60&#39;</span><span style="color:#D7BA7D;"> \\</span></span>
<span class="line"><span style="color:#D4D4D4;">--data-urlencode </span><span style="color:#CE9178;">&#39;realtime=60&#39;</span><span style="color:#D7BA7D;"> \\</span></span>
<span class="line"><span style="color:#D4D4D4;">--data-urlencode </span><span style="color:#CE9178;">&#39;start_ts=1592720840&#39;</span><span style="color:#D7BA7D;"> \\</span></span>
<span class="line"><span style="color:#D4D4D4;">--data-urlencode </span><span style="color:#CE9178;">&#39;type=3&#39;</span><span style="color:#D7BA7D;"> \\</span></span>
<span class="line"><span style="color:#D4D4D4;">--data-urlencode </span><span style="color:#CE9178;">&#39;dt=2&#39;</span><span style="color:#D7BA7D;"> \\</span></span>
<span class="line"><span style="color:#D4D4D4;">--data-urlencode </span><span style="color:#CE9178;">&#39;play_type=0&#39;</span><span style="color:#D7BA7D;"> \\</span></span>
<span class="line"><span style="color:#D4D4D4;">--data-urlencode </span><span style="color:#CE9178;">&#39;csrf=xxx&#39;</span><span style="color:#D7BA7D;"> \\</span></span>
<span class="line"><span style="color:#D4D4D4;">-b </span><span style="color:#CE9178;">&#39;SESSDATA=xxx&#39;</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 class="line-number"></div><div class="line-number"></div></div></div><details><summary>查看响应示例：</summary><div class="language-json line-numbers-mode" data-highlighter="shiki" data-ext="json" style="background-color:#1E1E1E;color:#D4D4D4;"><pre class="shiki dark-plus vp-code"><code class="language-json"><span class="line"><span style="color:#D4D4D4;">{</span></span>
<span class="line"><span style="color:#9CDCFE;">    &quot;code&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#B5CEA8;">0</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">    &quot;message&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#CE9178;">&quot;0&quot;</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">    &quot;ttl&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#B5CEA8;">1</span></span>
<span class="line"><span style="color:#D4D4D4;">}</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></div></details><h2 id="开始观看视频-web端" tabindex="-1"><a class="header-anchor" href="#开始观看视频-web端"><span>开始观看视频 (web端)</span></a></h2><blockquote><p>https://api.bilibili.com/x/click-interface/click/web/h5</p></blockquote><p><em>请求方式: POST</em></p><p>认证方式: Cookie (SESSDATA)</p><p>该接口亦被用于计算播放量, 播放量更新不是实时的<br> 该接口使用似乎存在 200 播放限制, <strong>请勿滥用!</strong></p><p><strong>URL参数:</strong></p>`,13)),l("table",null,[t[72]||(t[72]=l("thead",null,[l("tr",null,[l("th",null,"参数名"),l("th",null,"类型"),l("th",null,"内容"),l("th",null,"必要性"),l("th",null,"备注")])],-1)),l("tbody",null,[t[66]||(t[66]=l("tr",null,[l("td",null,"w_aid"),l("td",null,"num"),l("td",null,"稿件 aid"),l("td",null,"不必要"),l("td")],-1)),t[67]||(t[67]=l("tr",null,[l("td",null,"w_part"),l("td",null,"num"),l("td",null,"视频分 P 编号"),l("td",null,"不必要"),l("td")],-1)),t[68]||(t[68]=l("tr",null,[l("td",null,"w_ftime"),l("td",null,"num"),l("td",null,"点击时间戳?"),l("td",null,"不必要"),l("td",null,"UNIX 秒级时间戳")],-1)),t[69]||(t[69]=l("tr",null,[l("td",null,"w_stime"),l("td",null,"num"),l("td",null,"开始播放时间戳?"),l("td",null,"不必要"),l("td",null,"UNIX 秒级时间戳")],-1)),t[70]||(t[70]=l("tr",null,[l("td",null,"w_type"),l("td",null,"num"),l("td",null,"视频类型"),l("td",null,"不必要"),l("td",null,[n("见"),l("a",{href:"#%E4%B8%8A%E6%8A%A5%E8%A7%86%E9%A2%91%E6%92%AD%E6%94%BE%E5%BF%83%E8%B7%B3web%E7%AB%AF"},"上报视频播放心跳（web端）")])],-1)),t[71]||(t[71]=l("tr",null,[l("td",null,"web_location"),l("td",null,"num"),l("td",null,"网页位置?"),l("td",null,"不必要"),l("td",null,"1315873")],-1)),l("tr",null,[t[56]||(t[56]=l("td",null,"w_rid",-1)),t[57]||(t[57]=l("td",null,"num",-1)),t[58]||(t[58]=l("td",null,"WBI 签名",-1)),t[59]||(t[59]=l("td",null,"不必要",-1)),l("td",null,[t[55]||(t[55]=n("参见")),d(s,{to:"/docs/misc/sign/wbi.html"},{default:e(()=>t[54]||(t[54]=[n("WBI 签名")])),_:1,__:[54]})])]),l("tr",null,[t[62]||(t[62]=l("td",null,"wts",-1)),t[63]||(t[63]=l("td",null,"num",-1)),t[64]||(t[64]=l("td",null,"UNIX 秒级时间戳",-1)),t[65]||(t[65]=l("td",null,"不必要",-1)),l("td",null,[t[61]||(t[61]=n("参见")),d(s,{to:"/docs/misc/sign/wbi.html"},{default:e(()=>t[60]||(t[60]=[n("WBI 签名")])),_:1,__:[60]})])])])]),t[76]||(t[76]=a(`<p><strong>正文参数 (application/x-www-form-urlencoded):</strong></p><table><thead><tr><th>参数名</th><th>类型</th><th>内容</th><th>必要性</th><th>备注</th></tr></thead><tbody><tr><td>mid</td><td>num</td><td>当前用户 mid</td><td>不必要</td><td></td></tr><tr><td>aid</td><td>num</td><td>稿件 aid</td><td>必要</td><td></td></tr><tr><td>cid</td><td>num</td><td>视频 cid</td><td>不必要</td><td></td></tr><tr><td>part</td><td>num</td><td>视频分 P 编号</td><td>不必要</td><td></td></tr><tr><td>lv</td><td>num</td><td>当前用户等级</td><td>不必要</td><td></td></tr><tr><td>ftime</td><td>num</td><td>同 URL 参数中带有 <code>w_</code> 前缀的同名参数</td><td>不必要</td><td></td></tr><tr><td>stime</td><td>num</td><td>同 URL 参数中带有 <code>w_</code> 前缀的同名参数</td><td>不必要</td><td></td></tr><tr><td>type</td><td>num</td><td>视频类型</td><td>不必要</td><td>见<a href="#%E4%B8%8A%E6%8A%A5%E8%A7%86%E9%A2%91%E6%92%AD%E6%94%BE%E5%BF%83%E8%B7%B3web%E7%AB%AF">上报视频播放心跳（web端）</a></td></tr><tr><td>sub_type</td><td>num</td><td>视频子类型</td><td>不必要</td><td>见<a href="#%E4%B8%8A%E6%8A%A5%E8%A7%86%E9%A2%91%E6%92%AD%E6%94%BE%E5%BF%83%E8%B7%B3web%E7%AB%AF">上报视频播放心跳（web端）</a></td></tr><tr><td>referer_url</td><td>str</td><td>与请求头 Referer 字段相同</td><td>不必要</td><td></td></tr><tr><td>outer</td><td>num</td><td>0</td><td>不必要</td><td></td></tr><tr><td>spmid</td><td>str</td><td>333.788.0.0</td><td>不必要</td><td>作用尚不明确</td></tr><tr><td>from_spmid</td><td>str</td><td>播放来源?</td><td>不必要</td><td>见<a href="#%E4%B8%8A%E6%8A%A5%E8%A7%86%E9%A2%91%E6%92%AD%E6%94%BE%E5%BF%83%E8%B7%B3web%E7%AB%AF">上报视频播放心跳（web端）</a></td></tr><tr><td>session</td><td>str</td><td>会话信息?</td><td>不必要</td><td>一串无分隔小写 UUID</td></tr><tr><td>csrf</td><td>str</td><td>CSRF Token (即 Cookie 中 bili_jct)</td><td>不必要</td><td></td></tr></tbody></table><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：成功<br>-400：请求错误</td></tr><tr><td>message</td><td>str</td><td>错误信息</td><td>默认为 <code>0</code></td></tr><tr><td>ttl</td><td>num</td><td>1</td><td></td></tr></tbody></table><p><strong>示例:</strong></p><div class="language-shell line-numbers-mode" data-highlighter="shiki" data-ext="shell" style="background-color:#1E1E1E;color:#D4D4D4;"><pre class="shiki dark-plus vp-code"><code class="language-shell"><span class="line"><span style="color:#DCDCAA;">curl</span><span style="color:#CE9178;"> &#39;https://api.bilibili.com/x/click-interface/click/web/h5&#39;</span><span style="color:#D7BA7D;"> \\</span></span>
<span class="line"><span style="color:#D4D4D4;">--data-urlencode </span><span style="color:#CE9178;">&#39;aid=2&#39;</span><span style="color:#D7BA7D;"> \\</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><details><summary>查看响应示例:</summary><div class="language-json line-numbers-mode" data-highlighter="shiki" data-ext="json" style="background-color:#1E1E1E;color:#D4D4D4;"><pre class="shiki dark-plus vp-code"><code class="language-json"><span class="line"><span style="color:#D4D4D4;">{</span></span>
<span class="line"><span style="color:#9CDCFE;">    &quot;code&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#B5CEA8;">0</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">    &quot;message&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#CE9178;">&quot;0&quot;</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">    &quot;ttl&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#B5CEA8;">1</span></span>
<span class="line"><span style="color:#D4D4D4;">}</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></div></details>`,8))])}const y=r(p,[["render",m]]),c=JSON.parse('{"path":"/docs/video/report.html","title":"视频观看数据上报","lang":"zh-CN","frontmatter":{},"git":{"updatedTime":1744422578000,"contributors":[{"name":"SocialSisterYi","username":"SocialSisterYi","email":"1440239038@qq.com","commits":3,"url":"https://github.com/SocialSisterYi"},{"name":"SessionHu","username":"SessionHu","email":"102411014+SessionHu@users.noreply.github.com","commits":5,"url":"https://github.com/SessionHu"}],"changelog":[{"hash":"9d7c2b07d93a2faf690033c6692abde307d8ece5","time":1744422578000,"email":"102411014+SessionHu@users.noreply.github.com","author":"SessionHu","message":"feat(video/report.md): warning and tips for h5"},{"hash":"1e24c6b1889160c4c35c01416aa4239501accf5f","time":1726759053000,"email":"102411014+SessionHu@users.noreply.github.com","author":"Session小胡","message":"调整部分接口描述与错误修复 (#1088)","coAuthors":[{"name":"社会易姐QwQ","email":"45892418+SocialSisterYi@users.noreply.github.com"}]},{"hash":"60a0c5d1a2f44fe61335da04571305fa7727a968","time":1724238159000,"email":"102411014+SessionHu@users.noreply.github.com","author":"Session小胡","message":"feat: 各种接口补充与错误修正 (#1066)"},{"hash":"2465990ccc5aea35ad6d0b17dc7c2f36bc5e45c0","time":1722059352000,"email":"102411014+SessionHu@users.noreply.github.com","author":"Session小胡","message":"feat: 更新web端视频操作播放合集相关接口 (#1064)"},{"hash":"b1a06806f09ed3ea130eefc94e33df2bc0335424","time":1691494779000,"email":"102411014+SessionHu@users.noreply.github.com","author":"Session小胡","message":"将 http 改为 https (#776)"},{"hash":"f6760f4be38d5b592d396b211e48c666286524de","time":1677124138000,"email":"1440239038@qq.com","author":"SocialSisterYi","message":"🔨remove header index"},{"hash":"7d89ece2ac46425810647c4ac92acf5f3721cb68","time":1676998806000,"email":"1440239038@qq.com","author":"SocialSisterYi","message":"🚀调整项目结构"}]},"filePathRelative":"docs/video/report.md"}');export{y as comp,c as data};
