1
0
mirror of https://github.com/hanxi/xiaomusic.git synced 2025-12-06 14:52:50 +08:00

Compare commits

...

88 Commits

Author SHA1 Message Date
涵曦
fd8455e592 bump: version 0.3.72 → 0.3.73 2025-01-16 21:28:17 +08:00
涵曦
85945c14d7 build: update static version 2025-01-16 21:28:17 +08:00
涵曦
0ac273f7c9 fix: 当前歌曲不在列表中时才切换列表 close #359 2025-01-16 14:23:23 +08:00
涵曦
56c5a267df fix: 修复默认主题播放进度时间问题 2025-01-16 11:48:48 +08:00
涵曦
e9253fed57 fix: 尝试修复获取对话记录失败的问题 close #362 2025-01-16 11:35:45 +08:00
Issues Docs [BOT]
a317337a01 Auto-Generate docs 🤖 2025-01-15 08:05:32 +00:00
Issues Docs [BOT]
e7c012870a Auto-Generate docs 🤖 2025-01-15 00:47:29 +00:00
Issues Docs [BOT]
fe02b9b4ad Auto-Generate docs 🤖 2025-01-14 17:01:14 +00:00
Issues Docs [BOT]
012513aca0 Auto-Generate docs 🤖 2025-01-14 10:45:58 +00:00
涵曦
8f1cc890a7 Update README.md 2025-01-14 18:44:35 +08:00
Issues Docs [BOT]
0e937892e7 Auto-Generate docs 🤖 2025-01-14 10:42:25 +00:00
Issues Docs [BOT]
996f0c6780 Auto-Generate docs 🤖 2025-01-14 01:13:57 +00:00
Issues Docs [BOT]
8468f41721 Auto-Generate docs 🤖 2025-01-11 06:20:27 +00:00
涵曦
7b555159b5 bump: version 0.3.71 → 0.3.72 2025-01-11 14:18:43 +08:00
涵曦
1520654a6d build: update static version 2025-01-11 14:18:43 +08:00
Issues Docs [BOT]
052f395b9d Auto-Generate docs 🤖 2025-01-11 03:40:40 +00:00
涵曦
ed33d94a6f Update index.md 2025-01-11 10:46:58 +08:00
Issues Docs [BOT]
cbb282acda Auto-Generate docs 🤖 2025-01-11 02:15:40 +00:00
Issues Docs [BOT]
81cd64c4d8 Auto-Generate docs 🤖 2025-01-11 01:41:15 +00:00
涵曦
dab4903487 fix: 修复默认主题没有单曲循环的问题 see #355 2025-01-11 09:29:17 +08:00
Issues Docs [BOT]
11c1ac4753 Auto-Generate docs 🤖 2025-01-10 05:59:10 +00:00
Issues Docs [BOT]
80bacdee0f Auto-Generate docs 🤖 2025-01-09 04:39:19 +00:00
Issues Docs [BOT]
867d16700c Auto-Generate docs 🤖 2025-01-08 05:09:29 +00:00
涵曦
1ca8955b94 feat: 新增播放文字功能 2025-01-08 12:56:52 +08:00
Issues Docs [BOT]
8f19b9b33b Auto-Generate docs 🤖 2025-01-07 14:23:55 +00:00
Issues Docs [BOT]
b88712d6b0 Auto-Generate docs 🤖 2025-01-07 07:57:13 +00:00
Issues Docs [BOT]
859c12f047 Auto-Generate docs 🤖 2025-01-07 06:21:59 +00:00
Issues Docs [BOT]
a0ec94e036 Auto-Generate docs 🤖 2025-01-07 00:58:18 +00:00
涵曦
bbc6c30557 bump: version 0.3.70 → 0.3.71 2025-01-07 08:55:37 +08:00
涵曦
4a61ff8074 build: update static version 2025-01-07 08:55:36 +08:00
涵曦
0a1b467507 style: 换个图标 2025-01-07 08:43:13 +08:00
涵曦
d244575d7b feat: 支持自动填 ip 和端口 2025-01-07 08:34:21 +08:00
Issues Docs [BOT]
a8161579b4 Auto-Generate docs 🤖 2025-01-06 14:32:24 +00:00
Issues Docs [BOT]
fac7816c64 Auto-Generate docs 🤖 2025-01-06 09:25:43 +00:00
涵曦
4adfc0e3b1 fix: 搜索歌曲窗口不自动关闭 see #351 2025-01-05 11:23:16 +08:00
涵曦
abe70b1146 fix: 解决歌词信息写入失败的问题 2025-01-05 10:52:55 +08:00
Issues Docs [BOT]
e47c6eaf9d Auto-Generate docs 🤖 2025-01-05 01:52:14 +00:00
涵曦
be636abaa0 fix: 修复一些小问题 2025-01-05 09:40:11 +08:00
涵曦
6b41b7b18e fix: 非播放中也返回歌曲时长 see #340 2025-01-05 07:44:01 +08:00
Issues Docs [BOT]
198963897e Auto-Generate docs 🤖 2025-01-04 11:18:15 +00:00
涵曦
2deab08351 bump: version 0.3.69 → 0.3.70 2025-01-04 19:16:07 +08:00
涵曦
7048e38e32 build: update static version 2025-01-04 19:16:07 +08:00
涵曦
dab756da7f Update ci.yml 2025-01-04 18:45:31 +08:00
涵曦
2cf883bcf4 ci: 调试 2025-01-04 18:22:19 +08:00
涵曦
f71b594a75 ci: 调试 2025-01-04 17:54:24 +08:00
涵曦
3a4d0b6c9b ci: 调试 2025-01-04 17:41:50 +08:00
Issues Docs [BOT]
3f8bae4568 Auto-Generate docs 🤖 2025-01-04 08:38:34 +00:00
涵曦
a4f21670bb ci: 调试 2025-01-04 15:44:47 +08:00
涵曦
fdc57d1b47 fix: 尝试修复部分设备无法启动的问题 2025-01-04 15:20:55 +08:00
Issues Docs [BOT]
0797f2ef3f Auto-Generate docs 🤖 2025-01-03 12:53:34 +00:00
涵曦
1da94f5730 Update README.md 2025-01-03 20:51:17 +08:00
涵曦
12427151f5 Update README.md 2025-01-03 20:49:43 +08:00
Issues Docs [BOT]
526193f0f6 Auto-Generate docs 🤖 2025-01-03 04:36:24 +00:00
涵曦
c9d0c8720a fix: 解决首页提示翻译英文问题 2025-01-02 21:39:14 +08:00
Issues Docs [BOT]
0bd661c98f Auto-Generate docs 🤖 2025-01-02 03:49:49 +00:00
涵曦
b9534d3a1f docs: 更新文档 2025-01-02 11:47:50 +08:00
Issues Docs [BOT]
27c6dd31fc Auto-Generate docs 🤖 2025-01-01 19:51:01 +00:00
涵曦
5906daade6 fix: 尝试解决 supervisor 启动报错 2025-01-02 03:38:16 +08:00
Issues Docs [BOT]
4c36d90ad2 Auto-Generate docs 🤖 2025-01-01 06:58:04 +00:00
涵曦
66905fae7e bump: version 0.3.68 → 0.3.69 2025-01-01 14:55:55 +08:00
涵曦
65e02540e8 build: update static version 2025-01-01 14:55:54 +08:00
涵曦
bf2d29790a feat: 支持关闭获取对话记录功能 2025-01-01 14:32:41 +08:00
涵曦
a28c65febf fix: 尝试解决网络卡顿问题 2025-01-01 14:18:03 +08:00
Issues Docs [BOT]
1cb01f43bf Auto-Generate docs 🤖 2024-12-31 15:21:41 +00:00
涵曦
62f90422bb Update README.md 2024-12-31 23:19:34 +08:00
Issues Docs [BOT]
402c417eeb Auto-Generate docs 🤖 2024-12-31 14:47:57 +00:00
涵曦
3899623a32 Update static.yml 2024-12-31 22:46:12 +08:00
涵曦
bdfcf43083 ci: 删除 pdm.lock 文件 2024-12-31 22:38:04 +08:00
涵曦
90e660165a Update static.yml 2024-12-31 22:19:17 +08:00
涵曦
a87c1fcbcf Update static.yml 2024-12-31 22:02:36 +08:00
涵曦
b880e861d4 Update static.yml 2024-12-31 20:46:39 +08:00
涵曦
33d6594029 Update static.yml 2024-12-31 20:23:00 +08:00
涵曦
33ca5138ee Update static.yml 2024-12-31 20:00:22 +08:00
涵曦
35d715526e Update static.yml 2024-12-31 19:56:00 +08:00
涵曦
be0687819d Update static.yml 2024-12-31 19:50:11 +08:00
涵曦
f5c4a6505f Update static.yml 2024-12-31 19:46:08 +08:00
涵曦
328cb03f8e bump: version 0.3.67 → 0.3.68 2024-12-31 19:19:47 +08:00
涵曦
a6742938eb build: update static version 2024-12-31 19:19:46 +08:00
涵曦
8f63bc181d feat: umami 脚本改为异步加载 2024-12-31 14:08:03 +08:00
涵曦
6bc3c46d00 feat: 支持 python3.13 版本 2024-12-31 13:04:49 +08:00
涵曦
f2f1f43b93 build: 修改镜像构建 2024-12-31 08:28:21 +08:00
涵曦
8435c10964 fix: 修复保存设置时可能出现报错的情况 2024-12-31 08:19:39 +08:00
Issues Docs [BOT]
ff54f11a4b Auto-Generate docs 🤖 2024-12-29 12:54:48 +00:00
Formatter [BOT]
e8b705e9d1 Auto-format code 🧹🌟🤖 2024-12-29 11:40:41 +00:00
AisukaYuki
2c3a95b98d feat: 增加均衡歌曲响度(可选) (#338)
可选下载和转换mp3时,是否均衡的歌曲响度,避免歌声忽大忽小。#336
2024-12-29 19:40:10 +08:00
Issues Docs [BOT]
52bce6af9d Auto-Generate docs 🤖 2024-12-29 10:09:55 +00:00
Issues Docs [BOT]
e5af13208a Auto-Generate docs 🤖 2024-12-29 03:57:48 +00:00
Issues Docs [BOT]
370f4ccd99 Auto-Generate docs 🤖 2024-12-29 02:20:56 +00:00
42 changed files with 749 additions and 1484 deletions

View File

@@ -25,7 +25,7 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
@@ -79,15 +79,15 @@ jobs:
- name: Test amd64 image
run: |
docker run --rm ${{ env.TEST_TAG }}-linux-amd64 /app/.venv/bin/python3 /app/xiaomusic.py -h
docker run --rm --entrypoint /bin/sh ${{ env.TEST_TAG }}-linux-amd64 -c "/app/.venv/bin/python3 /app/xiaomusic.py -h"
- name: Test arm64 image
run: |
docker run --rm ${{ env.TEST_TAG }}-linux-arm64 /app/.venv/bin/python3 /app/xiaomusic.py -h
docker run --rm --entrypoint /bin/sh ${{ env.TEST_TAG }}-linux-arm64 -c "/app/.venv/bin/python3 /app/xiaomusic.py -h"
- name: Test armv7 image
run: |
docker run --rm ${{ env.TEST_TAG }}-linux-arm-v7 /app/.venv/bin/python3 /app/xiaomusic.py -h
docker run --rm --entrypoint /bin/sh ${{ env.TEST_TAG }}-linux-arm-v7 -c "/app/.venv/bin/python3 /app/xiaomusic.py -h"
- name: Docker Hub Description
if: github.ref == 'refs/heads/main'
@@ -125,34 +125,37 @@ jobs:
- name: Package /app for amd64
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
run: |
docker run --rm -v $PWD:/workspace ${{ env.TEST_TAG }}-linux-amd64 tar czf /workspace/app-amd64.tar.gz -C / app
docker run --rm --entrypoint /bin/sh -v $PWD:/workspace ${{ env.TEST_TAG }}-linux-amd64 -c \
"tar czf /workspace/app-amd64.tar.gz -C / app"
- name: Package /app (lite) for amd64
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
run: |
docker run --rm -v $PWD:/workspace ${{ env.TEST_TAG }}-linux-amd64 bash -c \
docker run --rm --entrypoint /bin/sh -v $PWD:/workspace ${{ env.TEST_TAG }}-linux-amd64 -c \
"cd /app && tar --exclude='ffmpeg' -czf /workspace/app-amd64-lite.tar.gz .[!.]* *"
- name: Package /app for arm64
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
run: |
docker run --rm -v $PWD:/workspace ${{ env.TEST_TAG }}-linux-arm64 tar czf /workspace/app-arm64.tar.gz -C / app
docker run --rm --entrypoint /bin/sh -v $PWD:/workspace ${{ env.TEST_TAG }}-linux-arm64 -c \
"tar czf /workspace/app-arm64.tar.gz -C / app"
- name: Package /app (lite) for arm64
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
run: |
docker run --rm -v $PWD:/workspace ${{ env.TEST_TAG }}-linux-arm64 bash -c \
docker run --rm --entrypoint /bin/sh -v $PWD:/workspace ${{ env.TEST_TAG }}-linux-arm64 -c \
"cd /app && tar --exclude='ffmpeg' -czf /workspace/app-arm64-lite.tar.gz .[!.]* *"
- name: Package /app for arm/v7
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
run: |
docker run --rm -v $PWD:/workspace ${{ env.TEST_TAG }}-linux-arm-v7 tar czf /workspace/app-arm-v7.tar.gz -C / app
docker run --rm --entrypoint /bin/sh -v $PWD:/workspace ${{ env.TEST_TAG }}-linux-arm-v7 -c \
"tar czf /workspace/app-arm-v7.tar.gz -C / app"
- name: Package /app (lite) for arm/v7
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
run: |
docker run --rm -v $PWD:/workspace ${{ env.TEST_TAG }}-linux-arm-v7 bash -c \
docker run --rm --entrypoint /bin/sh -v $PWD:/workspace ${{ env.TEST_TAG }}-linux-arm-v7 -c \
"cd /app && tar --exclude='ffmpeg' -czf /workspace/app-arm-v7-lite.tar.gz .[!.]* *"
- name: Publish to Docker Hub main

View File

@@ -18,6 +18,12 @@ on:
types:
- uploaded
workflow_run:
workflows:
- CI Workflow
types:
- completed
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
@@ -64,8 +70,10 @@ jobs:
npm run docs:build
- uses: pdm-project/setup-pdm@v3
- name: Install dependencies
run: pdm install
- name: pdm
run: pdm install --prod --frozen-lockfile
- name: generate versions.json
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

4
.gitignore vendored
View File

@@ -103,7 +103,7 @@ ipython_config.py
# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
@@ -169,5 +169,5 @@ setting.json
.DS_Store
cache
tmp/
xiaomusic.log.txt
xiaomusic.log.txt*
node_modules

View File

@@ -1,3 +1,64 @@
## v0.3.73 (2025-01-16)
### Fix
- 当前歌曲不在列表中时才切换列表 close #359
- 修复默认主题播放进度时间问题
- 尝试修复获取对话记录失败的问题 close #362
## v0.3.72 (2025-01-11)
### Feat
- 新增播放文字功能
### Fix
- 修复默认主题没有单曲循环的问题 see #355
## v0.3.71 (2025-01-07)
### Feat
- 支持自动填 ip 和端口
### Fix
- 搜索歌曲窗口不自动关闭 see #351
- 解决歌词信息写入失败的问题
- 修复一些小问题
- 非播放中也返回歌曲时长 see #340
## v0.3.70 (2025-01-04)
### Fix
- 尝试修复部分设备无法启动的问题
- 解决首页提示翻译英文问题
- 尝试解决 supervisor 启动报错
## v0.3.69 (2025-01-01)
### Feat
- 支持关闭获取对话记录功能
### Fix
- 尝试解决网络卡顿问题
## v0.3.68 (2024-12-31)
### Feat
- umami 脚本改为异步加载
- 支持 python3.13 版本
- 增加均衡歌曲响度(可选) (#338)
### Fix
- 修复保存设置时可能出现报错的情况
## v0.3.67 (2024-12-29)
### Feat

View File

@@ -18,7 +18,8 @@ COPY --from=builder /app/xiaomusic.py .
COPY --from=builder /app/xiaomusic/__init__.py /base_version.py
RUN touch /app/.dockerenv
COPY supervisor.conf /etc/supervisor.conf
COPY supervisord.conf /etc/supervisor/supervisord.conf
RUN rm -f /var/run/supervisor.sock
VOLUME /app/conf
VOLUME /app/music
@@ -26,4 +27,4 @@ EXPOSE 8090
ENV TZ=Asia/Shanghai
ENV PATH=/app/.venv/bin:$PATH
CMD ["/bin/sh", "-c", "/usr/bin/supervisord -c /etc/supervisor.conf && tail -F /app/supervisord.log /app/xiaomusic.log.txt"]
ENTRYPOINT ["/bin/sh", "-c", "/usr/bin/supervisord -c /etc/supervisor/supervisord.conf && tail -F /app/supervisord.log /app/xiaomusic.log.txt"]

View File

@@ -28,7 +28,7 @@ docker run -p 58090:8090 -e XIAOMUSIC_PUBLIC_PORT=58090 -v /xiaomusic_music:/app
🔥 国内:
```bash
docker run -p 58090:8090 -e XIAOMUSIC_PUBLIC_PORT=58090 -v /xiaomusic_music:/app/music -v /xiaomusic_conf:/app/conf m.daocloud.io/docker.io/hanxi/xiaomusic
docker run -p 58090:8090 -e XIAOMUSIC_PUBLIC_PORT=58090 -v /xiaomusic_music:/app/music -v /xiaomusic_conf:/app/conf docker.hanxi.cc/hanxi/xiaomusic
```
对应的 docker compose 配置如下:
@@ -53,7 +53,7 @@ services:
```yaml
services:
xiaomusic:
image: m.daocloud.io/docker.io/hanxi/xiaomusic
image: docker.hanxi.cc/hanxi/xiaomusic
container_name: xiaomusic
restart: unless-stopped
ports:
@@ -66,7 +66,8 @@ services:
```
- 其中 conf 目录为配置文件存放目录music 目录为音乐存放目录,建议分开配置为不同的目录。
- /xiaomusic_music 和 /xiaomusic_conf 是 docker 主机的目录,可以修改为其他目录。如果报错找不到 /xiaomusic_music 目录,可以先执行 `mkdir -p /xiaomusic_{music,conf}` 命令新建目录。
- /xiaomusic_music 和 /xiaomusic_conf 是 docker 所在的主机的目录,可以修改为其他目录。如果报错找不到 /xiaomusic_music 目录,可以先执行 `mkdir -p /xiaomusic_{music,conf}` 命令新建目录。
- /app/music 和 /app/conf 是 docker 容器里的目录,不要去修改。
- XIAOMUSIC_PUBLIC_PORT 是用来配置 NAS 本地端口的。8090 是容器端口,不要去修改。
- 后台访问地址为: http://NAS_IP:58090
@@ -80,6 +81,7 @@ services:
> [!TIP]
> 海外 RackNerd VPS 机器推荐,可支付宝付款。
>
> - [🔥1 GB KVM VPS $11.29/年](https://my.racknerd.com/aff.php?aff=1177&pid=903)
> - [2 GB KVM VPS](https://my.racknerd.com/aff.php?aff=1177&pid=904)
> - [3.5 GB KVM VPS](https://my.racknerd.com/aff.php?aff=1177&pid=905)
@@ -119,7 +121,7 @@ services:
\ / | | / _` | / _ \ | |\/| | | | | | / __| | | / __|
/ \ | | | (_| | | (_) | | | | | | |_| | \__ \ | | | (__
/_/\_\ |_| \__,_| \___/ |_| |_| \__,_| |___/ |_| \___|
XiaoMusic v0.3.65 by: github.com/hanxi
XiaoMusic v0.3.69 by: github.com/hanxi
usage: xiaomusic [-h] [--port PORT] [--hardware HARDWARE] [--account ACCOUNT]
[--password PASSWORD] [--cookie COOKIE] [--verbose]
@@ -247,7 +249,8 @@ docker build -t xiaomusic .
## 📢 讨论区
- [点击链接加入QQ频道【xiaomusic】](https://pd.qq.com/s/e2jybz0ss)
- [点击链接加入群聊【xiaomusic】 604526973](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=13St5PLVcTxYlWTAs_iAawazjtdD1l-a&authKey=dJWEpaT2fDBDpdUUOWj%2FLt6NS1ePBfShDfz7a6seNURi05VvVnAGQzXF%2FM%2F5HgIm&noverify=0&group_code=604526973)
- [点击链接加入群聊【xiaomusic官方交流群1(小爱音箱)】 604526973](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=13St5PLVcTxYlWTAs_iAawazjtdD1l-a&authKey=dJWEpaT2fDBDpdUUOWj%2FLt6NS1ePBfShDfz7a6seNURi05VvVnAGQzXF%2FM%2F5HgIm&noverify=0&group_code=604526973)
- [点击链接加入群聊【xiaomusic官方交流群2(小爱音箱)】1021062499](https://qm.qq.com/q/BmVNqhDL3M)
- <https://github.com/hanxi/xiaomusic/issues>
- [微信群二维码](https://github.com/hanxi/xiaomusic/issues/86)

View File

@@ -11,8 +11,8 @@ hero:
text: 快速开始
link: /issues/index
- theme: alt
text: 文档汇总
link: /issues/211
text: FAQ
link: /issues/99
- theme: alt
text: GitHub
link: https://github.com/hanxi/xiaomusic

View File

@@ -11,6 +11,7 @@ title: 📝 文档汇总
- [如何配置网络歌单](/issues/78.html)
- [如何添加m3u格式文件的电台](/issues/88.html)
- [xiaomusic极空间安装教程](/issues/297.html)
- [docker compose 命令行安装教程 ](/issues/360.html)
## 2⃣ 进阶文档
@@ -108,5 +109,28 @@ mi.com官网重新登陆。
可以分别部署到两个不同的容器里,两个应用的唤醒词是不同的,不会互相干扰。
---
### 评论 9 - Tranceboox
如果网页端主页内能显示播放曲目的封面就太牛了,我知道实现起来很难,就是臆想一下
---
### 评论 10 - hanxi
> 如果网页端主页内能显示播放曲目的封面就太牛了,我知道实现起来很难,就是臆想一下
xplayer 和 pure 主题就可以,你试试。
---
### 评论 11 - aries0311
Pure主题中设备列表中只有本机不显示小米音箱
![01](https://gproxy.hanxi.cc/proxy/user-attachments/assets/ca231b5f-ee4f-430b-a2b3-aca5aa395081)
![02](https://gproxy.hanxi.cc/proxy/user-attachments/assets/a3a83d1f-a822-42d0-bea9-b88bb1f5fd76)
---
[链接到 GitHub Issue](https://github.com/hanxi/xiaomusic/issues/211)

View File

@@ -19,5 +19,66 @@ title: xiaomusic立体声
我这边先用一个音箱播放,然后米家里设置全屋播放,就能多个音箱同时播了,进度也同步,而且后续会自动全屋播放
---
### 评论 3 - zazhi4
我遇到双音箱播放问题,没法立体声,没法全屋播放,详述如下:
1、基本情况原有小爱音箱ProLX06用xiaomusic0.3.69版本播放正常。看到issue里提及了立体声打算尝试新购了小爱音箱,L06A。将新音箱通过米家APP加入到自家的wifi里。
2、尝试
2.1在xiaomusic里默认面板设置发现可以在小爱音箱设置面板里有两个音箱供选择我都勾选了在设备分组配置里两个音箱的did输入配为1个组能实现同时驱动两个音箱发声但是不同步时间上差了不到1秒钟但是听起来不舒服。
2.2 在xiaomusic里默认面板设置只勾选1个音箱设备分组配置里删除原先配置清空。播放只有一只音箱有声音。然后回到米家APP。将两个音箱设置组成立体声。完成后依然只有一只音箱有声音。设置后对播放没有影响。
2.3 在米家APP中取消立体声配对改为“全屋播放”。设置好后依然只有一只音箱有声音。换言之设置后对播放没有影响。
3、检查版本在小米音箱app中检查两只音箱的版本均为最新稳定版。
![1736217346124](https://gproxy.hanxi.cc/proxy/user-attachments/assets/1fa61ded-0044-4577-8b3f-76d03bfe2453)
![1736217346117](https://gproxy.hanxi.cc/proxy/user-attachments/assets/ad3d13ea-0070-4fee-a2d8-814242efd9f8)
![1736217346120](https://gproxy.hanxi.cc/proxy/user-attachments/assets/6b43db2f-80fd-4aa7-97c7-3edaee304a5f)
![1736217346108](https://gproxy.hanxi.cc/proxy/user-attachments/assets/a274b712-d15b-4e6f-b036-c16e291b841f)
![1736217346113](https://gproxy.hanxi.cc/proxy/user-attachments/assets/194deb50-c0f6-4c09-a241-ab2360301c51)
![1736217346103](https://gproxy.hanxi.cc/proxy/user-attachments/assets/675e53fb-2f33-4c9f-9db2-39a969d549bf)
---
### 评论 4 - zazhi4
再补充一点信息,我做的尝试,以及网上都到的信息。
1、配立体声配好以后我用了当前页面的“立体声音效测试”两个音箱都能发声声音有先后有不同有联系形成了立体声效果。
2、配立体声配好以后还在米家app用qq音乐放了一首歌两个音箱都能发声有立体声效果。
3、网上查询一些信息均表明只有qq或其他在米家里播放的换言之网络来的信息通过米家向音箱播音能实现立体声。其他方法比如蓝牙或AUX都没法实现立体声。推测是米家主动发音的时候内部拆解了左右声道的声音发往左右音箱。
4、原本猜想两个音箱会一主一从主音箱拆分声音发往从音箱。但是在米家APP里配置立体声时未发现主从之分。
---
### 评论 5 - hanxi
全屋播放,控制两个音箱中的任意一个都不行吗?
---
### 评论 6 - zazhi4
全屋播放设置音箱A设置界面只选A当然只能选一个。共有3个选项音箱A音箱B手机播放音箱B没声音设置音箱B播放音箱A没声音。
---
### 评论 7 - Bazinga-git
组立体声是刚需,大佬加油
---
### 评论 8 - zazhi4
立体声想了几个路径1xiaomusic能不能拆分声音为左右两个声道分别发往两个音箱难题在于怎么保证两个音箱同时接到信息发声2能不能搞定米家app的接口发送声音给米家app由米家app发给音箱3或是搞定模拟米家app与音箱的接口通过米家接口发给音箱让音箱以为声音来自米家app。方法23要搞清楚米家app播音为什么能实现立体声然后在方法2,3中选一个方向。
---
### 评论 9 - hanxi
@zazhi4 思路是对的,感兴趣可以抓包玩玩的。目前协议是没加密的。
---
[链接到 GitHub Issue](https://github.com/hanxi/xiaomusic/issues/235)

View File

@@ -23,10 +23,10 @@ title: 相关工具推荐
### 截图
<p>
<img src="https://assets-1251785959.cos.ap-beijing.myqcloud.com/xiaoplayer/screenshot/1.jpg" width="24%" />
<img src="https://assets-1251785959.cos.ap-beijing.myqcloud.com/xiaoplayer/screenshot/2.jpg" width="24%" />
<img src="https://assets-1251785959.cos.ap-beijing.myqcloud.com/xiaoplayer/screenshot/4.jpg" width="24%" />
<img src="https://assets-1251785959.cos.ap-beijing.myqcloud.com/xiaoplayer/screenshot/3.jpg" width="24%" />
<img src="https://assets-1251785959.cos.ap-beijing.myqcloud.com/xiaoplayer/screenshot/5.png" width="24%" />
<img src="https://assets-1251785959.cos.ap-beijing.myqcloud.com/xiaoplayer/screenshot/6.png" width="24%" />
<img src="https://assets-1251785959.cos.ap-beijing.myqcloud.com/xiaoplayer/screenshot/7.png" width="24%" />
<img src="https://assets-1251785959.cos.ap-beijing.myqcloud.com/xiaoplayer/screenshot/8.png" width="24%" />
</p>
---

View File

@@ -244,7 +244,21 @@ an'zh
要注意看提示:
装载路径中的 配置文件目录 和 音乐目录 必须进行配置。
其他的路径非必要不要配置,主题目录路径是方便开发调试的时候用的,普通用户不要映射主题目录
其他的路径非必要不要配置,主题目录路径是方便开发调试的时候用的,普通用户不要映射主题目录。我已经把这个提示更新到文档中了
---
### 评论 14 - zxhans
就不能让xiaomusic支持服务器部署吗服务器部署为啥设备不能读取呢home assistant 通过xiaomi home assistant都可以读取呀
---
### 评论 15 - hanxi
> 就不能让xiaomusic支持服务器部署吗服务器部署为啥设备不能读取呢home assistant 通过xiaomi home assistant都可以读取呀
支持服务器部署的,你需要在服务器上装个浏览器登陆过风控。
---
[链接到 GitHub Issue](https://github.com/hanxi/xiaomusic/issues/297)

29
docs/issues/350.md Normal file
View File

@@ -0,0 +1,29 @@
---
title: 播放本地歌曲无法切歌
---
# 播放本地歌曲无法切歌
播放本地歌曲时通过语音控制小爱音箱切歌测试指令小爱同学切歌小爱同学播放下一首每次都是重新播放上一首歌曲版本为docker最新版本[0.3.70]
## 评论
### 评论 1 - Leenshady
测试出来了,只有“小爱同学,下一首”指令才能正常切歌
---
### 评论 2 - sam0773
可以在conf文件夹的setting.json中把自己习惯的命令添加进去...
---
### 评论 3 - hanxi
楼上正解。
---
[链接到 GitHub Issue](https://github.com/hanxi/xiaomusic/issues/350)

74
docs/issues/360.md Normal file
View File

@@ -0,0 +1,74 @@
---
title: docker compose 命令行安装教程
---
# docker compose 命令行安装教程
本教程针对于有命令行环境,且已经安装好 docker compose 的用户。步骤超级简单,基本只要复制粘贴就能跑起来。如果需要修改路径或者端口,可以复制到编辑器,修改后再复制粘贴到命令行执行。编辑时注意不要修改到文件格式,包括缩进。
## 创建 docker-compose.yml 文件
假设 `docker-compose.yml` 文件的存放到路径为 `/xiaomusic/docker-compose.yml` 。执行下面的命令即可:
```shell
mkdir -p /xiaomusic
cat <<EOF > /xiaomusic/docker-compose.yml
services:
xiaomusic:
image: docker.hanxi.cc/hanxi/xiaomusic
container_name: xiaomusic
restart: unless-stopped
ports:
- 58090:8090
environment:
XIAOMUSIC_PUBLIC_PORT: 58090
volumes:
- /xiaomusic_conf:/app/conf
- /xiaomusic_music:/app/music
EOF
```
- `/xiaomusic_conf` 为配置文件存放目录,一般不需要修改。
- `/xiaomusic_music` 为音乐存放目录,你可以替换为自己想要存放的目录,注意填绝对路径,在 Linux 下是 `/` 开头的,在 Windows 下是盘符开头,比如: `D:/music`
- 端口 8090 不要修改,是容器内的端口。
- 端口 58090 可以修改,如果想要修改,两个 58090 都需要同时修改,这个端口是访问 web 后台的端口。
## 启动
```shell
cd /xiaomusic
docker compose up -d
```
启动后,就能使用 <http://nasip:58090> 来访问 web 后台了,把 nasip 替换成你的 nas 的 IP 。
## 后台设置
![image](https://gproxy.hanxi.cc/proxy/user-attachments/assets/424c45af-6937-4fee-bb7d-855973ef0d5d)
填好账号密码,和自动填 IP 和端口,然后滚动到页面最下面,点击保存按钮。然后刷新设置页面,再勾选小爱音箱,再保存即可。
![image](https://gproxy.hanxi.cc/proxy/user-attachments/assets/c63c3ff1-3a80-4f47-971e-761eb9187ae0)
## 更新
想要更新镜像,只需要复制粘贴下面的命令就行,注意 `/xiaomusic` 目录是 `docker-compose.yml` 文件所在的目录。
```shell
cd /xiaomusic
docker compose pull
docker compose up -d
```
## 关闭
```shell
cd /xiaomusic
docker compose down
```
## 评论
没有评论。
[链接到 GitHub Issue](https://github.com/hanxi/xiaomusic/issues/360)

View File

@@ -4,7 +4,12 @@ title: 微信交流群二维码
# 微信交流群二维码
![mmqrcode1734721614705](https://gproxy.hanxi.cc/proxy/user-attachments/assets/4113e68b-17a8-4067-ba89-e809b3ae817b)
![mmqrcode1736901915117](https://gproxy.hanxi.cc/proxy/user-attachments/assets/ed9fc90c-5b25-4d59-9dfc-91756e45f5ac)
如果你刚好在买流量卡,可以在我的微信卡店里看看有没有合适的。
![mmexportc6bd050862507d2806a2da710a82cb28_1735878113870](https://gproxy.hanxi.cc/proxy/user-attachments/assets/ca5a86e0-f753-42d3-8dcb-8583d50d64aa)
## 评论

View File

@@ -102,6 +102,7 @@ services:
volumes:
- /data/music1:/app/music/music1
- /data/music2:/app/music/music2
- /data/download:/app/music/download
- /data/xiaomusic/conf:/app/conf
```
@@ -122,6 +123,7 @@ services:
volumes:
- /data/music1:/app/music/歌曲目录1
- /data/music2:/app/music/歌曲目录2
- /data/download:/app/music/download
- /data/xiaomusic/conf:/app/conf
```
@@ -149,7 +151,42 @@ Exception: Error https://api2.mina.mi.com/remote/ubus: {"code":601,"message":"il
## ❓ 为什么会先说小爱音箱自带的回答,再说下载中或者过一会儿才播放本地歌曲
设计原理就是每秒不停的抓取对话记录,然后再打断小爱音箱自带的处理流程。整个过程下来会有延时,所以打断不会很及时,做不到无缝衔接。
设计原理就是每秒不停的抓取对话记录,然后再打断小爱音箱自带的处理流程。整个过程下来会有延时,所以打断不会很及时,做不到无缝衔接。
## ❓ 云服务器上能否安装
可以安装,登录 mi.com 这个步骤可以使用终端里的浏览器 [carbonyl](https://github.com/fathyb/carbonyl) 来操作:
```shell
docker run --rm -ti fathyb/carbonyl https://mi.com
```
或者使用 [browsh](https://github.com/browsh-org/browsh)
```shell
docker run --rm -it browsh/browsh --startup-url https://mi.com
```
## 在播放歌曲时,问小爱查询天气,小爱查询天气时,中途会断掉。
播放中会被xiaomusic接管会跟原有功能冲突需要先说关机来关闭xiaomusic的功能再问小爱查询天气。
## 我家有个奇怪的问题,你给它暂停了,它过一会儿又自己开始唱了,不勘其扰。小爱重启都没用。
要说【关机】才能关掉 xiaomusic ,否则下一曲定时器到了会继续播放下一曲。
## 为什么播放进度条不能拖动
没有接口,目前做不到。
## 本机有声音,小爱音箱没声音,请问什么原因?
排查步骤:
1. 测试链接是否能播放,能播放说明小爱音箱控制没问题,继续下一步排查。不能播放说明控制不了你的小爱音箱,一般是【型号兼容模式】设置问题。
3. 小爱音箱和 NAS 是否在同一个局域网,检查 NAS 的 IP 和音箱的 IP 是否在同一个网段,不在同一个网段会导致音箱无法访问到 NAS 。如果在同一个局域网,检查 NAS 上的防火墙配置,关闭防火墙再测试,如果还是不行就继续下一步。
4. 查看容器日志中的歌曲链接是否正常,点击后台页面上的播放歌曲时,容器中会有歌曲链接,一般是 http 开头的链接,复制完整链接到浏览器试试看能否打开,能打开说明网络没问题,继续下一步排查。不能打开有可能是 ip 和端口配置错误,请使用设置页面的自动填按钮自动填 ip 和端口。
5. 歌曲文件格式是否是 mp3 格式,有些型号无法播放 flac 格式的歌曲,请使用 mp3 格式的歌曲文件测试,一个不行就多找几个文件测试。
## 评论
@@ -1103,258 +1140,142 @@ You are receiving this because you commented.Message ID: ***@***.***&gt;
---
### 评论 72 - duming215
### 评论 72 - zjzj52
网页后台可以播放,语音控制一直抽风,可以识别下载歌曲,但是不能执行其他命令。而且歌曲经常放到一半多就切歌了。。。
语音命令都是严格按关键词来说的。大佬帮忙看看
Traceback (most recent call last):
File "/app/xiaomusic/analytics.py", line 104, in post_to_umami
async with session.post(url, json=data, headers=headers) as response:
File "/app/.venv/lib/python3.10/site-packages/aiohttp/client.py", line 1425, in __aenter__
self._resp: _RetType = await self._coro
File "/app/.venv/lib/python3.10/site-packages/aiohttp/client.py", line 703, in _request
conn = await self._connector.connect(
File "/app/.venv/lib/python3.10/site-packages/aiohttp/connector.py", line 548, in connect
proto = await self._create_connection(req, traces, timeout)
File "/app/.venv/lib/python3.10/site-packages/aiohttp/connector.py", line 1056, in _create_connection
_, proto = await self._create_direct_connection(req, traces, timeout)
File "/app/.venv/lib/python3.10/site-packages/aiohttp/connector.py", line 1400, in _create_direct_connection
raise last_exc
File "/app/.venv/lib/python3.10/site-packages/aiohttp/connector.py", line 1369, in _create_direct_connection
transp, proto = await self._wrap_create_connection(
File "/app/.venv/lib/python3.10/site-packages/aiohttp/connector.py", line 1130, in _wrap_create_connection
raise client_error(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host umami.hanxi.cc:443 ssl:default [Connection reset by peer]
[2024-12-20 15:39:58] [0.3.61] [INFO] analytics.py:73: analytics run_with_cancel success
[2024-12-20 15:39:58] [0.3.61] [INFO] xiaomusic.py:2012: cancel_next_timer
[2024-12-20 15:39:58] [0.3.61] [INFO] xiaomusic.py:2018: 下一曲定时器不见了
[2024-12-20 15:39:58] [0.3.61] [INFO] xiaomusic.py:1936: 321 秒后将会播放下一首歌曲
[2024-12-20 15:39:58] [0.3.61] [INFO] xiaomusic.py:1307: save_cur_config ok
[15:40:29] [0.3.61] [INFO] 192.168.0.67:8041 - "GET /playingmusic?did=108581258 HTTP/1.1" 200
[15:41:29] [0.3.61] [INFO] 192.168.0.67:8092 - "GET /playingmusic?did=108581258 HTTP/1.1" 200
[15:42:29] [0.3.61] [INFO] 192.168.0.67:8164 - "GET /playingmusic?did=108581258 HTTP/1.1" 200
[2024-12-20 15:43:07] [0.3.61] [INFO] xiaomusic.py:797: 收到消息:播放歌曲ARE YOU OK 控制面板:False did:108581258
[2024-12-20 15:43:07] [0.3.61] [INFO] xiaomusic.py:893: 匹配到指令. opkey:播放歌曲 opvalue:play oparg:ARE YOU OK
[2024-12-20 15:43:07] [0.3.61] [INFO] xiaomusic.py:1465: play. search_key:ARE YOU OK name:ARE YOU OK
[2024-12-20 15:43:07] [0.3.61] [INFO] xiaomusic.py:932: 没找到歌曲【ARE YOU OK】
[2024-12-20 15:43:07] [0.3.61] [INFO] xiaomusic.py:1718: download cmd: yt-dlp bilisearch:ARE YOU OK -x --audio-format mp3 --audio-quality 0 --paths music/download -o ARE YOU OK.mp3 --ffmpeg-location ./ffmpeg/bin --no-playlist
[2024-12-20 15:43:07] [0.3.61] [INFO] xiaomusic.py:1627: try do_tts value:正在下载歌曲ARE YOU OK
[2024-12-20 15:43:12] [0.3.61] [INFO] xiaomusic.py:1638: do_tts ok. cur_music:周杰伦的晴天
[2024-12-20 15:43:12] [0.3.61] [INFO] xiaomusic.py:1683: Download Process is still running.
[2024-12-20 15:43:12] [0.3.61] [INFO] xiaomusic.py:1683: Download Process is still running.
[2024-12-20 15:43:12] [0.3.61] [INFO] xiaomusic.py:1739: 不会继续播放歌曲. isplaying:True isdownloading:True
[2024-12-20 15:43:12] [0.3.61] [INFO] xiaomusic.py:1721: 正在下载中 ARE YOU OK ARE YOU OK
[2024-12-20 15:43:18] [0.3.61] [INFO] xiaomusic.py:558: 已从【cache/tag_cache.json】加载 tag cache
[2024-12-20 15:43:18] [0.3.61] [INFO] xiaomusic.py:599: ignore_tag_absolute_dirs: []
[2024-12-20 15:43:18] [0.3.61] [INFO] xiaomusic.py:572: 保存tag cache 已保存到【cache/tag_cache.json】
[2024-12-20 15:43:18] [0.3.61] [INFO] xiaomusic.py:627: tag 更新完成
[2024-12-20 15:43:18] [0.3.61] [INFO] xiaomusic.py:1755: add_download_music add_music ARE YOU OK
[2024-12-20 15:43:18] [0.3.61] [INFO] xiaomusic.py:2022: cancel_group_next_timer {'108581258': <xiaomusic.xiaomusic.XiaoMusicDevice object at 0x7f31cc6c3610>}
[2024-12-20 15:43:18] [0.3.61] [INFO] xiaomusic.py:2012: cancel_next_timer
[2024-12-20 15:43:18] [0.3.61] [INFO] xiaomusic.py:2015: 下一曲定时器已取消 9fcc3636-3b8e-4309-a430-7eb8978d94f4
[2024-12-20 15:43:18] [0.3.61] [INFO] xiaomusic.py:1589: cur_music ARE YOU OK
[2024-12-20 15:43:18] [0.3.61] [INFO] xiaomusic.py:414: try get_filename. filename:music/download/ARE YOU OK.mp3
[2024-12-20 15:43:18] [0.3.61] [INFO] xiaomusic.py:524: get_music_url local music. name:ARE YOU OK, filename:download/ARE YOU OK.mp3
[2024-12-20 15:43:18] [0.3.61] [INFO] xiaomusic.py:445: get_music_sec_url. name:ARE YOU OK url:http://192.168.0.3:8090/music/download/ARE%20YOU%20OK.mp3
[2024-12-20 15:43:18] [0.3.61] [INFO] xiaomusic.py:414: try get_filename. filename:music/download/ARE YOU OK.mp3
[2024-12-20 15:43:18] [0.3.61] [INFO] xiaomusic.py:459: get_music_sec_url. name:ARE YOU OK filename:music/download/ARE YOU OK.mp3
[2024-12-20 15:43:18] [0.3.61] [INFO] xiaomusic.py:464: 本地歌曲 ARE YOU OK : music/download/ARE YOU OK.mp3 http://192.168.0.3:8090/music/download/ARE%20YOU%20OK.mp3 的时长 133 秒
[2024-12-20 15:43:18] [0.3.61] [INFO] xiaomusic.py:1989: group_force_stop_xiaoai ['9fcc3636-3b8e-4309-a430-7eb8978d94f4']
[2024-12-20 15:43:18] [0.3.61] [INFO] xiaomusic.py:1644: force_stop_xiaoai player_pause device_id:9fcc3636-3b8e-4309-a430-7eb8978d94f4 ret:{'code': 0, 'message': "Msg has been successfully proxy to the device, this service is a simple proxy, if you encounter any problems pls contact ROM's developers directly!!!", 'data': {'code': 0}}
[2024-12-20 15:43:18] [0.3.61] [INFO] xiaomusic.py:1655: {'code': 0, 'message': "Msg has been successfully proxy to the device, this service is a simple proxy, if you encounter any problems pls contact ROM's developers directly!!!", 'data': {'code': 0, 'info': '{ "status": 2, "volume": 50, "loop_type": 1, "media_type": 3, "play_song_detail": { "audio_id": "507951590732817", "position": 8680, "duration": 60029 }, "track_list": [ "545606553022895", "176123395447980141", "525480908570653", "507951590732817", "681644918463361", "383285527150302", "1972115018265658007", "658913158921230", "519182249840274", "595248376347937" ] }'}}
[2024-12-20 15:43:18] [0.3.61] [INFO] xiaomusic.py:1992: group_force_stop_xiaoai ['9fcc3636-3b8e-4309-a430-7eb8978d94f4'] [None]
[2024-12-20 15:43:18] [0.3.61] [INFO] xiaomusic.py:1592: 播放 http://192.168.0.3:8090/music/download/ARE%20YOU%20OK.mp3
[15:43:18] [0.3.61] [INFO] 192.168.0.11:33301 - "GET /music/download/ARE%20YOU%20OK.mp3 HTTP/1.1" 206
[2024-12-20 15:43:18] [0.3.61] [INFO] xiaomusic.py:1871: play_one_url play_by_url device_id:9fcc3636-3b8e-4309-a430-7eb8978d94f4 ret:{'code': 0, 'message': "Msg has been successfully proxy to the device, this service is a simple proxy, if you encounter any problems pls contact ROM's developers directly!!!", 'data': {'code': 0}} url:http://192.168.0.3:8090/music/download/ARE%20YOU%20OK.mp3
[2024-12-20 15:43:18] [0.3.61] [INFO] xiaomusic.py:1846: group_player_play http://192.168.0.3:8090/music/download/ARE%20YOU%20OK.mp3 ['9fcc3636-3b8e-4309-a430-7eb8978d94f4'] [{'code': 0, 'message': "Msg has been successfully proxy to the device, this service is a simple proxy, if you encounter any problems pls contact ROM's developers directly!!!", 'data': {'code': 0}}]
[2024-12-20 15:43:18] [0.3.61] [INFO] xiaomusic.py:1608: 【ARE YOU OK】已经开始播放了
[15:43:18] [0.3.61] [INFO] 192.168.0.11:33302 - "GET /music/download/ARE%20YOU%20OK.mp3 HTTP/1.1" 206
[15:43:18] [0.3.61] [INFO] 192.168.0.11:33303 - "GET /music/download/ARE%20YOU%20OK.mp3 HTTP/1.1" 206
[2024-12-20 15:43:20] [0.3.61] [ERROR] analytics.py:108: Execption Cannot connect to host umami.hanxi.cc:443 ssl:default [Connection reset by peer]
Traceback (most recent call last):
File "/app/.venv/lib/python3.10/site-packages/aiohttp/connector.py", line 1122, in _wrap_create_connection
return await self._loop.create_connection(*args, **kwargs, sock=sock)
File "/usr/local/lib/python3.10/asyncio/base_events.py", line 1103, in create_connection
transport, protocol = await self._create_connection_transport(
File "/usr/local/lib/python3.10/asyncio/base_events.py", line 1133, in _create_connection_transport
await waiter
File "/usr/local/lib/python3.10/asyncio/selector_events.py", line 862, in _read_ready__data_received
data = self._sock.recv(self.max_size)
ConnectionResetError: [Errno 104] Connection reset by peer
容器一直重启,网页后台也进不去
---
### 评论 73 - hanxi
> 容器一直重启,网页后台也进不去
The above exception was the direct cause of the following exception:
这种情况有日志吗?可能是端口冲突?
---
### 评论 74 - BladPit
不知道有没有用unraid系统NAS的朋友
我这里使用docker安装xiaomusic有一个很奇怪的现象不知道有没有大佬能够解惑
Traceback (most recent call last):
File "/app/xiaomusic/analytics.py", line 104, in post_to_umami
async with session.post(url, json=data, headers=headers) as response:
File "/app/.venv/lib/python3.10/site-packages/aiohttp/client.py", line 1425, in __aenter__
self._resp: _RetType = await self._coro
File "/app/.venv/lib/python3.10/site-packages/aiohttp/client.py", line 703, in _request
conn = await self._connector.connect(
File "/app/.venv/lib/python3.10/site-packages/aiohttp/connector.py", line 548, in connect
proto = await self._create_connection(req, traces, timeout)
File "/app/.venv/lib/python3.10/site-packages/aiohttp/connector.py", line 1056, in _create_connection
_, proto = await self._create_direct_connection(req, traces, timeout)
File "/app/.venv/lib/python3.10/site-packages/aiohttp/connector.py", line 1400, in _create_direct_connection
raise last_exc
File "/app/.venv/lib/python3.10/site-packages/aiohttp/connector.py", line 1369, in _create_direct_connection
transp, proto = await self._wrap_create_connection(
File "/app/.venv/lib/python3.10/site-packages/aiohttp/connector.py", line 1130, in _wrap_create_connection
raise client_error(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host umami.hanxi.cc:443 ssl:default [Connection reset by peer]
[2024-12-20 15:43:20] [0.3.61] [INFO] analytics.py:73: analytics run_with_cancel success
[2024-12-20 15:43:20] [0.3.61] [INFO] xiaomusic.py:2012: cancel_next_timer
[2024-12-20 15:43:20] [0.3.61] [INFO] xiaomusic.py:2018: 下一曲定时器不见了
[2024-12-20 15:43:20] [0.3.61] [INFO] xiaomusic.py:1936: 136 秒后将会播放下一首歌曲
[2024-12-20 15:43:20] [0.3.61] [INFO] xiaomusic.py:1307: save_cur_config ok
[15:43:29] [0.3.61] [INFO] 192.168.0.67:8205 - "GET /playingmusic?did=108581258 HTTP/1.1" 200
[2024-12-20 15:43:57] [0.3.61] [INFO] xiaomusic.py:797: 收到消息:播放歌曲 控制面板:False did:108581258
[2024-12-20 15:43:57] [0.3.61] [INFO] xiaomusic.py:855: 完全匹配指令. query:播放歌曲 opvalue:play
[2024-12-20 15:43:57] [0.3.61] [INFO] xiaomusic.py:414: try get_filename. filename:music/download/ARE YOU OK.mp3
[2024-12-20 15:43:57] [0.3.61] [INFO] xiaomusic.py:1465: play. search_key: name:ARE YOU OK
[2024-12-20 15:43:57] [0.3.61] [INFO] xiaomusic.py:930: 根据【ARE YOU OK】找到歌曲【['ARE YOU OK']】
[2024-12-20 15:43:57] [0.3.61] [INFO] xiaomusic.py:1440: 没打乱 全部 ['周杰伦的晴天', '周杰伦稻香', '小猪佩奇的故事']
[2024-12-20 15:43:57] [0.3.61] [INFO] xiaomusic.py:2022: cancel_group_next_timer {'108581258': <xiaomusic.xiaomusic.XiaoMusicDevice object at 0x7f31cc6c3610>}
[2024-12-20 15:43:57] [0.3.61] [INFO] xiaomusic.py:2012: cancel_next_timer
[2024-12-20 15:43:57] [0.3.61] [INFO] xiaomusic.py:2015: 下一曲定时器已取消 9fcc3636-3b8e-4309-a430-7eb8978d94f4
[2024-12-20 15:43:57] [0.3.61] [INFO] xiaomusic.py:1589: cur_music ARE YOU OK
[2024-12-20 15:43:57] [0.3.61] [INFO] xiaomusic.py:414: try get_filename. filename:music/download/ARE YOU OK.mp3
[2024-12-20 15:43:57] [0.3.61] [INFO] xiaomusic.py:524: get_music_url local music. name:ARE YOU OK, filename:download/ARE YOU OK.mp3
[2024-12-20 15:43:57] [0.3.61] [INFO] xiaomusic.py:445: get_music_sec_url. name:ARE YOU OK url:http://192.168.0.3:8090/music/download/ARE%20YOU%20OK.mp3
[2024-12-20 15:43:57] [0.3.61] [INFO] xiaomusic.py:414: try get_filename. filename:music/download/ARE YOU OK.mp3
[2024-12-20 15:43:57] [0.3.61] [INFO] xiaomusic.py:459: get_music_sec_url. name:ARE YOU OK filename:music/download/ARE YOU OK.mp3
[2024-12-20 15:43:57] [0.3.61] [INFO] xiaomusic.py:464: 本地歌曲 ARE YOU OK : music/download/ARE YOU OK.mp3 http://192.168.0.3:8090/music/download/ARE%20YOU%20OK.mp3 的时长 133 秒
[2024-12-20 15:43:57] [0.3.61] [INFO] xiaomusic.py:1989: group_force_stop_xiaoai ['9fcc3636-3b8e-4309-a430-7eb8978d94f4']
[2024-12-20 15:43:58] [0.3.61] [INFO] xiaomusic.py:1644: force_stop_xiaoai player_pause device_id:9fcc3636-3b8e-4309-a430-7eb8978d94f4 ret:{'code': 0, 'message': "Msg has been successfully proxy to the device, this service is a simple proxy, if you encounter any problems pls contact ROM's developers directly!!!", 'data': {'code': 0}}
[2024-12-20 15:43:58] [0.3.61] [INFO] xiaomusic.py:1655: {'code': 0, 'message': "Msg has been successfully proxy to the device, this service is a simple proxy, if you encounter any problems pls contact ROM's developers directly!!!", 'data': {'code': 0, 'info': '{ "status": 1, "volume": 50, "loop_type": 1 }'}}
[2024-12-20 15:43:58] [0.3.61] [INFO] xiaomusic.py:1668: stop_if_xiaoai_is_playing player_stop device_id:9fcc3636-3b8e-4309-a430-7eb8978d94f4 enable_force_stop:False ret:{'code': 0, 'message': "Msg has been successfully proxy to the device, this service is a simple proxy, if you encounter any problems pls contact ROM's developers directly!!!", 'data': {'code': 0}}
[2024-12-20 15:43:58] [0.3.61] [INFO] xiaomusic.py:1992: group_force_stop_xiaoai ['9fcc3636-3b8e-4309-a430-7eb8978d94f4'] [None]
[2024-12-20 15:43:58] [0.3.61] [INFO] xiaomusic.py:1592: 播放 http://192.168.0.3:8090/music/download/ARE%20YOU%20OK.mp3
[15:43:58] [0.3.61] [INFO] 192.168.0.11:33306 - "GET /music/download/ARE%20YOU%20OK.mp3 HTTP/1.1" 206
[2024-12-20 15:43:58] [0.3.61] [INFO] xiaomusic.py:1871: play_one_url play_by_url device_id:9fcc3636-3b8e-4309-a430-7eb8978d94f4 ret:{'code': 0, 'message': "Msg has been successfully proxy to the device, this service is a simple proxy, if you encounter any problems pls contact ROM's developers directly!!!", 'data': {'code': 0}} url:http://192.168.0.3:8090/music/download/ARE%20YOU%20OK.mp3
[2024-12-20 15:43:58] [0.3.61] [INFO] xiaomusic.py:1846: group_player_play http://192.168.0.3:8090/music/download/ARE%20YOU%20OK.mp3 ['9fcc3636-3b8e-4309-a430-7eb8978d94f4'] [{'code': 0, 'message': "Msg has been successfully proxy to the device, this service is a simple proxy, if you encounter any problems pls contact ROM's developers directly!!!", 'data': {'code': 0}}]
[2024-12-20 15:43:58] [0.3.61] [INFO] xiaomusic.py:1608: 【ARE YOU OK】已经开始播放了
[15:43:58] [0.3.61] [INFO] 192.168.0.11:33307 - "GET /music/download/ARE%20YOU%20OK.mp3 HTTP/1.1" 206
[15:43:58] [0.3.61] [INFO] 192.168.0.11:33308 - "GET /music/download/ARE%20YOU%20OK.mp3 HTTP/1.1" 206
[2024-12-20 15:44:00] [0.3.61] [ERROR] analytics.py:108: Execption Cannot connect to host umami.hanxi.cc:443 ssl:default [Connection reset by peer]
Traceback (most recent call last):
File "/app/.venv/lib/python3.10/site-packages/aiohttp/connector.py", line 1122, in _wrap_create_connection
return await self._loop.create_connection(*args, **kwargs, sock=sock)
File "/usr/local/lib/python3.10/asyncio/base_events.py", line 1103, in create_connection
transport, protocol = await self._create_connection_transport(
File "/usr/local/lib/python3.10/asyncio/base_events.py", line 1133, in _create_connection_transport
await waiter
File "/usr/local/lib/python3.10/asyncio/selector_events.py", line 862, in _read_ready__data_received
data = self._sock.recv(self.max_size)
ConnectionResetError: [Errno 104] Connection reset by peer
我的unraid系统版本是6.8.2通过docker安装后发现如果没有开启特权模式Privileged那么从内网访问webGUI的时候在首页选择了主题之后会直接网页报错【Internal Server Error】+显示空白页面查看docker运行日志是正常的没有什么相关的报错
`2025-01-04 00:29:06,055 CRIT Supervisor is running as root. Privileges were not dropped because no user is specified in the config file. If you intend to run as root, you can set user=root in the config file to avoid this message.
The above exception was the direct cause of the following exception:
2025-01-04 00:29:06,064 INFO RPC interface 'supervisor' initialized
Traceback (most recent call last):
File "/app/xiaomusic/analytics.py", line 104, in post_to_umami
async with session.post(url, json=data, headers=headers) as response:
File "/app/.venv/lib/python3.10/site-packages/aiohttp/client.py", line 1425, in __aenter__
self._resp: _RetType = await self._coro
File "/app/.venv/lib/python3.10/site-packages/aiohttp/client.py", line 703, in _request
conn = await self._connector.connect(
File "/app/.venv/lib/python3.10/site-packages/aiohttp/connector.py", line 548, in connect
proto = await self._create_connection(req, traces, timeout)
File "/app/.venv/lib/python3.10/site-packages/aiohttp/connector.py", line 1056, in _create_connection
_, proto = await self._create_direct_connection(req, traces, timeout)
File "/app/.venv/lib/python3.10/site-packages/aiohttp/connector.py", line 1400, in _create_direct_connection
raise last_exc
File "/app/.venv/lib/python3.10/site-packages/aiohttp/connector.py", line 1369, in _create_direct_connection
transp, proto = await self._wrap_create_connection(
File "/app/.venv/lib/python3.10/site-packages/aiohttp/connector.py", line 1130, in _wrap_create_connection
raise client_error(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host umami.hanxi.cc:443 ssl:default [Connection reset by peer]
[2024-12-20 15:44:00] [0.3.61] [INFO] analytics.py:73: analytics run_with_cancel success
[2024-12-20 15:44:00] [0.3.61] [INFO] xiaomusic.py:2012: cancel_next_timer
[2024-12-20 15:44:00] [0.3.61] [INFO] xiaomusic.py:2018: 下一曲定时器不见了
[2024-12-20 15:44:00] [0.3.61] [INFO] xiaomusic.py:1936: 136 秒后将会播放下一首歌曲
[2024-12-20 15:44:00] [0.3.61] [INFO] xiaomusic.py:1307: save_cur_config ok
[15:44:29] [0.3.61] [INFO] 192.168.0.67:8252 - "GET /playingmusic?did=108581258 HTTP/1.1" 200
[2024-12-20 15:44:36] [0.3.61] [INFO] xiaomusic.py:797: 收到消息:播放歌曲周杰伦的搁浅 控制面板:False did:108581258
[2024-12-20 15:44:36] [0.3.61] [INFO] xiaomusic.py:893: 匹配到指令. opkey:播放歌曲 opvalue:play oparg:周杰伦的搁浅
[2024-12-20 15:44:36] [0.3.61] [INFO] xiaomusic.py:1465: play. search_key:周杰伦的搁浅 name:周杰伦的搁浅
[2024-12-20 15:44:36] [0.3.61] [INFO] xiaomusic.py:930: 根据【周杰伦的搁浅】找到歌曲【['周杰伦的晴天']】
[2024-12-20 15:44:36] [0.3.61] [INFO] xiaomusic.py:1440: 没打乱 最近新增 ['周杰伦的晴天', '周杰伦稻香', '小猪佩奇的故事']
[2024-12-20 15:44:36] [0.3.61] [INFO] xiaomusic.py:2022: cancel_group_next_timer {'108581258': <xiaomusic.xiaomusic.XiaoMusicDevice object at 0x7f31cc6c3610>}
[2024-12-20 15:44:36] [0.3.61] [INFO] xiaomusic.py:2012: cancel_next_timer
[2024-12-20 15:44:36] [0.3.61] [INFO] xiaomusic.py:2015: 下一曲定时器已取消 9fcc3636-3b8e-4309-a430-7eb8978d94f4
[2024-12-20 15:44:36] [0.3.61] [INFO] xiaomusic.py:1589: cur_music 周杰伦的晴天
[2024-12-20 15:44:36] [0.3.61] [INFO] xiaomusic.py:414: try get_filename. filename:music/download/周杰伦的晴天.mp3
[2024-12-20 15:44:36] [0.3.61] [INFO] xiaomusic.py:524: get_music_url local music. name:周杰伦的晴天, filename:download/周杰伦的晴天.mp3
[2024-12-20 15:44:36] [0.3.61] [INFO] xiaomusic.py:445: get_music_sec_url. name:周杰伦的晴天 url:http://192.168.0.3:8090/music/download/%E5%91%A8%E6%9D%B0%E4%BC%A6%E7%9A%84%E6%99%B4%E5%A4%A9.mp3
[2024-12-20 15:44:36] [0.3.61] [INFO] xiaomusic.py:414: try get_filename. filename:music/download/周杰伦的晴天.mp3
[2024-12-20 15:44:36] [0.3.61] [INFO] xiaomusic.py:459: get_music_sec_url. name:周杰伦的晴天 filename:music/download/周杰伦的晴天.mp3
[2024-12-20 15:44:36] [0.3.61] [INFO] xiaomusic.py:464: 本地歌曲 周杰伦的晴天 : music/download/周杰伦的晴天.mp3 http://192.168.0.3:8090/music/download/%E5%91%A8%E6%9D%B0%E4%BC%A6%E7%9A%84%E6%99%B4%E5%A4%A9.mp3 的时长 318 秒
[2024-12-20 15:44:36] [0.3.61] [INFO] xiaomusic.py:1989: group_force_stop_xiaoai ['9fcc3636-3b8e-4309-a430-7eb8978d94f4']
[2024-12-20 15:44:36] [0.3.61] [INFO] xiaomusic.py:1644: force_stop_xiaoai player_pause device_id:9fcc3636-3b8e-4309-a430-7eb8978d94f4 ret:{'code': 0, 'message': "Msg has been successfully proxy to the device, this service is a simple proxy, if you encounter any problems pls contact ROM's developers directly!!!", 'data': {'code': 0}}
[2024-12-20 15:44:36] [0.3.61] [INFO] xiaomusic.py:1655: {'code': 0, 'message': "Msg has been successfully proxy to the device, this service is a simple proxy, if you encounter any problems pls contact ROM's developers directly!!!", 'data': {'code': 0, 'info': '{ "status": 1, "volume": 50, "loop_type": 1 }'}}
[2024-12-20 15:44:37] [0.3.61] [INFO] xiaomusic.py:1668: stop_if_xiaoai_is_playing player_stop device_id:9fcc3636-3b8e-4309-a430-7eb8978d94f4 enable_force_stop:False ret:{'code': 0, 'message': "Msg has been successfully proxy to the device, this service is a simple proxy, if you encounter any problems pls contact ROM's developers directly!!!", 'data': {'code': 0}}
[2024-12-20 15:44:37] [0.3.61] [INFO] xiaomusic.py:1992: group_force_stop_xiaoai ['9fcc3636-3b8e-4309-a430-7eb8978d94f4'] [None]
[2024-12-20 15:44:37] [0.3.61] [INFO] xiaomusic.py:1592: 播放 http://192.168.0.3:8090/music/download/%E5%91%A8%E6%9D%B0%E4%BC%A6%E7%9A%84%E6%99%B4%E5%A4%A9.mp3
[2024-12-20 15:44:37] [0.3.61] [INFO] xiaomusic.py:1871: play_one_url play_by_url device_id:9fcc3636-3b8e-4309-a430-7eb8978d94f4 ret:{'code': 0, 'message': "Msg has been successfully proxy to the device, this service is a simple proxy, if you encounter any problems pls contact ROM's developers directly!!!", 'data': {'code': 0}} url:http://192.168.0.3:8090/music/download/%E5%91%A8%E6%9D%B0%E4%BC%A6%E7%9A%84%E6%99%B4%E5%A4%A9.mp3
[2024-12-20 15:44:37] [0.3.61] [INFO] xiaomusic.py:1846: group_player_play http://192.168.0.3:8090/music/download/%E5%91%A8%E6%9D%B0%E4%BC%A6%E7%9A%84%E6%99%B4%E5%A4%A9.mp3 ['9fcc3636-3b8e-4309-a430-7eb8978d94f4'] [{'code': 0, 'message': "Msg has been successfully proxy to the device, this service is a simple proxy, if you encounter any problems pls contact ROM's developers directly!!!", 'data': {'code': 0}}]
[2024-12-20 15:44:37] [0.3.61] [INFO] xiaomusic.py:1608: 【周杰伦的晴天】已经开始播放了
[15:44:37] [0.3.61] [INFO] 192.168.0.11:33311 - "GET /music/download/%E5%91%A8%E6%9D%B0%E4%BC%A6%E7%9A%84%E6%99%B4%E5%A4%A9.mp3 HTTP/1.1" 206
[15:44:37] [0.3.61] [INFO] 192.168.0.11:33312 - "GET /music/download/%E5%91%A8%E6%9D%B0%E4%BC%A6%E7%9A%84%E6%99%B4%E5%A4%A9.mp3 HTTP/1.1" 206
[15:44:37] [0.3.61] [INFO] 192.168.0.11:33313 - "GET /music/download/%E5%91%A8%E6%9D%B0%E4%BC%A6%E7%9A%84%E6%99%B4%E5%A4%A9.mp3 HTTP/1.1" 206
[2024-12-20 15:44:38] [0.3.61] [ERROR] analytics.py:108: Execption Cannot connect to host umami.hanxi.cc:443 ssl:default [Connection reset by peer]
Traceback (most recent call last):
File "/app/.venv/lib/python3.10/site-packages/aiohttp/connector.py", line 1122, in _wrap_create_connection
return await self._loop.create_connection(*args, **kwargs, sock=sock)
File "/usr/local/lib/python3.10/asyncio/base_events.py", line 1103, in create_connection
transport, protocol = await self._create_connection_transport(
File "/usr/local/lib/python3.10/asyncio/base_events.py", line 1133, in _create_connection_transport
await waiter
File "/usr/local/lib/python3.10/asyncio/selector_events.py", line 862, in _read_ready__data_received
data = self._sock.recv(self.max_size)
ConnectionResetError: [Errno 104] Connection reset by peer
2025-01-04 00:29:06,064 CRIT Server 'unix_http_server' running without any HTTP authentication checking
The above exception was the direct cause of the following exception:
2025-01-04 00:29:06,065 INFO supervisord started with pid 1
Traceback (most recent call last):
File "/app/xiaomusic/analytics.py", line 104, in post_to_umami
async with session.post(url, json=data, headers=headers) as response:
File "/app/.venv/lib/python3.10/site-packages/aiohttp/client.py", line 1425, in __aenter__
self._resp: _RetType = await self._coro
File "/app/.venv/lib/python3.10/site-packages/aiohttp/client.py", line 703, in _request
conn = await self._connector.connect(
File "/app/.venv/lib/python3.10/site-packages/aiohttp/connector.py", line 548, in connect
proto = await self._create_connection(req, traces, timeout)
File "/app/.venv/lib/python3.10/site-packages/aiohttp/connector.py", line 1056, in _create_connection
_, proto = await self._create_direct_connection(req, traces, timeout)
File "/app/.venv/lib/python3.10/site-packages/aiohttp/connector.py", line 1400, in _create_direct_connection
raise last_exc
File "/app/.venv/lib/python3.10/site-packages/aiohttp/connector.py", line 1369, in _create_direct_connection
transp, proto = await self._wrap_create_connection(
File "/app/.venv/lib/python3.10/site-packages/aiohttp/connector.py", line 1130, in _wrap_create_connection
raise client_error(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host umami.hanxi.cc:443 ssl:default [Connection reset by peer]
[2024-12-20 15:44:38] [0.3.61] [INFO] analytics.py:73: analytics run_with_cancel success
[2024-12-20 15:44:38] [0.3.61] [INFO] xiaomusic.py:2012: cancel_next_timer
[2024-12-20 15:44:38] [0.3.61] [INFO] xiaomusic.py:2018: 下一曲定时器不见了
[2024-12-20 15:44:38] [0.3.61] [INFO] xiaomusic.py:1936: 321 秒后将会播放下一首歌曲
[2024-12-20 15:44:38] [0.3.61] [INFO] xiaomusic.py:1307: save_cur_config ok
[15:45:29] [0.3.61] [INFO] 192.168.0.67:8295 - "GET /playingmusic?did=108581258 HTTP/1.1" 200
[15:46:29] [0.3.61] [INFO] 192.168.0.67:8386 - "GET /playingmusic?did=108581258 HTTP/1.1" 200
[15:46:58] [0.3.61] [INFO] 192.168.0.67:8473 - "GET /getsetting HTTP/1.1" 200
[15:46:58] [0.3.61] [INFO] 192.168.0.67:8472 - "GET /getversion HTTP/1.1" 200
[15:46:58] [0.3.61] [INFO] 192.168.0.67:8473 - "GET /musiclist HTTP/1.1" 200
[15:46:58] [0.3.61] [INFO] 192.168.0.67:8473 - "GET /curplaylist?did=108581258 HTTP/1.1" 200
[15:46:58] [0.3.61] [INFO] 192.168.0.67:8479 - "GET /playingmusic?did=108581258 HTTP/1.1" 200
[2024-12-20 15:46:59] [0.3.61] [INFO] xiaomusic.py:1951: get_volume. playing_info:{'code': 0, 'message': "Msg has been successfully proxy to the device, this service is a simple proxy, if you encounter any problems pls contact ROM's developers directly!!!", 'data': {'code': 0, 'info': '{ "status": 1, "volume": 50, "loop_type": 1 }'}}
[2024-12-20 15:46:59] [0.3.61] [INFO] xiaomusic.py:1958: get_volume. volume:50
[15:46:59] [0.3.61] [INFO] 192.168.0.67:8472 - "GET /getvolume?did=108581258 HTTP/1.1" 200
[15:46:59] [0.3.61] [INFO] 192.168.0.67:8478 - "GET /latestversion HTTP/1.1" 200
[15:47:01] [0.3.61] [INFO] 192.168.0.67:8478 - "GET /playingmusic?did=108581258 HTTP/1.1" 200
[15:47:04] [0.3.61] [INFO] 192.168.0.67:8478 - "GET /playingmusic?did=108581258 HTTP/1.1" 200
[15:47:05] [0.3.61] [INFO] 192.168.0.67:8478 - "GET /playingmusic?did=108581258 HTTP/1.1" 200
[15:47:07] [0.3.61] [INFO] 192.168.0.67:8478 - "GET /playingmusic?did=108581258 HTTP/1.1" 200
[15:47:10] [0.3.61] [INFO] 192.168.0.67:8478 - "GET /playingmusic?did=108581258 HTTP/1.1" 200
[15:47:12] [0.3.61] [INFO] 192.168.0.67:8478 - "GET /getversion HTTP/1.1" 200 #
2025-01-04 00:29:07,068 INFO spawned: 'xiaomusic' with pid 6`
然而如果开启特权模式运行docker则会完全正常webGUI能够正常访问。感觉非常疑惑不知道是什么原因。
这个问题之前在安装docker版迅雷的时候有类似情况必须开启特权模式迅雷的docker才能启动但迅雷的docker应该是所有人都如此但xiaomusic的这种情况我询问过其他unraid群友似乎没有遇到该问题。
---
### 评论 75 - ZYT1601
容器一直重启,日志一直循环一段
Unlinking stale socket /var/run/supervisor.sock
/usr/lib/python3/dist-packages/supervisor/options.py:474: UserWarning: Supervisord is running as root and it is searching for its configuration file in default locations (including its current working directory); you probably want to specify a "-c" argument specifying an absolute path to a configuration file for improved security.
self.warnings.warn(
Unlinking stale socket /var/run/supervisor.sock
---
### 评论 76 - hanxi
@ZYT1601 试试看这个方法: /issues/348.html#issuecomment-2568722472
---
### 评论 77 - ZYT1601
可以了,飞牛把容器设置里面的命令全部删掉也是一个道理
---
### 评论 78 - ZYT1601
> 可以了,飞牛把容器设置里面的命令全部删掉也是一个道理
好像不能一劳永逸
---
### 评论 79 - hanxi
> > 可以了,飞牛把容器设置里面的命令全部删掉也是一个道理
>
> 好像不能一劳永逸
等后续版本吧。
---
### 评论 80 - Ivysaur-91
有个问题请教下建立容器的时候指定了nas本地的位置映射到容器的音乐路径但是在nas路径防止文件无法被识别出来。
![屏幕截图 2025-01-05 183306](https://gproxy.hanxi.cc/proxy/user-attachments/assets/c3a8a107-1fb9-456d-8f03-da0d03b3d770)
直接在xiaomusic里面下载音乐是可以播放的进入到docker里面的路径也是有音乐文件的
![image](https://gproxy.hanxi.cc/proxy/user-attachments/assets/fdb6ea7a-8ccf-4580-a983-b793c591869b)
建容器的命令如下:
docker run -p 58090:8090 -e XIAOMUSIC_PUBLIC_PORT=58090 -v /Public/Music/[[xiaomusic]]:/app/music -v /Public/Music/[[xiaomusic]]:/app/conf m.daocloud.io/docker.io/hanxi/xiaomusic
---
### 评论 81 - hanxi
> 有个问题请教下建立容器的时候指定了nas本地的位置映射到容器的音乐路径但是在nas路径防止文件无法被识别出来。 ![屏幕截图 2025-01-05 183306](https://private-user-images.githubusercontent.com/193787091/400193889-c3a8a107-1fb9-456d-8f03-da0d03b3d770.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzYwNzY2MDYsIm5iZiI6MTczNjA3NjMwNiwicGF0aCI6Ii8xOTM3ODcwOTEvNDAwMTkzODg5LWMzYThhMTA3LTFmYjktNDU2ZC04ZjAzLWRhMGQwM2IzZDc3MC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMTA1JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDEwNVQxMTI1MDZaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1kMTA2YmM4ZDI4MTk1OWFjZTAxZTZlODE1YmYwMTk4ZDE3NmMyNzI1ZDVmYjNhOWVhMTdhZTJjMDEzYjM2NjllJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.45ZS_c09oRK43CTcgUJTEbzXNDRUW0fSpWtw4PMUn3g) 直接在xiaomusic里面下载音乐是可以播放的进入到docker里面的路径也是有音乐文件的 ![image](https://private-user-images.githubusercontent.com/193787091/400194129-fdb6ea7a-8ccf-4580-a983-b793c591869b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzYwNzY2MDYsIm5iZiI6MTczNjA3NjMwNiwicGF0aCI6Ii8xOTM3ODcwOTEvNDAwMTk0MTI5LWZkYjZlYTdhLThjY2YtNDU4MC1hOTgzLWI3OTNjNTkxODY5Yi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMTA1JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDEwNVQxMTI1MDZaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1mMWMyYmZmNWFjMzU5Yzg3MDk5N2M5MTMyMmE0ZDJlYmY5YWY4OGU3MzhiYmVkMDYyNjFjZGQzNTUyYWM4MzI0JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.AmsxpldZ738tCXE2y_2AQuN14I4FERkOjn23JFrnRuM)
>
> 建容器的命令如下: docker run -p 58090:8090 -e XIAOMUSIC_PUBLIC_PORT=58090 -v /Public/Music/[[xiaomusic]]:/app/music -v /Public/Music/[[xiaomusic]]:/app/conf m.daocloud.io/docker.io/hanxi/xiaomusic
为啥路径要加方括号?另外两个路径不能重复。
---
### 评论 82 - Ivysaur-91
> > 有个问题请教下建立容器的时候指定了nas本地的位置映射到容器的音乐路径但是在nas路径防止文件无法被识别出来。 ![屏幕截图 2025-01-05 183306](https://private-user-images.githubusercontent.com/193787091/400193889-c3a8a107-1fb9-456d-8f03-da0d03b3d770.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzYwNzY2MDYsIm5iZiI6MTczNjA3NjMwNiwicGF0aCI6Ii8xOTM3ODcwOTEvNDAwMTkzODg5LWMzYThhMTA3LTFmYjktNDU2ZC04ZjAzLWRhMGQwM2IzZDc3MC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMTA1JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDEwNVQxMTI1MDZaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1kMTA2YmM4ZDI4MTk1OWFjZTAxZTZlODE1YmYwMTk4ZDE3NmMyNzI1ZDVmYjNhOWVhMTdhZTJjMDEzYjM2NjllJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.45ZS_c09oRK43CTcgUJTEbzXNDRUW0fSpWtw4PMUn3g) 直接在xiaomusic里面下载音乐是可以播放的进入到docker里面的路径也是有音乐文件的 ![image](https://private-user-images.githubusercontent.com/193787091/400194129-fdb6ea7a-8ccf-4580-a983-b793c591869b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzYwNzY2MDYsIm5iZiI6MTczNjA3NjMwNiwicGF0aCI6Ii8xOTM3ODcwOTEvNDAwMTk0MTI5LWZkYjZlYTdhLThjY2YtNDU4MC1hOTgzLWI3OTNjNTkxODY5Yi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMTA1JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDEwNVQxMTI1MDZaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1mMWMyYmZmNWFjMzU5Yzg3MDk5N2M5MTMyMmE0ZDJlYmY5YWY4OGU3MzhiYmVkMDYyNjFjZGQzNTUyYWM4MzI0JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.AmsxpldZ738tCXE2y_2AQuN14I4FERkOjn23JFrnRuM)
> > 建容器的命令如下: docker run -p 58090:8090 -e XIAOMUSIC_PUBLIC_PORT=58090 -v /Public/Music/[[xiaomusic]]:/app/music -v /Public/Music/[[xiaomusic]]:/app/conf m.daocloud.io/docker.io/hanxi/xiaomusic
>
> 为啥路径要加方括号?另外两个路径不能重复。
方括号是为了让文件夹在第一位,重新安装容器,路径不一样后还是一样的问题:
![屏幕截图 2025-01-06 214204](https://gproxy.hanxi.cc/proxy/user-attachments/assets/3bf283cc-c951-433b-95d9-dda6abeea7b4)
语句:
docker run -p 58090:8090 -e XIAOMUSIC_PUBLIC_PORT=58090 -v /Public/Music/xiaomusic/music:/app/music -v /Public/Music/xiaomusic/config:/app/conf m.daocloud.io/docker.io/hanxi/xiaomusic
---
### 评论 83 - Ivysaur-91
> > > 有个问题请教下建立容器的时候指定了nas本地的位置映射到容器的音乐路径但是在nas路径防止文件无法被识别出来。 ![屏幕截图 2025-01-05 183306](https://private-user-images.githubusercontent.com/193787091/400193889-c3a8a107-1fb9-456d-8f03-da0d03b3d770.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzYwNzY2MDYsIm5iZiI6MTczNjA3NjMwNiwicGF0aCI6Ii8xOTM3ODcwOTEvNDAwMTkzODg5LWMzYThhMTA3LTFmYjktNDU2ZC04ZjAzLWRhMGQwM2IzZDc3MC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMTA1JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDEwNVQxMTI1MDZaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1kMTA2YmM4ZDI4MTk1OWFjZTAxZTZlODE1YmYwMTk4ZDE3NmMyNzI1ZDVmYjNhOWVhMTdhZTJjMDEzYjM2NjllJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.45ZS_c09oRK43CTcgUJTEbzXNDRUW0fSpWtw4PMUn3g) 直接在xiaomusic里面下载音乐是可以播放的进入到docker里面的路径也是有音乐文件的 ![image](https://private-user-images.githubusercontent.com/193787091/400194129-fdb6ea7a-8ccf-4580-a983-b793c591869b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzYwNzY2MDYsIm5iZiI6MTczNjA3NjMwNiwicGF0aCI6Ii8xOTM3ODcwOTEvNDAwMTk0MTI5LWZkYjZlYTdhLThjY2YtNDU4MC1hOTgzLWI3OTNjNTkxODY5Yi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMTA1JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDEwNVQxMTI1MDZaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1mMWMyYmZmNWFjMzU5Yzg3MDk5N2M5MTMyMmE0ZDJlYmY5YWY4OGU3MzhiYmVkMDYyNjFjZGQzNTUyYWM4MzI0JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.AmsxpldZ738tCXE2y_2AQuN14I4FERkOjn23JFrnRuM)
> > > 建容器的命令如下: docker run -p 58090:8090 -e XIAOMUSIC_PUBLIC_PORT=58090 -v /Public/Music/[[xiaomusic]]:/app/music -v /Public/Music/[[xiaomusic]]:/app/conf m.daocloud.io/docker.io/hanxi/xiaomusic
> >
> >
> > 为啥路径要加方括号?另外两个路径不能重复。
>
> 方括号是为了让文件夹在第一位,重新安装容器,路径不一样后还是一样的问题:
>
> ![屏幕截图 2025-01-06 214204](https://private-user-images.githubusercontent.com/193787091/400439202-3bf283cc-c951-433b-95d9-dda6abeea7b4.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzYxNzEzMjIsIm5iZiI6MTczNjE3MTAyMiwicGF0aCI6Ii8xOTM3ODcwOTEvNDAwNDM5MjAyLTNiZjI4M2NjLWM5NTEtNDMzYi05NWQ5LWRkYTZhYmVlYTdiNC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMTA2JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDEwNlQxMzQzNDJaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT02MTExNDE3MmFkMDFlYzFlZTRlMTg0OTdiMTQ3ODY0MjIxODlmMjEzMjUyMWUwYmNjYWNkZGEzNTA0MDIyYWIxJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.cdKynorOPxYE9nBrETp-_E98B6D1cVpITIUzRdEu49M)
>
> 语句: docker run -p 58090:8090 -e XIAOMUSIC_PUBLIC_PORT=58090 -v /Public/Music/xiaomusic/music:/app/music -v /Public/Music/xiaomusic/config:/app/conf m.daocloud.io/docker.io/hanxi/xiaomusic
![屏幕截图 2025-01-06 215510](https://gproxy.hanxi.cc/proxy/user-attachments/assets/cc7e218c-f215-4c54-9c2e-aea7be692e22)
yi以为是文件夹关联失败了但是进入容器看应该是成功的
---
[链接到 GitHub Issue](https://github.com/hanxi/xiaomusic/issues/99)

View File

@@ -1,5 +1,68 @@
# 版本日志
## v0.3.72 (2025-01-11)
### Feat
- 新增播放文字功能
### Fix
- 修复默认主题没有单曲循环的问题 see #355
## v0.3.71 (2025-01-07)
### Feat
- 支持自动填 ip 和端口
### Fix
- 搜索歌曲窗口不自动关闭 see #351
- 解决歌词信息写入失败的问题
- 修复一些小问题
- 非播放中也返回歌曲时长 see #340
## v0.3.70 (2025-01-04)
### Fix
- 尝试修复部分设备无法启动的问题
- 解决首页提示翻译英文问题
- 尝试解决 supervisor 启动报错
## v0.3.69 (2025-01-01)
### Feat
- 支持关闭获取对话记录功能
### Fix
- 尝试解决网络卡顿问题
## v0.3.68 (2024-12-31)
### Feat
- umami 脚本改为异步加载
- 支持 python3.13 版本
- 增加均衡歌曲响度(可选) (#338)
### Fix
- 修复保存设置时可能出现报错的情况
## v0.3.67 (2024-12-29)
### Feat
- 简化设置,不允许修改监听端口
### Fix
- 修复默认主题搜索问题
## v0.3.66 (2024-12-26)
### Fix

View File

@@ -28,7 +28,7 @@ docker run -p 58090:8090 -e XIAOMUSIC_PUBLIC_PORT=58090 -v /xiaomusic_music:/app
🔥 国内:
```bash
docker run -p 58090:8090 -e XIAOMUSIC_PUBLIC_PORT=58090 -v /xiaomusic_music:/app/music -v /xiaomusic_conf:/app/conf m.daocloud.io/docker.io/hanxi/xiaomusic
docker run -p 58090:8090 -e XIAOMUSIC_PUBLIC_PORT=58090 -v /xiaomusic_music:/app/music -v /xiaomusic_conf:/app/conf docker.hanxi.cc/hanxi/xiaomusic
```
对应的 docker compose 配置如下:
@@ -53,7 +53,7 @@ services:
```yaml
services:
xiaomusic:
image: m.daocloud.io/docker.io/hanxi/xiaomusic
image: docker.hanxi.cc/hanxi/xiaomusic
container_name: xiaomusic
restart: unless-stopped
ports:
@@ -66,7 +66,8 @@ services:
```
- 其中 conf 目录为配置文件存放目录music 目录为音乐存放目录,建议分开配置为不同的目录。
- /xiaomusic_music 和 /xiaomusic_conf 是 docker 主机的目录,可以修改为其他目录。如果报错找不到 /xiaomusic_music 目录,可以先执行 `mkdir -p /xiaomusic_{music,conf}` 命令新建目录。
- /xiaomusic_music 和 /xiaomusic_conf 是 docker 所在的主机的目录,可以修改为其他目录。如果报错找不到 /xiaomusic_music 目录,可以先执行 `mkdir -p /xiaomusic_{music,conf}` 命令新建目录。
- /app/music 和 /app/conf 是 docker 容器里的目录,不要去修改。
- XIAOMUSIC_PUBLIC_PORT 是用来配置 NAS 本地端口的。8090 是容器端口,不要去修改。
- 后台访问地址为: http://NAS_IP:58090
@@ -80,6 +81,7 @@ services:
> [!TIP]
> 海外 RackNerd VPS 机器推荐,可支付宝付款。
>
> - [🔥1 GB KVM VPS $11.29/年](https://my.racknerd.com/aff.php?aff=1177&pid=903)
> - [2 GB KVM VPS](https://my.racknerd.com/aff.php?aff=1177&pid=904)
> - [3.5 GB KVM VPS](https://my.racknerd.com/aff.php?aff=1177&pid=905)
@@ -119,7 +121,7 @@ services:
\ / | | / _` | / _ \ | |\/| | | | | | / __| | | / __|
/ \ | | | (_| | | (_) | | | | | | |_| | \__ \ | | | (__
/_/\_\ |_| \__,_| \___/ |_| |_| \__,_| |___/ |_| \___|
XiaoMusic v0.3.65 by: github.com/hanxi
XiaoMusic v0.3.69 by: github.com/hanxi
usage: xiaomusic [-h] [--port PORT] [--hardware HARDWARE] [--account ACCOUNT]
[--password PASSWORD] [--cookie COOKIE] [--verbose]
@@ -247,7 +249,8 @@ docker build -t xiaomusic .
## 📢 讨论区
- [点击链接加入QQ频道【xiaomusic】](https://pd.qq.com/s/e2jybz0ss)
- [点击链接加入群聊【xiaomusic】 604526973](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=13St5PLVcTxYlWTAs_iAawazjtdD1l-a&authKey=dJWEpaT2fDBDpdUUOWj%2FLt6NS1ePBfShDfz7a6seNURi05VvVnAGQzXF%2FM%2F5HgIm&noverify=0&group_code=604526973)
- [点击链接加入群聊【xiaomusic官方交流群1(小爱音箱)】 604526973](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=13St5PLVcTxYlWTAs_iAawazjtdD1l-a&authKey=dJWEpaT2fDBDpdUUOWj%2FLt6NS1ePBfShDfz7a6seNURi05VvVnAGQzXF%2FM%2F5HgIm&noverify=0&group_code=604526973)
- [点击链接加入群聊【xiaomusic官方交流群2(小爱音箱)】1021062499](https://qm.qq.com/q/BmVNqhDL3M)
- <https://github.com/hanxi/xiaomusic/issues>
- [微信群二维码](https://github.com/hanxi/xiaomusic/issues/86)

1113
pdm.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
[project]
name = "xiaomusic"
version = "0.3.67"
version = "0.3.73"
description = "Play Music with xiaomi AI speaker"
authors = [
{name = "涵曦", email = "im.hanxi@gmail.com"},
@@ -22,7 +22,7 @@ dependencies = [
"requests>=2.32.3",
"sentry-sdk[fastapi]==1.45.1",
]
requires-python = ">=3.10,<=3.12"
requires-python = ">=3.10"
readme = "README.md"
license = {text = "MIT"}

View File

@@ -23,5 +23,5 @@ autostart=true
autorestart=true
startretries=99999
startsecs=60
stderr_logfile=AUTO ; 将错误日志输出到 supervisord 控制台
stdout_logfile=AUTO ; 将标准日志输出到 supervisord 控制台
stderr_logfile=/app/xiaomusic.log.txt
stdout_logfile=/app/xiaomusic.log.txt

View File

@@ -1 +1 @@
__version__ = "0.3.67"
__version__ = "0.3.73"

View File

@@ -57,11 +57,10 @@ class Analytics:
await self._send(event)
async def _send(self, event):
await self.post_to_umami(event)
events = [event]
await self.run_with_cancel(self._google_send, events)
asyncio.create_task(self.post_to_umami(event))
await self.run_with_cancel(self._google_send, [event])
async def _google_send(self, events):
def _google_send(self, events):
try:
self.gtag.send(events)
except Exception as e:
@@ -69,7 +68,7 @@ class Analytics:
async def run_with_cancel(self, func, *args, **kwargs):
try:
asyncio.ensure_future(asyncio.to_thread(func, *args, **kwargs))
asyncio.create_task(asyncio.to_thread(func, *args, **kwargs))
self.log.info("analytics run_with_cancel success")
except Exception as e:
self.log.warning(f"analytics run_with_cancel failed {e}")
@@ -96,6 +95,7 @@ class Analytics:
"type": "event",
}
self.log.info(f"umami data: {data}")
async with aiohttp.ClientSession() as session:
headers = {
"User-Agent": user_agent,

View File

@@ -97,6 +97,7 @@ class Config:
port: int = int(os.getenv("XIAOMUSIC_PORT", "8090")) # 监听端口
public_port: int = int(os.getenv("XIAOMUSIC_PUBLIC_PORT", 0)) # 歌曲访问端口
proxy: str = os.getenv("XIAOMUSIC_PROXY", None)
loudnorm: str = os.getenv("XIAOMUSIC_LOUDNORM", None) # 均衡音量参数
search_prefix: str = os.getenv(
"XIAOMUSIC_SEARCH", "bilisearch:"
) # "bilisearch:" or "ytsearch:"
@@ -169,6 +170,9 @@ class Config:
os.getenv("XIAOMUSIC_CONTINUE_PLAY", "false").lower() == "true"
)
pull_ask_sec: int = int(os.getenv("XIAOMUSIC_PULL_ASK_SEC", "1"))
enable_pull_ask: bool = (
os.getenv("XIAOMUSIC_ENABLE_PULL_ASK", "true").lower() == "true"
)
crontab_json: str = os.getenv("XIAOMUSIC_CRONTAB_JSON", "") # 定时任务
enable_yt_dlp_cookies: bool = (
os.getenv("XIAOMUSIC_ENABLE_YT_DLP_COOKIES", "false").lower() == "true"

View File

@@ -442,6 +442,16 @@ async def playurl(did: str, url: str, Verifcation=Depends(verification)):
return await xiaomusic.play_url(did=did, arg1=decoded_url)
@app.get("/playtts")
async def playtts(did: str, text: str, Verifcation=Depends(verification)):
if not xiaomusic.did_exist(did):
return {"ret": "Did not exist"}
log.info(f"tts {did} {text}")
await xiaomusic.do_tts(did=did, value=text)
return {"ret": "OK"}
@app.post("/refreshmusictag")
async def refreshmusictag(Verifcation=Depends(verification)):
xiaomusic.refresh_music_tag()

View File

@@ -6,9 +6,9 @@
<meta name="viewport" content="width=device-width">
<title>Debug For XiaoMusic</title>
<link rel="stylesheet" type="text/css" href="./main.css?version=1735438766">
<link rel="stylesheet" type="text/css" href="./main.css?version=1737034097">
<script src="https://unpkg.com/vconsole@latest/dist/vconsole.min.js"></script>
<script src="./jquery-3.7.1.min.js?version=1735438766"></script>
<script src="./jquery-3.7.1.min.js?version=1737034097"></script>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-Z09NC1K7ZW"></script>
@@ -20,7 +20,7 @@
</script>
<!-- umami -->
<script defer src="https://umami.hanxi.cc/script.js" data-website-id="7bfb0890-4115-4260-8892-b391513e7e99"></script>
<script async defer src="https://umami.hanxi.cc/script.js" data-website-id="7bfb0890-4115-4260-8892-b391513e7e99"></script>
<script>
var vConsole = new window.VConsole();

View File

@@ -4,8 +4,8 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<title>歌曲下载工具</title>
<link rel="stylesheet" type="text/css" href="./main.css?version=1735438766">
<script src="./jquery-3.7.1.min.js?version=1735438766"></script>
<link rel="stylesheet" type="text/css" href="./main.css?version=1737034097">
<script src="./jquery-3.7.1.min.js?version=1737034097"></script>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-Z09NC1K7ZW"></script>
@@ -17,7 +17,7 @@
</script>
<!-- umami -->
<script defer src="https://umami.hanxi.cc/script.js" data-website-id="7bfb0890-4115-4260-8892-b391513e7e99"></script>
<script async defer src="https://umami.hanxi.cc/script.js" data-website-id="7bfb0890-4115-4260-8892-b391513e7e99"></script>
</head>
<body>

View File

@@ -6,8 +6,8 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>小爱音箱操控面板</title>
<link href="https://fonts.googleapis.com/css?family=Material+Icons|Material+Icons+Outlined" rel="stylesheet">
<script src="./jquery-3.7.1.min.js?version=1735438766"></script>
<link rel="stylesheet" href="./main.css?version=1735438766">
<script src="./jquery-3.7.1.min.js?version=1737034097"></script>
<link rel="stylesheet" href="./main.css?version=1737034097">
<link rel="icon" href="./favicon.ico">
<!-- Google tag (gtag.js) -->
@@ -20,7 +20,7 @@
</script>
<!-- umami -->
<script defer src="https://umami.hanxi.cc/script.js" data-website-id="7bfb0890-4115-4260-8892-b391513e7e99"></script>
<script async defer src="https://umami.hanxi.cc/script.js" data-website-id="7bfb0890-4115-4260-8892-b391513e7e99"></script>
</head>
<body class="index_page">
@@ -95,24 +95,18 @@
<span class="material-icons">volume_up</span>
<p>音量</p>
</div>
<!--
<div onclick="toggleLocalPlay()" id="web_play">
<span class="material-icons">headphones</span>
<span class="tooltip">网页播放</span>
</div>
-->
<div onclick="toggleSearch()" class="icon-item device-enable">
<span class="material-icons">search</span>
<p>搜索</p>
</div>
<div onclick="togglePlayLink()" class="icon-item device-enable">
<span class="material-icons">link</span>
<p>链接</p>
</div>
<div onclick="toggleTimer()" class="icon-item device-enable">
<span class="material-icons">timer</span>
<p>定时</p>
</div>
<div onclick="togglePlayLink()" class="icon-item device-enable">
<span class="material-icons">emoji_nature</span>
<p>测试</p>
</div>
<div onclick="openSettings()" class="icon-item">
<span class="material-icons">settings</span>
<p>设置</p>
@@ -154,9 +148,14 @@
<h2>播放链接</h2>
<input type="text" id="music-url" class="search-input" placeholder="请输入播放链接"
value="https://lhttp.qtfm.cn/live/4915/64k.mp3">
<h2>播放文字</h2>
<input type="text" id="text-tts" class="search-input" placeholder="请输入文字"
value="播放文字测试">
<div class="component-button-group">
<button id="playurl">播放链接</button>
<button onclick="togglePlayLink()">关闭</button>
<button onclick="playUrl()">播放链接</button>
<button onclick="playTts()">播放文字</button>
<button onclick="togglePlayLink()">关闭</button>
</div>
</div>
@@ -220,7 +219,7 @@
Powered by XiaoMusic
</div>
<script src="./md.js?version=1735438766">
<script src="./md.js?version=1737034097">
</script>
</body>

View File

@@ -5,7 +5,7 @@
<link rel="icon" href="/favicon.ico">
<meta name="viewport" content="width=device-width">
<title>M3U to JSON Converter</title>
<link rel="stylesheet" type="text/css" href="./main.css?version=1735438766">
<link rel="stylesheet" type="text/css" href="./main.css?version=1737034097">
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-Z09NC1K7ZW"></script>
@@ -17,7 +17,7 @@
</script>
<!-- umami -->
<script defer src="https://umami.hanxi.cc/script.js" data-website-id="7bfb0890-4115-4260-8892-b391513e7e99"></script>
<script async defer src="https://umami.hanxi.cc/script.js" data-website-id="7bfb0890-4115-4260-8892-b391513e7e99"></script>
<!--
<script src="https://unpkg.com/vconsole@latest/dist/vconsole.min.js"></script>

View File

@@ -351,3 +351,8 @@ span,p {
margin-left: auto;
text-decoration: none;
}
.setting-label {
display: flex;
align-items: center;
}

View File

@@ -83,7 +83,7 @@ function nextTrack() {
function togglePlayMode(isSend = true) {
const modeBtnIcon = $("#modeBtn .material-icons");
if (playModeIndex == '') {
if (playModeIndex === '') {
playModeIndex = 2;
}
modeBtnIcon.text(playModes[playModeIndex].icon);
@@ -374,14 +374,20 @@ $("#play_music_list").on("click", () => {
});
});
$("#playurl").on("click", () => {
function playUrl() {
var url = $("#music-url").val();
const encoded_url = encodeURIComponent(url);
$.get(`/playurl?url=${encoded_url}&did=${did}`, function (data, status) {
console.log(data);
});
});
}
function playTts() {
var value = $("#text-tts").val();
$.get(`/playtts?text=${value}&did=${did}`, function (data, status) {
console.log(data);
});
}
function do_play_music(musicname, searchkey) {
$.ajax({
@@ -566,8 +572,10 @@ function get_playing_music() {
if (data.ret == "OK") {
if (data.is_playing) {
$("#playering-music").text(`【播放中】 ${data.cur_music}`);
isPlaying = true;
} else {
$("#playering-music").text(`【空闲中】 ${data.cur_music}`);
isPlaying = false;
}
offset = data.offset;
duration = data.duration;
@@ -588,9 +596,11 @@ function get_playing_music() {
}
setInterval(() => {
if (duration > 0) {
offset++;
$("#progress").val((offset / duration) * 100);
$("#current-time").text(formatTime(offset));
if (isPlaying) {
offset++;
$("#progress").val((offset / duration) * 100);
$("#current-time").text(formatTime(offset));
}
$("#duration").text(formatTime(duration));
} else {
$("#current-time").text(formatTime(0));
@@ -709,5 +719,6 @@ function confirmSearch() {
}
console.log("confirmSearch", filename, search_key);
do_play_music(filename, search_key);
toggleSearch();
}

View File

@@ -5,9 +5,9 @@
<meta name="viewport" content="width=device-width">
<title>小爱音箱操控面板</title>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<script src="./jquery-3.7.1.min.js?version=1735438766"></script>
<script src="./setting.js?version=1735438766"></script>
<link rel="stylesheet" type="text/css" href="./main.css?version=1735438766">
<script src="./jquery-3.7.1.min.js?version=1737034097"></script>
<script src="./setting.js?version=1737034097"></script>
<link rel="stylesheet" type="text/css" href="./main.css?version=1737034097">
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-Z09NC1K7ZW"></script>
@@ -19,7 +19,7 @@
</script>
<!-- umami -->
<script defer src="https://umami.hanxi.cc/script.js" data-website-id="7bfb0890-4115-4260-8892-b391513e7e99"></script>
<script async defer src="https://umami.hanxi.cc/script.js" data-website-id="7bfb0890-4115-4260-8892-b391513e7e99"></script>
<!--
<script src="https://unpkg.com/vconsole@latest/dist/vconsole.min.js"></script>
@@ -50,10 +50,20 @@ var vConsole = new window.VConsole();
<label for="password">*小米密码:</label>
<input id="password" type="password" placeholder="填写小米登录密码" />
<label for="hostname">*XIAOMUSIC_HOSTNAME(NAS的IP或域名):</label>
<label for="hostname" class="setting-label">*NAS的IP或域名:
<button class="option-inline mini-button" id="auto-hostname">
<span class="material-icons">edit</span>
<span>自动填</span>
</button>
</label>
<input id="hostname" type="text" />
<label for="public_port">*本地端口(0表示跟容器端口一致):</label>
<label for="public_port" class="setting-label">*本地端口:
<button class="option-inline mini-button" id="auto-port">
<span class="material-icons">edit</span>
<span>自动填</span>
</button>
</label>
<input id="public_port" type="number" value="0" />
</div>
<hr>
@@ -110,6 +120,9 @@ var vConsole = new window.VConsole();
<label for="proxy">XIAOMUSIC_PROXY(ytsearch需要):</label>
<input id="proxy" type="text" placeholder="http://192.168.2.5:8080" />
<label for="loudnorm">均衡歌曲音量大小(loudnorm滤镜):</label>
<input id="loudnorm" type="text" placeholder="loudnorm=I=-14:TP=-1.5:LRA=6" />
<label for="remove_id3tag">去除MP3 ID3v2和填充:</label>
<select id="remove_id3tag">
<option value="true">true</option>
@@ -167,6 +180,12 @@ var vConsole = new window.VConsole();
<option value="false" selected>false</option>
</select>
<label for="enable_pull_ask">获取对话记录:</label>
<select id="enable_pull_ask">
<option value="true" selected>true</option>
<option value="false">false</option>
</select>
<label for="pull_ask_sec">获取对话记录间隔(秒):</label>
<input id="pull_ask_sec" type="number" value="1" />
@@ -205,6 +224,12 @@ var vConsole = new window.VConsole();
<option value="false" selected>false</option>
</select>
<label for="enable_save_tag">启用ID3标签写入文件:</label>
<select id="enable_save_tag">
<option value="true">true</option>
<option value="false" selected>false</option>
</select>
<label for="get_ask_by_mina">特殊型号获取对话记录:</label>
<select id="get_ask_by_mina">
<option value="true">true</option>
@@ -214,7 +239,7 @@ var vConsole = new window.VConsole();
<label for="recently_added_playlist_len">最近新增的歌曲数量:</label>
<input id="recently_added_playlist_len" type="number" value="50" />
<label for="music_list_url" style="display: flex;align-items: center;">歌单地址:
<label for="music_list_url" class="setting-label">歌单地址:
<button class="option-inline mini-button" id="get_music_list">
<span class="material-icons">sync_alt</span>
<span>获取歌单</span>

View File

@@ -1,13 +1,13 @@
$(function(){
$(function () {
// 拉取版本
$.get("/getversion", function(data, status) {
$.get("/getversion", function (data, status) {
console.log(data, status, data["version"]);
$("#version").text(`${data.version}`);
});
// 遍历所有的select元素默认选中只有1个选项的
const autoSelectOne = () => {
$('select').each(function() {
$('select').each(function () {
// 如果select元素仅有一个option子元素
if ($(this).children('option').length === 1) {
// 选中这个option
@@ -16,7 +16,7 @@ $(function(){
});
};
function updateCheckbox(selector, mi_did, device_list,accountPassValid) {
function updateCheckbox(selector, mi_did, device_list, accountPassValid) {
// 清除现有的内容
$(selector).empty();
@@ -29,7 +29,7 @@ $(function(){
$(selector).append(loginTips);
return;
}
$.each(device_list, function(index, device) {
$.each(device_list, function (index, device) {
var did = device.miotDID;
var hardware = device.hardware;
var name = device.name;
@@ -59,7 +59,7 @@ $(function(){
var selectedDids = [];
// 仅选择给定容器中选中的复选框
$(containerSelector + ' .custom-checkbox:checked').each(function() {
$(containerSelector + ' .custom-checkbox:checked').each(function () {
var did = this.value;
selectedDids.push(did);
});
@@ -68,23 +68,23 @@ $(function(){
}
// 拉取现有配置
$.get("/getsetting?need_device_list=true", function(data, status) {
$.get("/getsetting?need_device_list=true", function (data, status) {
console.log(data, status);
const accountPassValid = data.account && data.password;
updateCheckbox("#mi_did", data.mi_did, data.device_list, accountPassValid);
// 初始化显示
for (const key in data) {
const $element = $("#" + key);
if ($element.length) {
if (data[key] === true) {
$element.val('true');
} else if (data[key] === false) {
$element.val('false');
} else {
$element.val(data[key]);
}
const $element = $("#" + key);
if ($element.length) {
if (data[key] === true) {
$element.val('true');
} else if (data[key] === false) {
$element.val('false');
} else {
$element.val(data[key]);
}
}
}
autoSelectOne();
@@ -94,7 +94,7 @@ $(function(){
var setting = $('#setting');
var inputs = setting.find('input, select, textarea');
var data = {};
inputs.each(function() {
inputs.each(function () {
var id = this.id;
if (id) {
data[id] = $(this).val();
@@ -173,17 +173,17 @@ $(function(){
data: formData,
processData: false,
contentType: false,
success: function(res) {
success: function (res) {
console.log(res);
alert("上传成功");
},
error: function(jqXHR, textStatus, errorThrown) {
error: function (jqXHR, textStatus, errorThrown) {
console.log(res);
alert("上传失败");
}
});
} else {
alert("请选择一个文件");
alert("请选择一个文件");
}
});
@@ -191,14 +191,29 @@ $(function(){
$("#clear_cache").on("click", () => {
localStorage.clear();
});
$("#hostname").on("change", function(){
$("#hostname").on("change", function () {
const hostname = $(this).val();
// 检查是否包含端口号1到5位数字
if (hostname.match(/:\d{1,5}$/)) {
alert("hostname禁止带端口号");
// 移除端口号
$(this).val(hostname.replace(/:\d{1,5}$/,""));
$(this).val(hostname.replace(/:\d{1,5}$/, ""));
}
});
$("#auto-hostname").on("click", () => {
const protocol = window.location.protocol;
const hostname = window.location.hostname;
const baseUrl = `${protocol}//${hostname}`;
console.log(baseUrl);
$("#hostname").val(baseUrl);
});
$("#auto-port").on("click", () => {
const port = window.location.port;
console.log(port);
$("#public_port").val(port);
});
});

View File

@@ -20,7 +20,7 @@
</script>
<!-- umami -->
<script defer src="https://umami.hanxi.cc/script.js" data-website-id="7bfb0890-4115-4260-8892-b391513e7e99"></script>
<script async defer src="https://umami.hanxi.cc/script.js" data-website-id="7bfb0890-4115-4260-8892-b391513e7e99"></script>
<script>
var vConsole = new window.VConsole();

View File

@@ -17,7 +17,7 @@
</script>
<!-- umami -->
<script defer src="https://umami.hanxi.cc/script.js" data-website-id="7bfb0890-4115-4260-8892-b391513e7e99"></script>
<script async defer src="https://umami.hanxi.cc/script.js" data-website-id="7bfb0890-4115-4260-8892-b391513e7e99"></script>
</head>
<body>

View File

@@ -18,7 +18,7 @@
</script>
<!-- umami -->
<script defer src="https://umami.hanxi.cc/script.js" data-website-id="7bfb0890-4115-4260-8892-b391513e7e99"></script>
<script async defer src="https://umami.hanxi.cc/script.js" data-website-id="7bfb0890-4115-4260-8892-b391513e7e99"></script>
<!--
<script src="https://unpkg.com/vconsole@latest/dist/vconsole.min.js"></script>

View File

@@ -17,7 +17,7 @@
</script>
<!-- umami -->
<script defer src="https://umami.hanxi.cc/script.js" data-website-id="7bfb0890-4115-4260-8892-b391513e7e99"></script>
<script async defer src="https://umami.hanxi.cc/script.js" data-website-id="7bfb0890-4115-4260-8892-b391513e7e99"></script>
<!--
<script src="https://unpkg.com/vconsole@latest/dist/vconsole.min.js"></script>

View File

@@ -18,7 +18,7 @@
</script>
<!-- umami -->
<script defer src="https://umami.hanxi.cc/script.js" data-website-id="7bfb0890-4115-4260-8892-b391513e7e99"></script>
<script async defer src="https://umami.hanxi.cc/script.js" data-website-id="7bfb0890-4115-4260-8892-b391513e7e99"></script>
<!--
<script src="https://unpkg.com/vconsole@latest/dist/vconsole.min.js"></script>
@@ -111,6 +111,9 @@ var vConsole = new window.VConsole();
<label for="proxy">XIAOMUSIC_PROXY(ytsearch需要):</label>
<input id="proxy" type="text" placeholder="http://192.168.2.5:8080" />
<label for="loudnorm">均衡歌曲音量大小(loudnorm滤镜):</label>
<input id="loudnorm" type="text" placeholder="loudnorm=I=-14:TP=-1.5:LRA=6" />
<label for="remove_id3tag">去除MP3 ID3v2和填充:</label>
<select id="remove_id3tag">
<option value="true">true</option>

View File

@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="en">
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
@@ -20,7 +20,7 @@
</script>
<!-- umami -->
<script defer src="https://umami.hanxi.cc/script.js" data-website-id="7bfb0890-4115-4260-8892-b391513e7e99"></script>
<script async defer src="https://umami.hanxi.cc/script.js" data-website-id="7bfb0890-4115-4260-8892-b391513e7e99"></script>
<script type="text/javascript">
if (navigator.serviceWorker != null) {

View File

@@ -23,7 +23,7 @@
</script>
<!-- umami -->
<script defer src="https://umami.hanxi.cc/script.js" data-website-id="7bfb0890-4115-4260-8892-b391513e7e99"></script>
<script async defer src="https://umami.hanxi.cc/script.js" data-website-id="7bfb0890-4115-4260-8892-b391513e7e99"></script>
</body>
</html>

View File

@@ -20,7 +20,7 @@
</script>
<!-- umami -->
<script defer src="https://umami.hanxi.cc/script.js" data-website-id="7bfb0890-4115-4260-8892-b391513e7e99"></script>
<script async defer src="https://umami.hanxi.cc/script.js" data-website-id="7bfb0890-4115-4260-8892-b391513e7e99"></script>
</head>
<body>
<div id="app"></div>

View File

@@ -487,6 +487,11 @@ def convert_file_to_mp3(input_file: str, config) -> str:
log.info(f"File {out_file_path} already exists. Skipping convert_file_to_mp3.")
return relative_path
# 检查是否存在 loudnorm 参数
loudnorm_args = []
if config.loudnorm:
loudnorm_args = ["-af", config.loudnorm]
command = [
os.path.join(config.ffmpeg_location, "ffmpeg"),
"-i",
@@ -495,6 +500,7 @@ def convert_file_to_mp3(input_file: str, config) -> str:
"mp3",
"-vn",
"-y",
*loudnorm_args,
out_file_path,
]
@@ -799,19 +805,25 @@ def set_music_tag_to_file(file_path, info):
def _set_mp3_tags(audio, info):
audio.tags = ID3()
audio["TIT2"] = TIT2(encoding=3, text=info.title)
audio["TPE1"] = TPE1(encoding=3, text=info.artist)
audio["TALB"] = TALB(encoding=3, text=info.album)
audio["TDRC"] = TDRC(encoding=3, text=info.year)
audio["TCON"] = TCON(encoding=3, text=info.genre)
# 使用 USLT 存储歌词
if info.lyrics:
audio["USLT"] = USLT(encoding=3, lang="eng", text=info.lyrics)
# 添加封面图片
if info.picture:
with open(info.picture, "rb") as img_file:
image_data = img_file.read()
audio["APIC"] = APIC(
encoding=3, mime="image/jpeg", type=3, desc="Cover", data=image_data
)
audio.save() # 保存修改
def _set_flac_tags(audio, info):
@@ -829,11 +841,11 @@ def _set_flac_tags(audio, info):
def _set_mp4_tags(audio, info):
audio["\xa9nam"] = info.title
audio["\xa9ART"] = info.artist
audio["\xa9alb"] = info.album
audio["\xa9day"] = info.year
audio["\xa9gen"] = info.genre
audio["nam"] = info.title
audio["ART"] = info.artist
audio["alb"] = info.album
audio["day"] = info.year
audio["gen"] = info.genre
if info.picture:
with open(info.picture, "rb") as img_file:
image_data = img_file.read()
@@ -896,6 +908,9 @@ async def download_playlist(config, url, dirname):
if config.enable_yt_dlp_cookies:
sbp_args += ("--cookies", f"{config.yt_dlp_cookies_path}")
if config.loudnorm:
sbp_args += ("--postprocessor-args", f"-af {config.loudnorm}")
sbp_args += (url,)
cmd = " ".join(sbp_args)
@@ -931,6 +946,9 @@ async def download_one_music(config, url, name=""):
if config.enable_yt_dlp_cookies:
sbp_args += ("--cookies", f"{config.yt_dlp_cookies_path}")
if config.loudnorm:
sbp_args += ("--postprocessor-args", f"-af {config.loudnorm}")
sbp_args += (url,)
cmd = " ".join(sbp_args)

View File

@@ -12,7 +12,6 @@ import urllib.parse
from collections import OrderedDict
from dataclasses import asdict
from logging.handlers import RotatingFileHandler
from pathlib import Path
from aiohttp import ClientSession, ClientTimeout
from miservice import MiAccount, MiIOService, MiNAService, miio_command
@@ -64,7 +63,8 @@ class XiaoMusic:
def __init__(self, config: Config):
self.config = config
self.mi_token_home = Path.home() / ".mi.token"
self.mi_token_home = os.path.join(self.config.conf_path, ".mi.token")
self.session = None
self.last_timestamp = {} # key为 did. timestamp last call mi speaker
self.last_record = None
self.cookie_jar = None
@@ -178,6 +178,11 @@ class XiaoMusic:
async def poll_latest_ask(self):
async with ClientSession() as session:
while True:
if not self.config.enable_pull_ask:
self.log.debug("Listening new message disabled")
await asyncio.sleep(5)
continue
self.log.debug(
f"Listening new message, timestamp: {self.last_timestamp}"
)
@@ -214,6 +219,7 @@ class XiaoMusic:
break
async def init_all_data(self, session):
self.mi_token_home = os.path.join(self.config.conf_path, ".mi.token")
await self.login_miboy(session)
await self.try_update_device_id()
cookie_jar = self.get_cookie()
@@ -328,6 +334,9 @@ class XiaoMusic:
# 检查响应状态码
if r.status != 200:
self.log.warning(f"Request failed with status {r.status}")
# fix #362
if i == 2 and r.status == 401:
await self.init_all_data(self.session)
continue
except asyncio.CancelledError:
@@ -774,15 +783,17 @@ class XiaoMusic:
await asyncio.sleep(3600)
async def run_forever(self):
self.log.info("run_forever start")
self.try_gen_all_music_tag() # 事件循环开始后调用一次
self.crontab.start()
await self.analytics.send_startup_event()
asyncio.create_task(self.analytics.send_startup_event())
analytics_task = asyncio.create_task(self.analytics_task_daily())
assert (
analytics_task is not None
) # to keep the reference to task, do not remove this
async with ClientSession() as session:
self.session = session
self.log.info(f"run_forever session:{self.session}")
await self.init_all_data(session)
task = asyncio.create_task(self.poll_latest_ask())
assert task is not None # to keep the reference to task, do not remove this
@@ -1244,6 +1255,9 @@ class XiaoMusic:
# 设置音量
async def set_volume(self, did="", arg1=0, **kwargs):
if did not in self.devices:
self.log.info(f"设备 did:{did} 不存在, 不能设置音量")
return
volume = int(arg1)
return await self.devices[did].set_volume(volume)
@@ -1337,7 +1351,8 @@ class XiaoMusic:
for handler in self.log.handlers:
handler.close()
self.setup_logger()
await self.init_all_data(self.session)
if self.session:
await self.init_all_data(self.session)
self._gen_all_music_list()
self.update_devices()
@@ -1418,10 +1433,10 @@ class XiaoMusicDevice:
return self.device.cur_music
def get_offset_duration(self):
if not self.isplaying():
return -1, -1
offset = time.time() - self._start_time - self._paused_time
duration = self._duration
if not self.isplaying():
return 0, duration
offset = time.time() - self._start_time - self._paused_time
return offset, duration
# 初始化播放列表
@@ -1491,7 +1506,7 @@ class XiaoMusicDevice:
self.device.cur_playlist = "临时搜索列表"
self.update_playlist(reorder=False)
name = names[0]
if update_cur_list:
if update_cur_list and (name not in self._play_list):
# 根据当前歌曲匹配歌曲列表
self.device.cur_playlist = self.find_cur_playlist(name)
self.update_playlist()
@@ -1725,6 +1740,9 @@ class XiaoMusicDevice:
if self.config.enable_yt_dlp_cookies:
sbp_args += ("--cookies", f"{self.config.yt_dlp_cookies_path}")
if self.config.loudnorm:
sbp_args += ("--postprocessor-args", f"-af {self.config.loudnorm}")
cmd = " ".join(sbp_args)
self.log.info(f"download cmd: {cmd}")
self._download_proc = await asyncio.create_subprocess_exec(*sbp_args)