mirror of
https://github.com/hanxi/xiaomusic.git
synced 2025-12-07 15:02:55 +08:00
Compare commits
16 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4e3e127767 | ||
|
|
dafd2cec05 | ||
|
|
59e9191f70 | ||
|
|
f7286269af | ||
|
|
d98652fe5d | ||
|
|
497dd07030 | ||
|
|
6cbec5bbff | ||
|
|
c46c652e5d | ||
|
|
1fbbae5f1c | ||
|
|
ffd04fab68 | ||
|
|
51dfe70a87 | ||
|
|
956c569b93 | ||
|
|
617a961816 | ||
|
|
b37b6fd57c | ||
|
|
c09baaac15 | ||
|
|
7ded7a08dd |
16
CHANGELOG.md
16
CHANGELOG.md
@@ -1,3 +1,19 @@
|
||||
## v0.3.66 (2024-12-26)
|
||||
|
||||
### Fix
|
||||
|
||||
- 修复歌曲批量重命名的问题
|
||||
- 修复自定义歌单删除后没刷新歌单列表
|
||||
- 尝试修复更新失败问题
|
||||
|
||||
## v0.3.65 (2024-12-24)
|
||||
|
||||
### Fix
|
||||
|
||||
- 处理图像报错
|
||||
- 修改歌单名字漏更新歌单列表
|
||||
- 修复获取自定义歌单接口报错
|
||||
|
||||
## v0.3.64 (2024-12-22)
|
||||
|
||||
### Fix
|
||||
|
||||
@@ -46,23 +46,23 @@ export default async ({ mode }) => {
|
||||
},
|
||||
},
|
||||
logLevel: 'warn',
|
||||
vite:{
|
||||
vite: {
|
||||
plugins: [
|
||||
AutoSidebar({
|
||||
path:'.',
|
||||
path: '.',
|
||||
collapsed: true,
|
||||
titleFromFile: true,
|
||||
}),
|
||||
GitHubIssuesPlugin({
|
||||
repo: 'hanxi/xiaomusic',
|
||||
token: env.VITE_GITHUB_ISSUES_TOKEN,
|
||||
replaceRules:[
|
||||
replaceRules: [
|
||||
{
|
||||
baseUrl: 'https://github.com/hanxi/xiaomusic/issues',
|
||||
targetUrl: '/issues',
|
||||
},
|
||||
],
|
||||
githubProxy: 'https://github.hanxi.cc/proxy',
|
||||
githubProxy: 'https://gproxy.hanxi.cc/proxy',
|
||||
}),
|
||||
],
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ docker pull dockerhub.anzu.vip/xiaomusic:latest
|
||||
|
||||
## 5. 安装完成后就进入群晖 DOCKER 配置 xiaomusic
|
||||
|
||||
<img width="491" alt="image" src="https://github.hanxi.cc/proxy/hanxi/xiaomusic/assets/38914725/e318062b-bd70-464c-a8df-8ce3635f2d84">
|
||||
<img width="491" alt="image" src="https://gproxy.hanxi.cc/proxy/hanxi/xiaomusic/assets/38914725/e318062b-bd70-464c-a8df-8ce3635f2d84">
|
||||
|
||||
- MI_HARDWARE=型号 前面第4 步骤获取的
|
||||
- XIAOMUSIC_SEARCH=搜索方式,我填写的bilisearch: 意思是通过 bilibili 搜索
|
||||
@@ -41,11 +41,11 @@ docker pull dockerhub.anzu.vip/xiaomusic:latest
|
||||
|
||||
## 6. 配置端口
|
||||
|
||||
<img width="757" alt="image (1)" src="https://github.hanxi.cc/proxy/hanxi/xiaomusic/assets/38914725/2b6b9283-296f-4845-a3ff-0ebb11f548b4">
|
||||
<img width="757" alt="image (1)" src="https://gproxy.hanxi.cc/proxy/hanxi/xiaomusic/assets/38914725/2b6b9283-296f-4845-a3ff-0ebb11f548b4">
|
||||
|
||||
## 7. 映射路径
|
||||
|
||||
<img width="737" alt="image (2)" src="https://github.hanxi.cc/proxy/hanxi/xiaomusic/assets/38914725/593718dd-8302-4a69-bec9-36e70f3f0407">
|
||||
<img width="737" alt="image (2)" src="https://gproxy.hanxi.cc/proxy/hanxi/xiaomusic/assets/38914725/593718dd-8302-4a69-bec9-36e70f3f0407">
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -350,7 +350,7 @@ key_word_dict中的“播放歌曲”口令是不能修改的是吧?因为以
|
||||
### 评论 16 - mogeqian
|
||||
|
||||
不行,后台设置如图
|
||||

|
||||

|
||||
日志如下:
|
||||
```
|
||||
[2024-11-11 18:08:04] [0.3.46] [INFO] xiaomusic.py:1130: update_config_from_setting ok. data:Config(account='**', password='**', mi_did='726577518,570867755', miio_tts_command='', cookie='', verbose=False, music_path='music', download_path='music/download', conf_path='conf', cache_dir='cache', hostname='192.168.22.4', port=8090, public_port=0, proxy='', search_prefix='bilisearch:', ffmpeg_location='./ffmpeg/bin', active_cmd='play,set_random_play,playlocal,play_music_list,stop', exclude_dirs='@eaDir', music_path_depth=10, disable_httpauth=True, httpauth_username='******', httpauth_password='******', music_list_url='', music_list_json='', custom_play_list_json='', disable_download=False, key_word_dict={'播放歌曲': 'play', '播放本地歌曲': 'playlocal', '关机': 'stop', '下一首': 'play_next', '上一首': 'play_prev', '单曲循环': 'set_play_type_one', '全部循环': 'set_play_type_all', '随机播放': 'set_random_play', '分钟后关机': 'stop_after_minute', '播放列表': 'play_music_list', '刷新列表': 'gen_music_list', '加入收藏': 'add_to_favorites', '收藏歌曲': 'add_to_favorites', '取消收藏': 'del_from_favorites', '播放列表第': 'play_music_list_index', '本地播放歌曲': 'playlocal', '查找歌曲': 'play', '下载歌曲': 'play', '暂停': 'stop', '停止': 'stop', '停止播放': 'stop', '播放歌单': 'play_music_list', '测试自定义口令': 'exec#code1("hello")', '测试链接': 'exec#httpget("https://github.com/hanxi/xiaomusic")'}, key_match_order=['分钟后关机', '播放歌曲', '下一首', '上一首', '单曲循环', '全部循环', '随机播放', '关机', '刷新列表', '播放列表第', '播放列表', '加入收藏', '收藏歌曲', '取消收藏', '播放本地歌曲', '本地播放歌曲', '查找歌曲', '下载歌曲', '暂停', '停止', '停止播放', '播放歌单', '测试自定义口令', '测试链接'], use_music_api=False, use_music_audio_id='1582971365183456177', use_music_id='355454500', log_file='/tmp/xiaomusic.txt', fuzzy_match_cutoff=0.6, enable_fuzzy_match=True, stop_tts_msg='收到,再见', enable_config_example=False, keywords_playlocal='播放本地歌曲,本地播放歌曲', keywords_play='查找歌曲,下载歌曲', keywords_stop='关机,暂停,停止,停止播放', keywords_playlist='播放列表,播放歌单', user_key_word_dict={'测试自定义口令': 'exec#code1("hello")', '测试链接': 'exec#httpget("https://github.com/hanxi/xiaomusic")'}, enable_force_stop=False, devices={'726577518': Device(did='726577518', device_id='******', hardware='LX06', name='小爱音箱Pro', play_type='', cur_music='', cur_playlist='全部'), '570867755': Device(did='570867755', device_id='*********', hardware='L15A', name='小米AI音箱(第二代)', play_type='', cur_music='', cur_playlist='全部')}, group_list='', remove_id3tag=False, convert_to_mp3=False, delay_sec=3, continue_play=False, pull_ask_sec=1, crontab_json='', enable_yt_dlp_cookies=False, get_ask_by_mina=False)
|
||||
|
||||
@@ -16,14 +16,14 @@ title: yt-dlp cookies 文件上传功能
|
||||
|
||||
1. 下载插件 [Get cookies.txt LOCALLY](https://chromewebstore.google.com/detail/cclelndahbckbenkjhflpdbgdldlbecc)
|
||||
2. 给予插件访问权限和无痕模式允许使用
|
||||

|
||||

|
||||
3. 打开无痕窗口
|
||||
4. 打开 youtube.com
|
||||
5. 登陆 youtube.com
|
||||
6. 打开新标签页
|
||||
7. 关闭 youtube.com 的标签页
|
||||
8. 保存 cookies.txt
|
||||

|
||||

|
||||
|
||||
原因见 https://github.com/yt-dlp/yt-dlp/wiki/Extractors#exporting-youtube-cookies
|
||||
|
||||
@@ -31,10 +31,10 @@ title: yt-dlp cookies 文件上传功能
|
||||
|
||||
1. 打开设置页面
|
||||
2. 设置启用yt-dlp-cookies 选项为 true
|
||||

|
||||

|
||||
3. 点击保存
|
||||
4. 再点击选择文件,选择前面保存好的 cookies.txt 文件,点击上传。
|
||||

|
||||

|
||||
|
||||
|
||||
## 后续用途
|
||||
@@ -50,7 +50,7 @@ title: yt-dlp cookies 文件上传功能
|
||||
### 评论 1 - kingfly2016
|
||||
|
||||
0.3.37的版本并没有发现可以开启yt-dlp-cookies 并上传cookies文件的地方,尝试把导出的cookies.txt手工上传到conf目录下,没有生效.
|
||||

|
||||

|
||||
|
||||
|
||||
---
|
||||
|
||||
@@ -91,5 +91,21 @@ mi.com官网重新登陆。
|
||||
|
||||
目前反馈的都是飞牛的用户,可能是飞牛有问题。
|
||||
|
||||
---
|
||||
|
||||
### 评论 7 - 3794313569
|
||||
|
||||
在同一个容器内,前后分别启动了mi-gpt和xiaomusic两个应用,现在通过日志发现,mi-gpt的日志一直在记录,语音需求基本都在mi-gpt这个应用响应了,请问下按照您现在设计的框架内,有没有办法可以实现这两个应用同时生效,或者稍后类似应用会有专用的通讯协议,保证多项应用在同一台机器上的响应。
|
||||
类似:语音命令-“播放本地歌曲”触发xiaomusic,“召唤”(mi-gpt配置的唤醒词)触发mi-gpt,等等。。。。。。
|
||||
暂时的办法就是买两个小爱音箱,不同的命名,然后一个应用配置一个did。
|
||||
|
||||
---
|
||||
|
||||
### 评论 8 - hanxi
|
||||
|
||||
> 在同一个容器内,前后分别启动了mi-gpt和xiaomusic两个应用,现在通过日志发现,mi-gpt的日志一直在记录,语音需求基本都在mi-gpt这个应用响应了,请问下按照您现在设计的框架内,有没有办法可以实现这两个应用同时生效,或者稍后类似应用会有专用的通讯协议,保证多项应用在同一台机器上的响应。 类似:语音命令-“播放本地歌曲”触发xiaomusic,“召唤”(mi-gpt配置的唤醒词)触发mi-gpt,等等。。。。。。 暂时的办法就是买两个小爱音箱,不同的命名,然后一个应用配置一个did。
|
||||
|
||||
可以分别部署到两个不同的容器里,两个应用的唤醒词是不同的,不会互相干扰。
|
||||
|
||||
---
|
||||
[链接到 GitHub Issue](https://github.com/hanxi/xiaomusic/issues/211)
|
||||
|
||||
@@ -10,7 +10,7 @@ title: 如何批量下载歌曲
|
||||
|
||||
> 默认主题 => 设置 => 歌曲下载工具
|
||||
|
||||

|
||||

|
||||
|
||||
|
||||
已经测试过 B 站和 youtube 两种播放列表,播放列表的链接是有要求,不能有其他多余参数。
|
||||
@@ -38,7 +38,7 @@ https://m.youtube.com/playlist?list=PLUD2d-pqyvT6_ztf31hx-5SsUUvY5UsQn
|
||||
默认主题 => 设置 =>没有显示找到 歌曲下载工具,
|
||||
有一个 歌单地址 歌单内容: 输入B站测试地址显示返回无效
|
||||
|
||||

|
||||

|
||||
|
||||
|
||||
---
|
||||
|
||||
@@ -223,7 +223,7 @@ def getmy_playlist(type="netease",api_host="http://127.0.0.1/api", playlist_id=N
|
||||
> 等有空我写个修改歌单内容的插件示例吧。
|
||||
|
||||
不用拉,插件我已经写出来了
|
||||

|
||||

|
||||
|
||||
|
||||
|
||||
@@ -250,7 +250,7 @@ def getmy_playlist(type="netease",api_host="http://127.0.0.1/api", playlist_id=N
|
||||
### 评论 13 - dissipator
|
||||
|
||||
# 成功了
|
||||

|
||||

|
||||
# 最好是在setting.json里去配置,我测试老是不匹配,在setting.json里去配置终于成功。可以直接调用 [NeteaseCloudMusicApi](http://localhost:3000/docs/#/?id=neteasecloudmusicapi) 接口,甚至使用UnblockNeteaseMusic 解锁灰色,但是代码需要小调整。
|
||||
|
||||
setting.json
|
||||
@@ -490,8 +490,8 @@ async def getmy_playlist(type="netease",api_host="http://127.0.0.1/api", playlis
|
||||
|
||||
### 评论 14 - dissipator
|
||||
|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
|
||||
---
|
||||
@@ -500,7 +500,7 @@ async def getmy_playlist(type="netease",api_host="http://127.0.0.1/api", playlis
|
||||
|
||||
NeteaseCloudMusicApi似乎获取不到播放地址?其他信息倒是有。
|
||||
|
||||

|
||||

|
||||
|
||||
|
||||
---
|
||||
|
||||
@@ -10,7 +10,7 @@ M01:在0.3.55版本【型号兼容模式】与【特殊型号获取对话记录
|
||||
型号:S12A、LX04、S12 在米家APP可以联动,比如客厅有人自定义指令:播放歌曲、关机...等
|
||||
而M01无论【型号兼容模式】与【特殊型号获取对话记录】设为false或true,都无法执行任何自定义指令…
|
||||
|
||||

|
||||

|
||||
|
||||
|
||||
## 评论
|
||||
|
||||
@@ -16,10 +16,10 @@ title: xiaomusic极空间安装教程(2024/12/4更新)
|
||||
|
||||
1. 在 **搜索框** 中输入 `hanxi/xiaomusic`,在搜索的结果中直接选择第一个,点击**下载**
|
||||
|
||||

|
||||

|
||||
|
||||
2. 在新弹出的版本选择窗口中,根据你的情况选择。
|
||||

|
||||

|
||||
|
||||
### 版本说明
|
||||
- 获取 **最新版** 直接点击 **下载** 即可,建议使用默认的 `latest`
|
||||
@@ -28,7 +28,7 @@ title: xiaomusic极空间安装教程(2024/12/4更新)
|
||||
|
||||
|
||||
3. 接着弹出如图所示的页面,耐心等待下载完成。
|
||||

|
||||

|
||||
|
||||
|
||||
4. 下载完成后切换到 **本地镜像** 选项卡
|
||||
@@ -37,16 +37,16 @@ title: xiaomusic极空间安装教程(2024/12/4更新)
|
||||
|
||||
## 国内环境:
|
||||
1. 打开docker,在左侧的菜单中选择 **镜像** 切换到 **仓库** 选项卡,点击 **自定义拉取** 按钮
|
||||

|
||||

|
||||
2. 在弹出的对话框中输入 ` m.daocloud.io/docker.io/hanxi/xiaomusic ` ,点击 **拉取** 按钮
|
||||

|
||||

|
||||
3. 下载完成后切换到 **本地镜像** 选项卡
|
||||
|
||||
# 部署镜像
|
||||
1. 找到刚才已经拉取好的镜像,*单击选中*,点击 **添加到容器**
|
||||

|
||||

|
||||
2. 在弹出的 **创建容器** 菜单中,切换到 **文件夹路径** 选项卡中,按图中的提示进行配置。
|
||||

|
||||

|
||||
|
||||
**注意:**
|
||||
* 装载路径中的 **配置文件目录** 和 **音乐目录** 必须进行配置。
|
||||
@@ -60,7 +60,7 @@ title: xiaomusic极空间安装教程(2024/12/4更新)
|
||||
3. 切换到 **端口** 选项卡,修改成与你的极空间 *不冲突* 的本地端口号,如 `5678` (示例按照本地端口号5678来进行配置,下同)
|
||||
> 友情提醒: 尽量不要修改容器端口号,否则要到配置文件目录修改对应的`setting.json`文件中的配置,会增加很多麻烦
|
||||
|
||||

|
||||

|
||||
|
||||
5. 切换到 **环境** 选项卡,将`XIAOMUSIC_HOSTNAME` 修改为你的 **极空间的IP地址**
|
||||
> 友情提醒:
|
||||
@@ -68,26 +68,26 @@ title: xiaomusic极空间安装教程(2024/12/4更新)
|
||||
> 2. 不要尝试修改XIAOMUSIC_PORT!除非你没有看上一条的友情提醒
|
||||
> 3. 不要在此处配置`ACCOUNT`和`PASSWORD`,没有过风控仍然无法使用!上古时代的教程不要再看了,容易走火入魔!
|
||||
|
||||

|
||||

|
||||
|
||||
6. 点击 **应用**按钮,此时容器已经配置完成了,切换到左侧的 **容器概况** 菜单,可查看容器详情
|
||||

|
||||

|
||||
|
||||
# 进入xiaomusic网页端进行配置
|
||||
1.请关闭代理,打开浏览器,地址栏输入 **极空间IP:本地端口号** 如`192.168.2.5:5678`,打开网页后点击 **默认主题**
|
||||
|
||||

|
||||

|
||||
|
||||
**注意:**
|
||||
* 不要复制此处的地址,必须输入极空间的IP地址。不知道的建议上咸鱼50块换个不锈钢盆
|
||||
* 不要输入容器的端口号8090,极空间不能使用这个端口号。
|
||||
|
||||
2. 点击 **设置** 按钮进入设置页面
|
||||

|
||||

|
||||
|
||||
3. 输入**小米账号**、**小米密码**、**XIAOMUSIC_HOSTNAME(IP或域名):**、**外网访问端口**,滑到页面最下方点击 **保存**
|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
**注意:**
|
||||
* 小米账号非手机号,请在手机设置-个人中心中查看小米ID
|
||||
@@ -95,10 +95,10 @@ title: xiaomusic极空间安装教程(2024/12/4更新)
|
||||
* XIAOMUSIC_HOSTNAME(IP或域名): 可以输入当前页面的IP地址(在地址栏),**不要在此处输入端口号!!!**,如果域名需要使用https协议,请加上https://
|
||||
|
||||
4.如果以上步骤没错,你将在设置中心看见设备列表
|
||||

|
||||

|
||||
|
||||
5. 回到首页,出现设备列表,切换对应设备即可畅享
|
||||

|
||||

|
||||
|
||||
|
||||
## 评论
|
||||
@@ -108,7 +108,7 @@ title: xiaomusic极空间安装教程(2024/12/4更新)
|
||||
|
||||
[xiaomusic.txt](https://github.com/user-attachments/files/18011572/xiaomusic.txt)
|
||||
|
||||
<img width="559" alt="截屏2024-12-05 00 43 24" src="https://github.hanxi.cc/proxy/user-attachments/assets/160aeacc-e1c0-40fa-b219-6b6f5183c43c">
|
||||
<img width="559" alt="截屏2024-12-05 00 43 24" src="https://gproxy.hanxi.cc/proxy/user-attachments/assets/160aeacc-e1c0-40fa-b219-6b6f5183c43c">
|
||||
an'zh
|
||||
无法使用语音播放歌曲,小爱s12a。极空间z4pro。
|
||||
1. 按照教程,点击播放本地歌曲,提示hostname和设置的端口映射不匹配。映射5678,容器端口8090.
|
||||
@@ -128,10 +128,10 @@ an'zh
|
||||
### 评论 3 - xiaohuobanhahaha
|
||||
|
||||
我没讲清楚。我试了两种极空间的桥接和host模式。桥接模式。我按照教程走的。报错如图
|
||||
<img width="847" alt="截屏2024-12-05 01 46 52" src="https://github.hanxi.cc/proxy/user-attachments/assets/e7f58907-a216-41e8-bafa-5d49db8eca45">
|
||||
<img width="516" alt="截屏2024-12-05 01 49 11" src="https://github.hanxi.cc/proxy/user-attachments/assets/4261c2e2-fe0c-4ff6-ae06-ead7f928af57">
|
||||
<img width="647" alt="截屏2024-12-05 01 47 02" src="https://github.hanxi.cc/proxy/user-attachments/assets/35b195d1-9512-40bb-b336-847e0bb2e6c9">
|
||||
<img width="667" alt="截屏2024-12-05 01 47 15" src="https://github.hanxi.cc/proxy/user-attachments/assets/b917a977-38cf-4126-8754-c46abe9360a2">
|
||||
<img width="847" alt="截屏2024-12-05 01 46 52" src="https://gproxy.hanxi.cc/proxy/user-attachments/assets/e7f58907-a216-41e8-bafa-5d49db8eca45">
|
||||
<img width="516" alt="截屏2024-12-05 01 49 11" src="https://gproxy.hanxi.cc/proxy/user-attachments/assets/4261c2e2-fe0c-4ff6-ae06-ead7f928af57">
|
||||
<img width="647" alt="截屏2024-12-05 01 47 02" src="https://gproxy.hanxi.cc/proxy/user-attachments/assets/35b195d1-9512-40bb-b336-847e0bb2e6c9">
|
||||
<img width="667" alt="截屏2024-12-05 01 47 15" src="https://gproxy.hanxi.cc/proxy/user-attachments/assets/b917a977-38cf-4126-8754-c46abe9360a2">
|
||||
|
||||
提到的第二个问题和日志,是我将网络模式改为host的情况,能连上音箱,但是没法使用语音控制。
|
||||
|
||||
@@ -186,8 +186,8 @@ an'zh
|
||||
|
||||
### 评论 9 - xiaohuobanhahaha
|
||||
|
||||
<img width="660" alt="截屏2024-12-05 02 23 53" src="https://github.hanxi.cc/proxy/user-attachments/assets/b9d26de9-3dcf-4e65-9460-36603735c887">
|
||||
<img width="780" alt="截屏2024-12-05 02 24 49" src="https://github.hanxi.cc/proxy/user-attachments/assets/6a204cdb-bb10-4f35-822d-613aeed0fae0">
|
||||
<img width="660" alt="截屏2024-12-05 02 23 53" src="https://gproxy.hanxi.cc/proxy/user-attachments/assets/b9d26de9-3dcf-4e65-9460-36603735c887">
|
||||
<img width="780" alt="截屏2024-12-05 02 24 49" src="https://gproxy.hanxi.cc/proxy/user-attachments/assets/6a204cdb-bb10-4f35-822d-613aeed0fae0">
|
||||
|
||||
|
||||
> > 确实是变了。192.168.31.143是我电脑的ip。 hostname='192.168.31.165'是极空间的。小爱是192.168.31.77。现在我的网络结构是电脑连nas上的istoreos旁路由。nas直连主路由,小爱直连主路由。主路由dhcp都绑定了。 大佬,这种情况该怎么解决呢。所有设置都是默认,没修改哈。
|
||||
|
||||
@@ -256,7 +256,7 @@ stderr: [08:58:10] [0.3.37] [INFO] xiaomusic.py:1094: 播放 80后音悦台 失
|
||||
### 评论 5 - 201692929
|
||||
|
||||
怎么获取 他正在播放什么?或者是播放进度 ?播放列表?我想给他加进去
|
||||

|
||||

|
||||
|
||||
|
||||
---
|
||||
@@ -308,20 +308,20 @@ potplayer里播放完全正常~~
|
||||
> 发出来看看?
|
||||
|
||||
经过实验发现,本地生成的m3u用potplayer播放正常
|
||||

|
||||

|
||||
转换为json(去掉"type":"radio")后用小爱播放也正常
|
||||

|
||||

|
||||
|
||||
但是alist链接就不正常,alist生成的m3u格式如下
|
||||
`#EXTM3U
|
||||
#EXTINF:-1,Let Me Hear.mp3
|
||||
http://192.168.1.198:5244/d/%E7%BD%91%E6%98%93%E4%BA%91%E9%9F%B3%E4%B9%90%20%E9%9F%B3%E4%B9%90%E4%BA%91%E7%9B%98/Let%20Me%20Hear.mp3?sign=xxxx=:0`
|
||||
没有时长信息,但是用potplayer一播放就出现时长了
|
||||

|
||||

|
||||
而用小爱播放就始终没有时长(切歌、等待都试过了)
|
||||

|
||||

|
||||
大佬你的示例链接(gist.github.com/hanxi/dda82d964a28f8110f8fba81c3ff8314)里的又是正常的,感觉可能是alist的流比较特殊。。
|
||||

|
||||

|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ title: 微信交流群二维码
|
||||
|
||||
# 微信交流群二维码
|
||||
|
||||

|
||||

|
||||
|
||||
|
||||
## 评论
|
||||
@@ -24,7 +24,7 @@ title: 微信交流群二维码
|
||||
|
||||
### 评论 3 - hanxi
|
||||
|
||||

|
||||

|
||||
|
||||
|
||||
---
|
||||
|
||||
@@ -8,15 +8,15 @@ title: 如何添加m3u格式文件的电台
|
||||
|
||||
1. 复制文件内容,粘贴到 m3u 转换工具里,点击转换为 json 格式:
|
||||
|
||||

|
||||

|
||||
|
||||
2. 然后复制 json 内容,粘贴到歌单内容里,点击保存,再返回首页:
|
||||
|
||||

|
||||

|
||||
|
||||
3. 在首页点击刷新列表,选择所有电台,再点击播放列表歌曲:
|
||||
|
||||

|
||||

|
||||
|
||||
4. 也可以用口令播放电台: `播放列表所有电台` ,或者口令: `播放歌曲北京城市广播`
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ pip install xiaomusic
|
||||
|
||||
依赖的 ffmpeg 需要自己安装。
|
||||
|
||||

|
||||

|
||||
|
||||
仓库中有个 config-example.json 文件,可以把这个文件拷贝为 config.json 然后修改 config.json 里的配置,再用下面的命令启动。
|
||||
|
||||
|
||||
@@ -6,9 +6,9 @@ title: ios系统上的捷径配置
|
||||
|
||||
下面是播放音乐和关机两个示例。只要在 web 页面上能看到的功能,都有对应的 http 请求接口,都可以用来配置捷径。
|
||||
|
||||

|
||||

|
||||
|
||||

|
||||

|
||||
|
||||
|
||||
## 评论
|
||||
|
||||
@@ -201,7 +201,7 @@ RUN pip install -U xiaomusic
|
||||
> ```
|
||||
|
||||
我直接用pip安装好之后,执行仍然有缺少的依赖,和docker里缺的一样。截图的module安装了之后还会有其他依赖缺失
|
||||

|
||||

|
||||
|
||||
|
||||
---
|
||||
@@ -236,7 +236,7 @@ RUN pip install -U xiaomusic
|
||||
### 评论 9 - sqmcool
|
||||
|
||||
为什么我的没有显示设备?
|
||||

|
||||

|
||||
|
||||
|
||||
---
|
||||
@@ -252,7 +252,7 @@ RUN pip install -U xiaomusic
|
||||
### 评论 11 - schppd
|
||||
|
||||
楼主您好,请问这个我需要怎么处理?
|
||||

|
||||

|
||||
|
||||
|
||||
---
|
||||
@@ -316,7 +316,7 @@ You are receiving this because you commented.Message ID: ***@***.***>
|
||||
|
||||
### 评论 16 - agigogo
|
||||
|
||||

|
||||

|
||||
在docker里可以运行,但是没法播放设置页面中的播放链接,选中设备那里是空的,是不是没成功?怎么调整?
|
||||
|
||||
|
||||
@@ -342,7 +342,7 @@ You are receiving this because you commented.Message ID: ***@***.***>
|
||||
>
|
||||
> 设置页面输入小米的账号密码后,再勾选一个设备。
|
||||
|
||||

|
||||

|
||||
设置页面没有可勾选项?
|
||||
|
||||
---
|
||||
@@ -363,7 +363,7 @@ You are receiving this because you commented.Message ID: ***@***.***>
|
||||
>
|
||||
>  设置页面没有可勾选项?
|
||||
|
||||

|
||||

|
||||
|
||||
显示未检测到设备,设备型号是MDZ-25-DA
|
||||
|
||||
@@ -421,9 +421,9 @@ You are receiving this because you commented.Message ID: ***@***.***>
|
||||
|
||||
### 评论 27 - zealler9560
|
||||
|
||||

|
||||

|
||||
|
||||
istore系统可以拉取创建镜像,但是无法启动,错误提示见图一,求助大佬!路由器信息见图二
|
||||
istore系统可以拉取创建镜像,但是无法启动,错误提示见图一,求助大佬!路由器信息见图二
|
||||
|
||||
|
||||
|
||||
@@ -626,8 +626,8 @@ You are receiving this because you commented.Message ID: ***@***.***>
|
||||
|
||||
### 评论 41 - CallEdison
|
||||
|
||||

|
||||

|
||||

|
||||

|
||||
问题一:能进控制面板,进不了设置页面,容器没有log生成,我昨天已经设置好了,现在功能能正常使用,但是进不了设置页面了问题二:昨天能进的时候发现本地下载目录有歌曲,但是设置里面的全部歌曲里面没有,搜索框搜索又能搜的到。
|
||||
|
||||
---
|
||||
@@ -719,7 +719,7 @@ You are receiving this because you commented.Message ID: ***@***.***>
|
||||
|
||||
### 评论 47 - like1020
|
||||
|
||||

|
||||

|
||||
请教一下,本地列表歌单里的歌曲即便设置为全部循环或随机播放,依然是不断地单曲循环,只能自己手动点下一首,请问是什么情况?
|
||||
|
||||
---
|
||||
|
||||
@@ -1,5 +1,19 @@
|
||||
# 版本日志
|
||||
|
||||
## v0.3.65 (2024-12-24)
|
||||
|
||||
### Fix
|
||||
|
||||
- 处理图像报错
|
||||
- 修改歌单名字漏更新歌单列表
|
||||
- 修复获取自定义歌单接口报错
|
||||
|
||||
## v0.3.64 (2024-12-22)
|
||||
|
||||
### Fix
|
||||
|
||||
- 使用自己架设的 sentry 服务,解决 Cloudflare 额度超量问题
|
||||
|
||||
## v0.3.63 (2024-12-22)
|
||||
|
||||
### Perf
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[project]
|
||||
name = "xiaomusic"
|
||||
version = "0.3.64"
|
||||
version = "0.3.66"
|
||||
description = "Play Music with xiaomi AI speaker"
|
||||
authors = [
|
||||
{name = "涵曦", email = "im.hanxi@gmail.com"},
|
||||
|
||||
@@ -17,7 +17,8 @@ command=/app/.venv/bin/python3 /app/xiaomusic.py
|
||||
directory=/app
|
||||
autostart=true
|
||||
autorestart=true
|
||||
startretries=0
|
||||
startretries=99999
|
||||
startsecs=60
|
||||
stderr_logfile=/app/xiaomusic.log.txt
|
||||
stdout_logfile=/app/xiaomusic.log.txt
|
||||
|
||||
|
||||
@@ -1,8 +1,29 @@
|
||||
from xiaomusic.utils import (
|
||||
remove_common_prefix,
|
||||
)
|
||||
import re
|
||||
|
||||
|
||||
def removepre(filename):
|
||||
match = re.search(r"^(\d+)\s+\d*(.+?)\.(.*$)", filename.strip())
|
||||
new_filename = filename
|
||||
if match:
|
||||
num = match.group(1)
|
||||
name = match.group(2).replace(".", " ").strip()
|
||||
suffix = match.group(3)
|
||||
# print(name)
|
||||
# print(num)
|
||||
# print(suffix)
|
||||
new_filename = f"{num}.{name}.{suffix}"
|
||||
|
||||
print(filename, "=>", new_filename)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
remove_common_prefix(
|
||||
"./tmp/【无损音质】2024年9月酷狗热歌榜TOP100合集(只选热歌最高的)首首王炸,分P合集!"
|
||||
)
|
||||
removepre(" 17 《白色风车》.mp3")
|
||||
removepre(" 17 《白色风车》.mp3")
|
||||
removepre(" 17 17 《白色风车》.mp3")
|
||||
removepre(" 17 17 《白色风车》.mp3")
|
||||
|
||||
removepre(" 18 风车.mp3")
|
||||
removepre(" 18 色风车.mp3")
|
||||
removepre(" 18 18 你好.mp3")
|
||||
removepre(" 18 18 我好.mp3")
|
||||
removepre("09 009. 梁静茹-亲亲.mp3")
|
||||
|
||||
@@ -1 +1 @@
|
||||
__version__ = "0.3.64"
|
||||
__version__ = "0.3.66"
|
||||
|
||||
@@ -2,7 +2,6 @@ import asyncio
|
||||
import hashlib
|
||||
import json
|
||||
import os
|
||||
import re
|
||||
import secrets
|
||||
import shutil
|
||||
import tempfile
|
||||
@@ -580,6 +579,7 @@ async def playlistupdatename(
|
||||
@app.get("/playlistnames")
|
||||
async def getplaylistnames(Verifcation=Depends(verification)):
|
||||
names = xiaomusic.get_play_list_names()
|
||||
log.info(f"names {names}")
|
||||
return {
|
||||
"ret": "OK",
|
||||
"names": names,
|
||||
@@ -688,9 +688,6 @@ def access_key_verification(file_path, key, code):
|
||||
return False
|
||||
|
||||
|
||||
range_pattern = re.compile(r"bytes=(\d+)-(\d*)")
|
||||
|
||||
|
||||
def safe_redirect(url):
|
||||
url = try_add_access_control_param(config, url)
|
||||
url = url.replace("\\", "")
|
||||
|
||||
@@ -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=1734837788">
|
||||
<link rel="stylesheet" type="text/css" href="./main.css?version=1735173824">
|
||||
<script src="https://unpkg.com/vconsole@latest/dist/vconsole.min.js"></script>
|
||||
<script src="./jquery-3.7.1.min.js?version=1734837788"></script>
|
||||
<script src="./jquery-3.7.1.min.js?version=1735173824"></script>
|
||||
|
||||
<!-- Google tag (gtag.js) -->
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id=G-Z09NC1K7ZW"></script>
|
||||
|
||||
@@ -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=1734837788">
|
||||
<script src="./jquery-3.7.1.min.js?version=1734837788"></script>
|
||||
<link rel="stylesheet" type="text/css" href="./main.css?version=1735173824">
|
||||
<script src="./jquery-3.7.1.min.js?version=1735173824"></script>
|
||||
|
||||
<!-- Google tag (gtag.js) -->
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id=G-Z09NC1K7ZW"></script>
|
||||
|
||||
@@ -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=1734837788"></script>
|
||||
<link rel="stylesheet" href="./main.css?version=1734837788">
|
||||
<script src="./jquery-3.7.1.min.js?version=1735173824"></script>
|
||||
<link rel="stylesheet" href="./main.css?version=1735173824">
|
||||
<link rel="icon" href="./favicon.ico">
|
||||
|
||||
<!-- Google tag (gtag.js) -->
|
||||
@@ -220,7 +220,7 @@
|
||||
Powered by XiaoMusic
|
||||
</div>
|
||||
|
||||
<script src="./md.js?version=1734837788">
|
||||
<script src="./md.js?version=1735173824">
|
||||
</script>
|
||||
</body>
|
||||
|
||||
|
||||
@@ -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=1734837788">
|
||||
<link rel="stylesheet" type="text/css" href="./main.css?version=1735173824">
|
||||
|
||||
<!-- Google tag (gtag.js) -->
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id=G-Z09NC1K7ZW"></script>
|
||||
|
||||
@@ -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=1734837788"></script>
|
||||
<script src="./setting.js?version=1734837788"></script>
|
||||
<link rel="stylesheet" type="text/css" href="./main.css?version=1734837788">
|
||||
<script src="./jquery-3.7.1.min.js?version=1735173824"></script>
|
||||
<script src="./setting.js?version=1735173824"></script>
|
||||
<link rel="stylesheet" type="text/css" href="./main.css?version=1735173824">
|
||||
|
||||
<!-- Google tag (gtag.js) -->
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id=G-Z09NC1K7ZW"></script>
|
||||
|
||||
@@ -643,14 +643,19 @@ def _save_picture(picture_data, save_root, file_path):
|
||||
try:
|
||||
_resize_save_image(picture_data, picture_path)
|
||||
except Exception as e:
|
||||
log.exception(f"Error _resize_save_image: {e}")
|
||||
log.warning(f"Error _resize_save_image: {e}")
|
||||
return picture_path
|
||||
|
||||
|
||||
def _resize_save_image(image_bytes, save_path, max_size=300):
|
||||
# 将 bytes 转换为 PIL Image 对象
|
||||
image = Image.open(io.BytesIO(image_bytes))
|
||||
image = image.convert("RGB")
|
||||
image = None
|
||||
try:
|
||||
image = Image.open(io.BytesIO(image_bytes))
|
||||
image = image.convert("RGB")
|
||||
except Exception as e:
|
||||
log.warning(f"Error _resize_save_image: {e}")
|
||||
return
|
||||
|
||||
# 获取原始尺寸
|
||||
original_width, original_height = image.size
|
||||
@@ -960,7 +965,7 @@ def remove_common_prefix(directory):
|
||||
|
||||
log.info(f'Common prefix identified: "{common_prefix}"')
|
||||
|
||||
pattern = re.compile(r"(\d+)[\t ]*\1")
|
||||
pattern = re.compile(r"^(\d+)\s+\d*(.+?)\.(.*$)")
|
||||
for filename in files:
|
||||
if filename == common_prefix:
|
||||
continue
|
||||
@@ -968,9 +973,12 @@ def remove_common_prefix(directory):
|
||||
if filename.startswith(common_prefix):
|
||||
# 构造新的文件名
|
||||
new_filename = filename[len(common_prefix) :]
|
||||
match = pattern.match(new_filename)
|
||||
match = pattern.search(new_filename.strip())
|
||||
if match:
|
||||
new_filename = match.group(1) + new_filename[match.end() :]
|
||||
num = match.group(1)
|
||||
name = match.group(2).replace(".", " ").strip()
|
||||
suffix = match.group(3)
|
||||
new_filename = f"{num}.{name}.{suffix}"
|
||||
# 生成完整的文件路径
|
||||
old_file_path = os.path.join(directory, filename)
|
||||
new_file_path = os.path.join(directory, new_filename)
|
||||
@@ -1055,7 +1063,7 @@ async def update_version(version: str, lite: bool = True):
|
||||
log.warning(f"update_version failed: {arch}")
|
||||
return arch
|
||||
# https://github.com/hanxi/xiaomusic/releases/download/main/app-amd64-lite.tar.gz
|
||||
url = f"https://github.hanxi.cc/proxy/hanxi/xiaomusic/releases/download/{version}/app-{arch}{lite_tag}.tar.gz"
|
||||
url = f"https://gproxy.hanxi.cc/proxy/hanxi/xiaomusic/releases/download/{version}/app-{arch}{lite_tag}.tar.gz"
|
||||
target_directory = "/app"
|
||||
return await download_and_extract(url, target_directory)
|
||||
|
||||
|
||||
@@ -76,6 +76,7 @@ class XiaoMusic:
|
||||
self.all_music = {}
|
||||
self._all_radio = {} # 电台列表
|
||||
self.music_list = {} # 播放列表 key 为目录名, value 为 play_list
|
||||
self.default_music_list_names = [] # 非自定义个歌单
|
||||
self.devices = {} # key 为 did
|
||||
self.running_task = []
|
||||
self.all_music_tags = {} # 歌曲额外信息
|
||||
@@ -699,6 +700,9 @@ class XiaoMusic:
|
||||
for _, play_list in self.music_list.items():
|
||||
play_list.sort(key=custom_sort_key)
|
||||
|
||||
# 非自定义个歌单
|
||||
self.default_music_list_names = list(self.music_list.keys())
|
||||
|
||||
# 刷新自定义歌单
|
||||
self.refresh_custom_play_list()
|
||||
|
||||
@@ -717,6 +721,11 @@ class XiaoMusic:
|
||||
|
||||
def refresh_custom_play_list(self):
|
||||
try:
|
||||
# 删除旧的自定义个歌单
|
||||
for k in list(self.music_list.keys()):
|
||||
if k not in self.default_music_list_names:
|
||||
del self.music_list[k]
|
||||
# 合并新的自定义个歌单
|
||||
custom_play_list = self.get_custom_play_list()
|
||||
for k, v in custom_play_list.items():
|
||||
self.music_list[k] = list(v)
|
||||
@@ -1171,12 +1180,13 @@ class XiaoMusic:
|
||||
play_list = custom_play_list[oldname]
|
||||
custom_play_list.pop(oldname)
|
||||
custom_play_list[newname] = play_list
|
||||
self.save_custom_play_list()
|
||||
return True
|
||||
|
||||
# 获取所有自定义歌单
|
||||
def get_play_list_names(self):
|
||||
custom_play_list = self.get_custom_play_list()
|
||||
return custom_play_list.keys()
|
||||
return list(custom_play_list.keys())
|
||||
|
||||
# 获取歌单中所有歌曲
|
||||
def play_list_musics(self, name):
|
||||
|
||||
Reference in New Issue
Block a user