import{_ as t}from"./download-BaAFXe77.js";import{_ as a,c as n,a as l,o as e}from"./app-Dgsdh8A6.js";const o={};function p(d,s){return e(),n("div",null,s[0]||(s[0]=[l('<h1 id="音频流url" tabindex="-1"><a class="header-anchor" href="#音频流url"><span>音频流URL</span></a></h1><img src="'+t+`" width="100" height="100"><h2 id="音质qn参数定义" tabindex="-1"><a class="header-anchor" href="#音质qn参数定义"><span>音质qn参数定义</span></a></h2><p>音质<code>qn</code>参数：</p><table><thead><tr><th>代码</th><th>含义</th></tr></thead><tbody><tr><td>0</td><td>流畅 128K</td></tr><tr><td>1</td><td>标准 192K</td></tr><tr><td>2</td><td>高品质 320K</td></tr><tr><td>3</td><td>无损 FLAC （大会员）</td></tr></tbody></table><h2 id="获取音频流url-web端" tabindex="-1"><a class="header-anchor" href="#获取音频流url-web端"><span>获取音频流URL(web端)</span></a></h2><blockquote><p>https://www.bilibili.com/audio/music-service-c/web/url</p></blockquote><p><em>请求方式：GET</em></p><p><strong>注：web端无法播放完整付费歌曲，付费歌曲为30s试听片段</strong></p><p>本接口仅能获取192K音质的音频</p><p><strong>url参数：</strong></p><table><thead><tr><th>参数名</th><th>类型</th><th>内容</th><th>必要性</th><th>备注</th></tr></thead><tbody><tr><td>sid</td><td>num</td><td>音频auid</td><td>必要</td><td></td></tr><tr><td>quality</td><td>num</td><td>2</td><td>不必要</td><td></td></tr><tr><td>privilege</td><td>num</td><td>2</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>4511006: 已跳过无法播放的歌曲<br>7201006：未找到或已下架<br>72000000：请求错误</td></tr><tr><td>message</td><td>str</td><td>返回值</td><td>字符串形式的 code</td></tr><tr><td>msg</td><td>str</td><td>返回信息</td><td>成功为 success</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>sid</td><td>num</td><td>音频auid</td><td></td></tr><tr><td>type</td><td>num</td><td>音质标识</td><td>-1：试听片段（192K）<br>1：192K</td></tr><tr><td>info</td><td>str</td><td>空</td><td></td></tr><tr><td>timeout</td><td>num</td><td>有效时长</td><td>单位为秒<br>一般为3h</td></tr><tr><td>size</td><td>num</td><td>文件大小</td><td>单位为字节<br>当<code>type</code>为-1时<code>size</code>为0</td></tr><tr><td>cdns</td><td>array</td><td>音频流url</td><td></td></tr><tr><td>qualities</td><td>null</td><td></td><td></td></tr><tr><td>title</td><td>str</td><td>空</td><td></td></tr><tr><td>cover</td><td>str</td><td>空</td><td></td></tr></tbody></table><p><code>data</code>对象的<code>cdns</code>数组：</p><table><thead><tr><th>项</th><th>类型</th><th>内容</th><th>备注</th></tr></thead><tbody><tr><td>0</td><td>str</td><td>音频流url</td><td></td></tr><tr><td>1</td><td>str</td><td>备用音频流url</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:#569CD6;"> -G</span><span style="color:#CE9178;"> &#39;https://www.bilibili.com/audio/music-service-c/web/url&#39;</span><span style="color:#D7BA7D;"> \\</span></span>
<span class="line"><span style="color:#D4D4D4;">--data-urlencode </span><span style="color:#CE9178;">&#39;sid=777180&#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></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;data&quot;</span><span style="color:#D4D4D4;">: {</span></span>
<span class="line"><span style="color:#9CDCFE;">    &quot;sid&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#B5CEA8;">777180</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">    &quot;title&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#CE9178;">&quot;&quot;</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">    &quot;cover&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#CE9178;">&quot;&quot;</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">    &quot;type&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#B5CEA8;">1</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">    &quot;info&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#CE9178;">&quot;&quot;</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">    &quot;timeout&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#B5CEA8;">10800</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">    &quot;size&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#B5CEA8;">5579903</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">    &quot;cdns&quot;</span><span style="color:#D4D4D4;">: [</span></span>
<span class="line"><span style="color:#CE9178;">      &quot;https://upos-sz-mirrorcos.bilivideo.com/ugaxcode/m190314ws1dikiap1oivtapctuj1agjc-192k.m4a?e=ig8euxZM2rNcNbdlhoNvNC8BqJIzNbfqXBvEqxTEto8BTrNvN0GvT90W5JZMkX_YN0MvXg8gNEV4NC8xNEV4N03eN0B5tZlqNxTEto8BTrNvNeZVuJ10Kj_g2UB02J0mN0B5tZlqNCNEto8BTrNvNC7MTX502C8f2jmMQJ6mqF2fka1mqx6gqj0eN0B599M=&amp;uipk=5&amp;nbs=1&amp;deadline=1725013547&amp;gen=playurlv2&amp;os=cosbv&amp;oi=1746706124&amp;trid=493923009cef4225ab8e1b9bda42c635B&amp;mid=0&amp;platform=pc&amp;og=cos&amp;upsig=043779511e2770cf6c3da04ed8a89f25&amp;uparams=e,uipk,nbs,deadline,gen,os,oi,trid,mid,platform,og&amp;bvc=vod&amp;nettype=0&amp;orderid=0,1&amp;logo=00000000&quot;</span></span>
<span class="line"><span style="color:#D4D4D4;">    ],</span></span>
<span class="line"><span style="color:#9CDCFE;">    &quot;qualities&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#569CD6;">null</span></span>
<span class="line"><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;msg&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#CE9178;">&quot;success&quot;</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 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 class="line-number"></div></div></div></details><h2 id="获取音频流url-可获取付费音频" tabindex="-1"><a class="header-anchor" href="#获取音频流url-可获取付费音频"><span>获取音频流URL（可获取付费音频）</span></a></h2><blockquote><p>https://api.bilibili.com/audio/music-service-c/url</p></blockquote><p><em>请求方式：GET</em></p><p>认证方式：APP或Cookie（SESSDATA）</p><p><strong>注：付费音乐需要有带大会员或音乐包的账号登录（Cookie或APP），否则为试听片段</strong></p><p>无损音质需要登录的用户为会员</p><p><strong>url参数：</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>songid</td><td>num</td><td>音频auid</td><td>必要</td><td></td></tr><tr><td>quality</td><td>num</td><td>音质代码</td><td>必要</td><td><strong>详情见上表</strong></td></tr><tr><td>privilege</td><td>num</td><td>必须为<code>2</code></td><td>必要</td><td></td></tr><tr><td>mid</td><td>num</td><td>当前用户mid</td><td>必要</td><td>可为任意值</td></tr><tr><td>platform</td><td>str</td><td>平台标识</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>7201006：未找到或已下架<br>72000000：请求错误</td></tr><tr><td>msg</td><td>str</td><td>错误信息</td><td>默认为success</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>sid</td><td>num</td><td>音频auid</td><td></td></tr><tr><td>type</td><td>num</td><td>音质标识</td><td>-1：试听片段（192K）<br>0：128K<br>1：192K<br>2：320K<br>3：FLAC</td></tr><tr><td>info</td><td>str</td><td>空</td><td><strong>作用尚不明确</strong></td></tr><tr><td>timeout</td><td>num</td><td>有效时长</td><td>单位为秒<br>一般为3h</td></tr><tr><td>size</td><td>num</td><td>文件大小</td><td>单位为字节<br>当<code>type</code>为-1时<code>size</code>为0</td></tr><tr><td>cdns</td><td>array</td><td>音频流url</td><td></td></tr><tr><td>qualities</td><td>array</td><td>音质列表</td><td></td></tr><tr><td>title</td><td>str</td><td>音频标题</td><td></td></tr><tr><td>cover</td><td>str</td><td>音频封面url</td><td></td></tr></tbody></table><p><code>data</code>对象的<code>cdns</code>数组：</p><table><thead><tr><th>项</th><th>类型</th><th>内容</th><th>备注</th></tr></thead><tbody><tr><td>0</td><td>str</td><td>音频流url</td><td></td></tr><tr><td>1</td><td>str</td><td>备用音频流url</td><td></td></tr></tbody></table><p><code>data</code>对象的<code>qualities</code>数组：</p><table><thead><tr><th>项</th><th>类型</th><th>内容</th><th>备注</th></tr></thead><tbody><tr><td>0</td><td>obj</td><td>音质1</td><td>音质由高向低顺序</td></tr><tr><td>n</td><td>obj</td><td>音质（n+1）</td><td></td></tr></tbody></table><p><code>qualities</code>数组中的对象：</p><table><thead><tr><th>字段</th><th>类型</th><th>内容</th><th>备注</th></tr></thead><tbody><tr><td>type</td><td>num</td><td>音质代码</td><td><strong>详情见上表</strong></td></tr><tr><td>desc</td><td>str</td><td>音质名称</td><td></td></tr><tr><td>size</td><td>num</td><td>该音质的文件大小</td><td>单位为字节</td></tr><tr><td>bps</td><td>str</td><td>比特率标签</td><td></td></tr><tr><td>tag</td><td>str</td><td>音质标签</td><td></td></tr><tr><td>require</td><td>num</td><td>是否需要会员权限</td><td>0：不需要<br>1：需要</td></tr><tr><td>requiredesc</td><td>str</td><td>会员权限标签</td><td></td></tr></tbody></table><p><strong>示例：</strong></p><p>获取音频<code>au682118</code>的音频流url，音质为<code>3（无损）</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:#569CD6;"> -G</span><span style="color:#CE9178;"> &#39;https://api.bilibili.com/audio/music-service-c/url&#39;</span><span style="color:#D7BA7D;"> \\</span></span>
<span class="line"><span style="color:#D4D4D4;">--data-urlencode </span><span style="color:#CE9178;">&#39;songid=682118&#39;</span><span style="color:#D7BA7D;"> \\</span></span>
<span class="line"><span style="color:#D4D4D4;">--data-urlencode </span><span style="color:#CE9178;">&#39;quality=3&#39;</span><span style="color:#D7BA7D;"> \\</span></span>
<span class="line"><span style="color:#D4D4D4;">--data-urlencode </span><span style="color:#CE9178;">&#39;privilege=2&#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;mid=293793435&#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:#569CD6;"> -G</span><span style="color:#CE9178;"> &#39;https://api.bilibili.com/audio/music-service-c/url&#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;songid=682118&#39;</span><span style="color:#D7BA7D;"> \\</span></span>
<span class="line"><span style="color:#D4D4D4;">--data-urlencode </span><span style="color:#CE9178;">&#39;quality=3&#39;</span><span style="color:#D7BA7D;"> \\</span></span>
<span class="line"><span style="color:#D4D4D4;">--data-urlencode </span><span style="color:#CE9178;">&#39;privilege=2&#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;mid=293793435&#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><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;msg&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#CE9178;">&quot;success&quot;</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">    &quot;data&quot;</span><span style="color:#D4D4D4;">: {</span></span>
<span class="line"><span style="color:#9CDCFE;">        &quot;sid&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#B5CEA8;">682118</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">        &quot;type&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#B5CEA8;">3</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">        &quot;info&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#CE9178;">&quot;&quot;</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">        &quot;timeout&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#B5CEA8;">10800</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">        &quot;size&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#B5CEA8;">34456494</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">        &quot;cdns&quot;</span><span style="color:#D4D4D4;">: [</span></span>
<span class="line"><span style="color:#CE9178;">            &quot;https://upos-sz-mirrorkodo.bilivideo.com/ugaxcode/m190102ws2pzf6jitbem841vq2x0du5x-flac.flac?deadline=1595332269&amp;gen=uga&amp;os=kodobv&amp;uparams=deadline,gen,os&amp;upsig=ac2284d97a61ef8758681eccf621c56d&quot;</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#CE9178;">            &quot;https://upos-sz-mirrorks3.bilivideo.com/ugaxcode/m190102ws2pzf6jitbem841vq2x0du5x-flac.flac?deadline=1595332269&amp;gen=uga&amp;os=ks3bv&amp;uparams=deadline,gen,os&amp;upsig=3ac7d94dda5664f6f95dbfffeb289744&quot;</span></span>
<span class="line"><span style="color:#D4D4D4;">        ],</span></span>
<span class="line"><span style="color:#9CDCFE;">        &quot;qualities&quot;</span><span style="color:#D4D4D4;">: [</span></span>
<span class="line"><span style="color:#D4D4D4;">            {</span></span>
<span class="line"><span style="color:#9CDCFE;">                &quot;type&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#B5CEA8;">3</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">                &quot;desc&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#CE9178;">&quot;无损音质&quot;</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">                &quot;size&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#B5CEA8;">34456494</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">                &quot;bps&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#CE9178;">&quot;&quot;</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">                &quot;tag&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#CE9178;">&quot;SQ&quot;</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">                &quot;require&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#B5CEA8;">1</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">                &quot;requiredesc&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#CE9178;">&quot;付费享受&quot;</span></span>
<span class="line"><span style="color:#D4D4D4;">            },</span></span>
<span class="line"><span style="color:#D4D4D4;">            {</span></span>
<span class="line"><span style="color:#9CDCFE;">                &quot;type&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#B5CEA8;">2</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">                &quot;desc&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#CE9178;">&quot;高品质&quot;</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">                &quot;size&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#B5CEA8;">10788682</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">                &quot;bps&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#CE9178;">&quot;320kbit/s&quot;</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">                &quot;tag&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#CE9178;">&quot;HQ&quot;</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">                &quot;require&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;requiredesc&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#CE9178;">&quot;&quot;</span></span>
<span class="line"><span style="color:#D4D4D4;">            },</span></span>
<span class="line"><span style="color:#D4D4D4;">            {</span></span>
<span class="line"><span style="color:#9CDCFE;">                &quot;type&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#B5CEA8;">1</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">                &quot;desc&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#CE9178;">&quot;标准&quot;</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">                &quot;size&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#B5CEA8;">6491973</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">                &quot;bps&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#CE9178;">&quot;192kbit/s&quot;</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">                &quot;tag&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#CE9178;">&quot;&quot;</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">                &quot;require&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;requiredesc&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#CE9178;">&quot;&quot;</span></span>
<span class="line"><span style="color:#D4D4D4;">            },</span></span>
<span class="line"><span style="color:#D4D4D4;">            {</span></span>
<span class="line"><span style="color:#9CDCFE;">                &quot;type&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;desc&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#CE9178;">&quot;流畅&quot;</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">                &quot;size&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#B5CEA8;">4343667</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">                &quot;bps&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#CE9178;">&quot;128kbit/s&quot;</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">                &quot;tag&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#CE9178;">&quot;&quot;</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">                &quot;require&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;requiredesc&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#CE9178;">&quot;&quot;</span></span>
<span class="line"><span style="color:#D4D4D4;">            }</span></span>
<span class="line"><span style="color:#D4D4D4;">        ],</span></span>
<span class="line"><span style="color:#9CDCFE;">        &quot;title&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#CE9178;">&quot;aLIEz&quot;</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">        &quot;cover&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#CE9178;">&quot;http://i0.hdslb.com/bfs/music/61d3f8cfdce14d2d1b006af59559c9bd22a2d21b.jpg&quot;</span></span>
<span class="line"><span style="color:#D4D4D4;">    }</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 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 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 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 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 class="line-number"></div><div class="line-number"></div></div></div></details><h2 id="音频流的获取" tabindex="-1"><a class="header-anchor" href="#音频流的获取"><span>音频流的获取</span></a></h2><p>将 <code>data.cdns[n]</code> 作为 URL 进行 GET 操作</p><p>需要验证请求头 <code>User-Agent</code> 不为空且不含敏感字串, 且 <code>Referer</code> 必须在 <code>.bilibili.com</code> 下</p><p><strong>示例:</strong></p><p>使用 cURL + FFPlay 直接从音频流播放</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:#569CD6;"> -G</span><span style="color:#CE9178;"> &quot;https://upos-sz-mirrorcos.bilivideo.com/ugaxcode/7bf6a3a3e94421ccc653f005457b1e8c-192k.m4a?e=ig8euxZM2rNcNbdlhoNvNC8BqJIzNbfqXBvEqxTEto8BTrNvN0GvT90W5JZMkX_YN0MvXg8gNEV4NC8xNEV4N03eN0B5tZlqNxTEto8BTrNvNeZVuJ10Kj_g2UB02J0mN0B5tZlqNCNEto8BTrNvNC7MTX502C8f2jmMQJ6mqF2fka1mqx6gqj0eN0B599M=&amp;uipk=5&amp;nbs=1&amp;deadline=1725013121&amp;gen=playurlv2&amp;os=cosbv&amp;oi=1823807031&amp;trid=1a4703f1e7344bb891691c5857e8cfb9B&amp;mid=0&amp;platform=pc&amp;og=cos&amp;upsig=e3a9fba59b46ab2720c8b1807844e9f3&amp;uparams=e,uipk,nbs,deadline,gen,os,oi,trid,mid,platform,og&amp;bvc=vod&amp;nettype=0&amp;orderid=0,1&amp;logo=00000000&quot;</span><span style="color:#D7BA7D;"> \\</span></span>
<span class="line"><span style="color:#D4D4D4;">--referer </span><span style="color:#CE9178;">&#39;https://www.bilibili.com/&#39;</span><span style="color:#569CD6;"> -A</span><span style="color:#CE9178;"> &#39;Mozilla/5.0&#39;</span><span style="color:#D7BA7D;"> \\</span></span>
<span class="line"><span style="color:#D4D4D4;">--output </span><span style="color:#CE9178;">-</span><span style="color:#D4D4D4;"> | </span><span style="color:#DCDCAA;">ffplay</span><span style="color:#CE9178;"> -</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>`,54)]))}const i=a(o,[["render",p]]),D=JSON.parse('{"path":"/docs/audio/musicstream_url.html","title":"音频流URL","lang":"zh-CN","frontmatter":{},"git":{"updatedTime":1726759053000,"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":1,"url":"https://github.com/SessionHu"}],"changelog":[{"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":"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/audio/musicstream_url.md"}');export{i as comp,D as data};
