hanxi / xiaomusic

使用小爱音箱播放音乐,音乐使用 yt-dlp 下载。
https://github.com/hanxi/xiaomusic
MIT License
870 stars 84 forks source link

已支持配置自定义网络歌单,在这里分享你的歌单 #78

Open hanxi opened 1 week ago

hanxi commented 1 week ago

设置页面新增一个输入框配置json格式,可以定义配置音乐源,可以是电台或者其他的m3u8格式的。 再加一个输入框配置这个json文件的url,点击获取按钮把url对应的json内容填充到json输入框,方便直接使用别人分享的歌单。

比如这样的链接

已经测试能播放出来:

python3 micli.py play http://ngcdn001.cnr.cn/live/zgzs/index.m3u8

预计歌单格式是这样的, type 为 radio 作为电台的设定,会一直播放当前电台,不会播放下一首。

[
  {
    "name":"歌单1",
    "musics":[
      {
        "name":"歌名1",
        "url":"http://ngcdn001.cnr.cn/live/zgzs/index.m3u8",
        "type":"radio"
      },
      {
        "name":"歌名2",
        "url":"https://lhttp.qtfm.cn/live/4915/64k.mp3"
      }
    ]
  },
  {
    "name":"歌单2",
    "musics":[
      {
        "name":"歌名3",
        "url":"https://lhttp.qtfm.cn/live/4915/64k.mp3"
      },
      {
        "name":"歌名4",
        "url":"https://lhttp.qtfm.cn/live/4915/64k.mp3"
      }
    ]
  }
]
hanxi commented 1 week ago

可以使用 gist 来配置和分享 json 文件,比如 https://gist.github.com/hanxi/dda82d964a28f8110f8fba81c3ff8314

点击 raw 得到 json 文件的链接 https://gist.githubusercontent.com/hanxi/dda82d964a28f8110f8fba81c3ff8314/raw/8787844d81c39dbfaad4e37954dd449d8bba5728/example.json

当然还可以用其他工具分享json文件,比如 github 和国内的 gitee 。

hanxi commented 6 days ago

已经有工具支持将 m3u 格式的电台文件转为网络歌单格式,见 https://github.com/hanxi/xiaomusic/issues/88

欢迎有兴趣的朋友制作其他格式转换工具,比如网易歌单那一类的。