1
0
mirror of https://github.com/hanxi/xiaomusic.git synced 2026-04-05 12:05:06 +08:00
Commit Graph

1870 Commits

Author SHA1 Message Date
hejun041
311b75cb8e fix: proxy handler CDN safeguard & content-type based FFmpeg routing (#791)
- 用精确域名后缀匹配替代 mcdn/hdslb 子串匹配,避免误伤其他插件
- 电台流(is_radio=True)跳过 bilibili FFmpeg 路径
- _bilibili_ffmpeg_stream 泛化为 _ffmpeg_mp3_stream,支持可选 extra_headers
- 新增 Content-Type 兜底:非 bilibili CDN 返回 video/mp4 或 audio/aac 时同样走 FFmpeg 转码

Co-authored-by: hejun041 <hejun041@gmail.com>
2026-03-20 10:34:19 +08:00
Issues Docs [BOT]
3f0bd174e8 Auto-Generate docs 🤖 2026-03-20 01:01:27 +00:00
Issues Docs [BOT]
ecdd512e03 Auto-Generate docs 🤖 2026-03-19 15:18:59 +00:00
涵曦
b0f3f3c67c update doc 2026-03-19 23:16:25 +08:00
涵曦
f4a50722d9 bump: version 0.4.24 → 0.4.25 v0.4.25 2026-03-19 22:29:59 +08:00
涵曦
322ad7d22e build: update static version 2026-03-19 22:29:13 +08:00
Formatter [BOT]
c2ab2e7e2e Auto-format code 🧹🌟🤖 2026-03-19 07:07:15 +00:00
hejun041
e1e83d02bc fix: proxy url too long for xiaomi speaker (#786)
* fix: use short token proxy URL to avoid firmware URL length limit on Xiaomi speakers

Small Xiaomi speakers (e.g. LX06) have an HTTP client URL length limit
of ~1024 bytes. The previous implementation base64-encoded the full
plugin-url (which itself contains a large base64 JSON payload) and
appended it as a query parameter, resulting in URLs of ~1500+ characters.
This caused the speaker firmware to truncate the request, returning 400
and triggering a playback failure.

Fix:
- In `music_library.py`: `_get_proxy_url` now generates a short
  random token (10 chars) via `secrets.token_urlsafe(8)`, stores the
  original URL in an in-memory cache `_proxy_token_cache`, and returns
  a short URL like `/proxy/music?token=<token>` (~60 chars total).
- In `api/routers/file.py`: `/proxy/{type}` route now accepts an
  optional `token` parameter. When present, it looks up the original
  URL from the cache and proxies it. The `urlb64` mode is kept for
  backward compatibility.
- Tokens are not consumed on first use, allowing both the speaker and
  ffprobe to make multiple requests for the same track.

Tested on LX06 (小爱音箱Pro) with bilibili online music plugin.

* refactor: move _proxy_token_cache to music_library.py to avoid circular import

* fix: bilibili CDN aiohttp proxy + FFmpeg transcode to MP3 for LX06 compatibility

- Detect bilivideo/mcdn/hdslb domains in redirect loop and switch to _bilibili_ffmpeg_stream
- Use aiohttp to download MP4 (with Referer/Origin) and pipe to FFmpeg stdin to avoid CDN 403
- FFmpeg transcodes to MP3 (libmp3lame 128k) for LX06 firmware compatibility
- Fixes: FFmpeg direct CDN access returns 403, LX06 cannot play raw MP4/AAC stream

* refactor: use get/set functions for proxy token cache instead of direct import

---------

Co-authored-by: hejun041 <hejun041@users.noreply.github.com>
2026-03-19 15:06:45 +08:00
birdstudy-nj
1f551d59a3 新增本地搜索,及保存为歌单。UI和歌曲刮削做了调整。 (#787) 2026-03-19 15:03:26 +08:00
涵曦
e53eb730f0 Revert "移除文档生成"
This reverts commit ff54e9df95.
2026-03-17 23:19:39 +08:00
涵曦
d68108ba9a fix: 无法上传音乐 close #783 2026-03-14 20:05:59 +08:00
涵曦
6651341821 bump: version 0.4.23 → 0.4.24 v0.4.24 2026-03-13 23:15:28 +08:00
涵曦
628a4a5146 build: update static version 2026-03-13 23:15:23 +08:00
boluofan
064238744a feat:【默认主题】增加[在线搜索]按钮 (#782) 2026-03-13 09:27:09 +08:00
birdstudy-nj
66b837bc56 新增长按歌曲,添加/删除收藏 (#781) 2026-03-12 20:49:04 +08:00
涵曦
13030fa5ab 修复无法收藏歌曲的问题 2026-03-11 10:05:21 +08:00
涵曦
fedac35a4c 修复无法收藏歌曲的问题 2026-03-11 09:58:37 +08:00
涵曦
c3183f22de fix: 修复无法收藏歌曲的问题 2026-03-10 19:09:41 +08:00
birdstudy-nj
9adc76012b 重写了歌曲刮削,若干UI界面微调,修复推送bug (#779) 2026-03-10 18:43:37 +08:00
birdstudy-nj
f5c898b14d 重写了歌曲刮削,若干UI界面微调 (#778) 2026-03-10 16:49:01 +08:00
涵曦
757a71af79 format code 2026-03-06 22:05:05 +08:00
涵曦
9987425a43 format code 2026-03-06 20:42:05 +08:00
birdstudy-nj
774792318e feat: 新增适配iPhone主题 (#775)
* Create iwebplayer.html

* Add link for iPhone theme adaptation
2026-03-05 19:09:43 +08:00
GanHuaLin
17d5218845 feat: Add 肉肉音乐TV link to index.html (#773)
Added link to 肉肉音乐TV in options list.
2026-03-04 11:16:23 +08:00
boluofan
9741376307 feature: 在线搜索优化 (#774)
* 1. 移除【TuneFree API】接口及配置
2. 修复自动加歌时顺序被打乱和不生效bug
3. 修复online歌单歌曲顺序混乱问题

* 修改前端样式
2026-03-04 11:15:49 +08:00
GanHuaLin
23c9d9ae02 docs: 增加 TV 客户端 rouroumusic-tv 到配套应用列表 (#772)
* docs: 增加配套应用 肉肉音乐TV

* docs: 增加配套应用 肉肉音乐TV
2026-03-04 09:49:19 +08:00
涵曦
ff54e9df95 移除文档生成 2026-03-03 13:51:40 +08:00
Issues Docs [BOT]
6c6a9081fb Auto-Generate docs 🤖 2026-02-25 04:49:26 +00:00
Issues Docs [BOT]
54d5dc0007 Auto-Generate docs 🤖 2026-02-22 14:23:31 +00:00
Issues Docs [BOT]
62866a5a7c Auto-Generate docs 🤖 2026-02-22 12:09:17 +00:00
Issues Docs [BOT]
80c3ef3fcf Auto-Generate docs 🤖 2026-02-20 09:01:54 +00:00
涵曦
7587ee5ba2 Update README.md 2026-02-20 17:00:00 +08:00
Issues Docs [BOT]
351097b020 Auto-Generate docs 🤖 2026-02-19 15:05:45 +00:00
Issues Docs [BOT]
c23e696995 Auto-Generate docs 🤖 2026-02-17 11:22:34 +00:00
涵曦
5507af45ec bump: version 0.4.22 → 0.4.23 v0.4.23 2026-02-17 19:20:30 +08:00
涵曦
d2c4195e29 build: update static version 2026-02-17 19:20:25 +08:00
Issues Docs [BOT]
565fea8de6 Auto-Generate docs 🤖 2026-02-13 15:47:58 +00:00
Issues Docs [BOT]
5504cd657d Auto-Generate docs 🤖 2026-02-13 07:49:13 +00:00
fragrans
9902039536 fix: 漏提交base64 (#761)
* Update setting.css

高级设置改为tab结构,减少滚动

* Update setting.html

高级设置改为tab结构,减少滚动

* Update setting.js

高级设置改为tab结构,减少滚动;
扫码登录改为jQuery

* 修改获取所有设备接口

* 增加手动获取设备

* 获取设备列表

* fix:缺少导入

* fix

* 修改二维码图标

* 二维码登录tab兼容手机版页面

* fix:生成二维码在手机端溢出显示

* 增加返回二维码超时时间

* 页面增加二维码超时倒计时

* fix: config漏提交qrcode_timeout配置

* fix: 漏提交导入base64
2026-02-13 13:49:21 +08:00
fragrans
9825bea351 fix:漏提交qrcode_timeout配置 (#759)
* Update setting.css

高级设置改为tab结构,减少滚动

* Update setting.html

高级设置改为tab结构,减少滚动

* Update setting.js

高级设置改为tab结构,减少滚动;
扫码登录改为jQuery

* 修改获取所有设备接口

* 增加手动获取设备

* 获取设备列表

* fix:缺少导入

* fix

* 修改二维码图标

* 二维码登录tab兼容手机版页面

* fix:生成二维码在手机端溢出显示

* 增加返回二维码超时时间

* 页面增加二维码超时倒计时

* fix: config漏提交qrcode_timeout配置
2026-02-13 12:42:00 +08:00
fragrans
42bc75df97 增加手动获取设备列表以及高级配置改为Tab结构 (#753)
* Update setting.css

高级设置改为tab结构,减少滚动

* Update setting.html

高级设置改为tab结构,减少滚动

* Update setting.js

高级设置改为tab结构,减少滚动;
扫码登录改为jQuery

* 修改获取所有设备接口

* 增加手动获取设备

* 获取设备列表

* fix:缺少导入

* fix

* 修改二维码图标

* 二维码登录tab兼容手机版页面

* fix:生成二维码在手机端溢出显示

* 增加返回二维码超时时间

* 页面增加二维码超时倒计时
2026-02-13 11:14:14 +08:00
fragrans
1dd2ebcbb0 fix:生成二维码缺少导入模块 (#758) 2026-02-13 11:13:23 +08:00
hpcll
de338d3b39 feat(api): support playlist_name in downloadonemusic (#756)
Co-authored-by: pc hu <>
2026-02-13 07:28:39 +08:00
Issues Docs [BOT]
b2749e1d13 Auto-Generate docs 🤖 2026-02-11 15:06:01 +00:00
hpcll
ce3b4065b8 feat(api): support downloadonemusic dirname under music_path (#751)
Co-authored-by: pc hu <>
2026-02-11 22:58:53 +08:00
hpcll
681e0ae96c fix(playlist): avoid custom/folder name collisions (#752)
Co-authored-by: pc hu <>
2026-02-11 22:58:05 +08:00
fragrans
c2b0f7e4f6 feat: 二维码登录功能 (#750)
* 增加二维码登录

* settings增加二维码登录

* Update setting.js

二维码登录js

* Update setting.css

二维码登录:未点击获取前不显示图片

* Update auth.py

二维码登录

* Create qrcode_login.py

二维码登录

* Update device.py

增加获取设备列表

* Update pyproject.toml

依懒库
2026-02-11 20:35:26 +08:00
hpcll
e261239daa feat: add dirname parameter to /downloadonemusic API (#749)
Add optional dirname parameter to single music download endpoint,
allowing downloads to be saved to a subdirectory under download_path.

This makes it consistent with /downloadplaylist which already supports dirname.

Changes:
- Add dirname field to DownloadOneMusic schema (default empty)
- Update download_one_music() to accept dirname parameter
- Update /downloadonemusic endpoint to pass dirname

Co-authored-by: pc hu <>
2026-02-11 07:07:34 +08:00
Issues Docs [BOT]
498a68d267 Auto-Generate docs 🤖 2026-02-10 14:18:45 +00:00
hpcll
1dbe7f417c feat: add /getplayerstatus API to get full player status (#747)
Add new endpoint to retrieve complete playback status from Xiaomi speaker,
including status, volume, and play_song_detail (position/duration).

This is useful when using pushUrl to play audio directly, as the actual
playback progress needs to be fetched from the speaker itself rather than
relying on xiaomusic's internal tracking.

Co-authored-by: pc hu <>
2026-02-10 21:51:07 +08:00