import{_ as a,c as n,a0 as i,o as p}from"./chunks/framework.p2VkXzrt.js";const u=JSON.parse('{"title":"如何修改默认的8090端口","description":"","frontmatter":{"title":"如何修改默认的8090端口"},"headers":[],"relativePath":"issues/19.md","filePath":"issues/19.md","lastUpdated":null}'),e={name:"issues/19.md"};function t(l,s,o,c,h,d){return p(),n("div",null,s[0]||(s[0]=[i(`<h1 id="如何修改默认的8090端口" tabindex="-1">如何修改默认的8090端口 <a class="header-anchor" href="#如何修改默认的8090端口" aria-label="Permalink to &quot;如何修改默认的8090端口&quot;" target="_self">​</a></h1><p>docker-compose 修改映射端口会播放失败</p><div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>ports:</span></span>
<span class="line"><span>      - 80:8090</span></span></code></pre></div><p>从日志看继续调用了 <a href="http://10.0.0.4:8090" target="_self">http://10.0.0.4:8090</a> 而不是修改映射的80，还原成</p><div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>ports:</span></span>
<span class="line"><span>      - 8090:8090</span></span></code></pre></div><p>则一切正常</p><div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>xiaomusic    | [BiliBiliSearch] Playlist 安河桥北: Downloading 1 items of 1</span></span>
<span class="line"><span>xiaomusic    | [download] Downloading item 1 of 1</span></span>
<span class="line"><span>xiaomusic    | [BiliBili] Extracting URL: http://www.bilibili.com/video/av319943893</span></span>
<span class="line"><span>xiaomusic    | [BiliBili] 319943893: Downloading webpage</span></span>
<span class="line"><span>xiaomusic    | 10.0.0.118 - - [21/Feb/2024 15:29:24] &quot;POST /cmd HTTP/1.1&quot; 200 -</span></span>
<span class="line"><span>xiaomusic    | 10.0.0.118 - - [21/Feb/2024 15:29:24] &quot;POST /cmd HTTP/1.1&quot; 200 -</span></span>
<span class="line"><span>xiaomusic    | 10.0.0.118 - - [21/Feb/2024 15:29:24] &quot;POST /cmd HTTP/1.1&quot; 200 -</span></span>
<span class="line"><span>xiaomusic    | 10.0.0.118 - - [21/Feb/2024 15:29:24] &quot;POST /cmd HTTP/1.1&quot; 200 -</span></span>
<span class="line"><span>xiaomusic    | [BiliBili] BV1tw411X7Rr: Extracting videos in anthology</span></span>
<span class="line"><span>xiaomusic    | 10.0.0.118 - - [21/Feb/2024 15:29:24] &quot;POST /cmd HTTP/1.1&quot; 200 -</span></span>
<span class="line"><span>xiaomusic    | [BiliBili] 319943893: Extracting chapters</span></span>
<span class="line"><span>xiaomusic    | 10.0.0.118 - - [21/Feb/2024 15:29:24] &quot;POST /cmd HTTP/1.1&quot; 200 -</span></span>
<span class="line"><span>xiaomusic    | 10.0.0.118 - - [21/Feb/2024 15:29:24] &quot;POST /cmd HTTP/1.1&quot; 200 -</span></span>
<span class="line"><span>xiaomusic    | [BiliBili] Format(s) 1080P 高码率, 1080P 高清, 720P 高清, 4K 超清 are missing; you have to login or become premium member to download them. Use --cookies-from-browser or --cookies for the authentication. See  https://github.com/yt-dlp/yt-dlp/wiki/FAQ#how-do-i-pass-cookies-to-yt-dlp  for how to manually pass cookies</span></span>
<span class="line"><span>xiaomusic    | [info] BV1tw411X7Rr: Downloading 1 format(s): 30280</span></span>
<span class="line"><span>xiaomusic    | 10.0.0.118 - - [21/Feb/2024 15:29:24] &quot;POST /cmd HTTP/1.1&quot; 200 -</span></span>
<span class="line"><span>xiaomusic    | 10.0.0.118 - - [21/Feb/2024 15:29:24] &quot;POST /cmd HTTP/1.1&quot; 200 -</span></span>
<span class="line"><span>xiaomusic    | [download] Destination: music/安河桥北.m4a</span></span>
<span class="line"><span>[download]   0.3% of    5.61MiB at    6.24MiB/s ETA 00:0010.0.0.118 - - [21/Feb/2024 15:29:24] &quot;POST /cmd HTTP/1.1&quot; 200 -</span></span>
<span class="line"><span>[download]   0.5% of    5.61MiB at    2.42MiB/s ETA 00:0210.0.0.118 - - [21/Feb/2024 15:29:24] &quot;POST /cmd HTTP/1.1&quot; 200 -</span></span>
<span class="line"><span>[download]   1.1% of    5.61MiB at    1.50MiB/s ETA 00:0310.0.0.118 - - [21/Feb/2024 15:29:24] &quot;POST /cmd HTTP/1.1&quot; 200 -</span></span>
<span class="line"><span>[download]   4.4% of    5.61MiB at    2.35MiB/s ETA 00:0210.0.0.118 - - [21/Feb/2024 15:29:24] &quot;POST /cmd HTTP/1.1&quot; 200 -</span></span>
<span class="line"><span>[download]   8.9% of    5.61MiB at    3.59MiB/s ETA 00:0110.0.0.118 - - [21/Feb/2024 15:29:24] &quot;POST /cmd HTTP/1.1&quot; 200 -</span></span>
<span class="line"><span>[download] 100% of    5.61MiB in 00:00:00 at 10.83MiB/s  </span></span>
<span class="line"><span>xiaomusic    | [ExtractAudio] Destination: music/安河桥北.mp3</span></span>
<span class="line"><span>xiaomusic    | Deleting original file music/安河桥北.m4a (pass -k to keep)</span></span>
<span class="line"><span>xiaomusic    | [download] Finished downloading playlist: 安河桥北</span></span>
<span class="line"><span>xiaomusic    | [02/21/24 15:29:29] INFO     播放                               xiaomusic.py:461</span></span>
<span class="line"><span>xiaomusic    |                              http://10.0.0.4:8090/music/%E5%AE%                 </span></span>
<span class="line"><span>xiaomusic    |                              89%E6%B2%B3%E6%A1%A5%E5%8C%97.mp3                  </span></span>
<span class="line"><span>xiaomusic    |                     INFO     已经开始播放了                     xiaomusic.py:464</span></span>
<span class="line"><span>xiaomusic    |                     INFO     歌曲music/安河桥北.mp3的时长251秒  xiaomusic.py:371</span></span>
<span class="line"><span>xiaomusic    |                     INFO     251秒后将会播放下一首              xiaomusic.py:385</span></span>
<span class="line"><span>xiaomusic    |                     INFO     匹配到指令. opkey:set_volume#      xiaomusic.py:441</span></span>
<span class="line"><span>xiaomusic    |                              opvalue:set_volume oparg:24</span></span></code></pre></div><h2 id="评论" tabindex="-1">评论 <a class="header-anchor" href="#评论" aria-label="Permalink to &quot;评论&quot;" target="_self">​</a></h2><h3 id="评论-1-hanxi" tabindex="-1">评论 1 - hanxi <a class="header-anchor" href="#评论-1-hanxi" aria-label="Permalink to &quot;评论 1 - hanxi&quot;" target="_self">​</a></h3><p>需要添加环境变量</p><div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>environment:</span></span>
<span class="line"><span>    XIAOMUSIC_PORT:80</span></span>
<span class="line"><span>ports:</span></span>
<span class="line"><span>      - 80:80</span></span></code></pre></div><hr><h3 id="评论-2-newrookie001" tabindex="-1">评论 2 - newrookie001 <a class="header-anchor" href="#评论-2-newrookie001" aria-label="Permalink to &quot;评论 2 - newrookie001&quot;" target="_self">​</a></h3><blockquote><p>需要添加环境变量</p><div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>environment:</span></span>
<span class="line"><span>    XIAOMUSIC_PORT:80</span></span>
<span class="line"><span>ports:</span></span>
<span class="line"><span>      - 80:80</span></span></code></pre></div></blockquote><p>自己走了点弯路，半天才搞明白。补充说明：</p><blockquote><p>environment: XIAOMUSIC_PORT: 5678 #就是“5678”可以根据自己要求设置，但要求上下的5678都设置成一个 ports: - 5678:5678</p></blockquote><hr><h3 id="评论-3-hanxi" tabindex="-1">评论 3 - hanxi <a class="header-anchor" href="#评论-3-hanxi" aria-label="Permalink to &quot;评论 3 - hanxi&quot;" target="_self">​</a></h3><p>如果换端口，需要3个数字一致，比如</p><div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>environment:</span></span>
<span class="line"><span>    XIAOMUSIC_PORT:6874</span></span>
<span class="line"><span>ports:</span></span>
<span class="line"><span>      - 6874:6874</span></span></code></pre></div><hr><h3 id="评论-4-hanxi" tabindex="-1">评论 4 - hanxi <a class="header-anchor" href="#评论-4-hanxi" aria-label="Permalink to &quot;评论 4 - hanxi&quot;" target="_self">​</a></h3><p>文档类型的我都打开下，方便其他人看到。</p><hr><h3 id="评论-5-flymin" tabindex="-1">评论 5 - flymin <a class="header-anchor" href="#评论-5-flymin" aria-label="Permalink to &quot;评论 5 - flymin&quot;" target="_self">​</a></h3><p>docker-compose 中对应关系应该是</p><div class="language-yaml vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">yaml</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">ports</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">    - </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">aaaa:bbbb</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">environment</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">    XIAOMUSIC_PORT</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">bbbb</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">  # 配置文件中的 port，后台：监听端口(修改后需要重启)</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">    XIAOMUSIC_PUBLIC_PORT</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">aaaa</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> # 配置文件中的 public_port，后台：外网访问端口(0表示跟监听端口一致)</span></span></code></pre></div><p>以上，docker 环境中基本不存在需要修改 bbbb 的情况，也就是不用设置 XIAOMUSIC_PORT。如果需要修改端口，只需要修改两处 aaaa 如果使用反向代理，则转发 localhost:aaaa，XIAOMUSIC_PUBLIC_PORT 设置成代理的监听端口 cccc</p><p>另外，setting 文件存在会覆盖环境变量。启动过之后需要直接修改 settings.json 或者在后台修改</p><hr><p><a href="https://github.com/hanxi/xiaomusic/issues/19" target="_self">链接到 GitHub Issue</a></p>`,31)]))}const m=a(e,[["render",t]]);export{u as __pageData,m as default};
