支付宝 | 微信 | |
---|---|---|
奶茶= |
shaonianzhentan / ha_cloud_music Goto Github PK
View Code? Open in Web Editor NEW新版云音乐
License: MIT License
新版云音乐
License: MIT License
DLNA模式播放时,get不到歌曲总时长,导致没有进度条和不能自动下一曲,是api解析歌曲url的问题吗,手动在地址栏输入API的地址就可以获取media_duration信息。
我通过一系列操作,成功把NAS挂载到媒体库 local media下的文件夹了
按专辑分文件夹存放周杰伦的歌
我想通过什么服务,可以播放这些歌?最好是能文件夹(专辑)顺序或者随机播放
最终是想实现手机刷NFC,自动播放其专辑,B站上“NFC 音乐墙”只能做到刷NFC手机播放,利用HA让家里的播放器这样工作感觉会很COOL!
虽然是“cloud music”,但是版权问题很多都听不了,索性特别想听的搞到本地来
我在configuration.yaml内加入以下代码,依然不出现播放器选择
homeassistant:
customize:
media_player.yun_yin_le:
media_player:
- media_player.8d3cd512_99a4cead
recorder:
exclude:
entities:
- media_player.yun_yin_le
每次只能在云音乐的配置设定内选择“关联媒体播放器”来选择
日志的报错信息如下
Logger: homeassistant.components.websocket_api.http.connection
Source: helpers/network.py:200
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 09:13:18 (1 occurrences)
Last logged: 09:13:18
[546403085760] Error handling message: Unknown error (unknown_error) ***** from ... (Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36)
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 26, in _handle_async_response
await func(hass, connection, msg)
File "/usr/src/homeassistant/homeassistant/components/media_player/init.py", line 1223, in websocket_browse_media
payload = await player.async_browse_media(media_content_type, media_content_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/ha_cloud_music/media_player.py", line 163, in async_browse_media
return await self.cloud_music.async_browse_media(self, media_content_type, media_content_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/ha_cloud_music/browse_media.py", line 572, in async_browse_media
playlist = await cloud_music.async_get_playlist(id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/ha_cloud_music/cloud_music.py", line 176, in async_get_playlist
return list(map(format_playlist, res['songs']))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/ha_cloud_music/cloud_music.py", line 171, in format_playlist
url = self.get_play_url(id, song, singer, MusicSource.PLAYLIST.value)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/ha_cloud_music/cloud_music.py", line 121, in get_play_url
base_url = get_url(self.hass, prefer_external=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/network.py", line 200, in get_url
raise NoURLAvailableError
homeassistant.helpers.network.NoURLAvailableError
为啥dlan里面可以控制静音, 在云音乐界面就无法静音? 也无法自动播放下一首,需要手动切换下一首。
Service media_player.mute_volume called service media_player.volume_mute which was not found.
点击进度条无法跳转,左下角提示
调用服务 media_player/media_seek 失败。 extra keys not allowed @ data['position']
Logger: aiohttp.server
Source: /usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py:403
First occurred: 09:48:34 (1 occurrences)
Last logged: 09:48:34
Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py", line 332, in data_received
messages, upgraded, tail = self._request_parser.feed_data(data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "aiohttp/_http_parser.pyx", line 557, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadHttpMessage: 400, message:
Expected HTTP/:
b'GET /cloud_music/url?id=2099601478 song=%E5%81%87%E8%AE%BE singer=%E9%83%91%E6%B6%A6%E6%B3%BD source=3 HTTP/1.1\r'
^
ha已经设置外网连接地址
ha新人小白,请问这个新版本云音乐的接口怎么配置的?是在配置文件中配置apiurl还是需要安装老版本的云音乐插件后使用呢?
请问新版本不能网页播放了是吗?
如何搜索音乐呢?
2023-12-22 01:08:47.594 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140412392773952] Error handling message: Unknown error (unknown_error) liguobao from 192.168.31.40 (Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36)
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 26, in _handle_async_response
await func(hass, connection, msg)
File "/usr/src/homeassistant/homeassistant/components/media_player/init.py", line 1233, in websocket_browse_media
payload = await player.async_browse_media(media_content_type, media_content_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/ha_cloud_music/media_player.py", line 172, in async_browse_media
return await self.cloud_music.async_browse_media(self, media_content_type, media_content_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/ha_cloud_music/browse_media.py", line 573, in async_browse_media
playlist = await cloud_music.async_get_playlist(id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/ha_cloud_music/cloud_music.py", line 166, in async_get_playlist
res = await self.netease_cloud_music(f'/playlist/track/all?id={playlist_id}')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/ha_cloud_music/cloud_music.py", line 131, in netease_cloud_music
res = await http_get(self.api_url + url, self.userinfo.get('cookie', {}))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/ha_cloud_music/http_api.py", line 35, in http_get
result = await resp.json()
^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 1181, in json
return loads(stripped.decode(encoding))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/json/init.py", line 346, in loads
return _default_decoder.decode(s)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/json/decoder.py", line 340, in decode
raise JSONDecodeError("Extra data", s, end)
json.decoder.JSONDecodeError: Extra data: line 1 column 26 (char 25)
不知道为嘛返回了。
{"msg":"参数错误","code":400}{"msg":"参数错误","code":400}
大佬你好,首先插件是可以正常使用的,但是在日志里却持续不断地报错:
2024-07-03 15:01:21.189 ERROR (MainThread) [homeassistant] Error doing job: Future exception was never retrieved (None)
Traceback (most recent call last):
File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/ha_cloud_music/media_player.py", line 71, in media_player_interval
mp.interval(now)
File "/config/custom_components/ha_cloud_music/media_player.py", line 111, in interval
media_player = self.media_player
^^^^^^^^^^^^^^^^^
File "/config/custom_components/ha_cloud_music/media_player.py", line 152, in media_player
return self.hass.states.get(self.source_media_player)
^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'states'
麻烦帮忙看一下是怎么回事,谢谢
ha更新2024.1后云音乐无法使用,望修复!
设置音量确实可以改变音量,但属性volume_level始终为1
此错误来自自定义集成。
Logger: homeassistant.config_entries
Source: custom_components/ha_cloud_music/cloud_music.py:27
Integration: 云音乐 (documentation)
First occurred: 23:35:33 (1 occurrences)
Last logged: 23:35:33
Error setting up entry ha_cloud_music for ha_cloud_music
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 383, in async_setup
result = await component.async_setup_entry(hass, self)
File "/config/custom_components/ha_cloud_music/init.py", line 19, in async_setup_entry
hass.data['cloud_music'] = CloudMusic(hass, api_url)
File "/config/custom_components/ha_cloud_music/cloud_music.py", line 27, in init
self.api_url = url.strip('/')
AttributeError: 'NoneType' object has no attribute 'strip'
设置了一下,发现好像只能使用一个播放设备。请教一下多个播放设备如何使用云音乐?
不能再小爱音箱播放 DLNA播放不了
我喜欢听推荐的歌单,碰到喜欢的 歌曲 也没办法收藏,希望能开发一个 收藏功能。
configuration.yaml和customize.yaml具体如何配置,源实体是什么?
点了add homeassistant之后提示这个
大佬,我是用的是sonos音箱,NAS音乐可以正常使用Sonos音箱播放音乐,但使用这个插件,发现无法关联到sonos音箱,能否帮忙说下怎么操作?谢谢
网易云现在版权越来越少,想解决要不继续对接第三方(但是这样可能又会增加工作量),要不自己传云盘调用。
第三方音乐搜索播放 cloudmusic://search/play?kv=关键词
调用服务的时候出错
是不支持吗
最新版在HA集成里面点开云音乐插件登陆失败,F12显示
500 Internal Server Error
Server got itself in trouble
RT,谢谢~
用 hacs 安装和下载手动复制文件到对应文件夹,重启后点击添加集成,都会出现报错
无法加载配置向导: {"message":"Invalid handler specified"}
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='thewind.xyz', port=443): Max retries exceeded with url: /music/api/search (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f99ebd1b0>: Failed to establish a new connection: [Errno -2] Name does not resolve'))
升级新版后,找不到播放源,请问新版的播放源怎么设置
云音乐 版本:v2024.1.17
NeteaseCloudMusicApi 版本 v4.14.1
WebUI打开我喜欢的歌曲列表无内容,通过服务调用 cloudmusic://163/my/ilike 报错,查看日志发现定位在 http_api.py line:36
result = await resp.json()
报json解析出错
打印resp.text()为 {"msg":"参数错误","code":400}{"msg":"参数错误","code":400}
经调试发现/playlist/track/all接口最多只能返回1000首歌,如果列表歌曲数>1000就会返回 "参数错误"
我目前是修改cloud_music.py line:162
res = await self.netease_cloud_music(f'/playlist/track/all?id={playlist_id}')
为
res = await self.netease_cloud_music(f'/playlist/track/all?id={playlist_id}&limit=1000')
加了个限制,只获取前1000首暂时解决,希望下个版本能顺便fix一下~
2024-06-16 02:08:30.144 WARNING (ImportExecutor_0) [custom_components.ble_monitor.bt_helpers] There are no BT controllers present in the system!
2024-06-16 02:08:35.324 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'hacs' accesses hass.components.frontend. This is deprecated and will stop working in Home Assistant 2024.9, it should be updated to import functions used from frontend directly at custom_components/hacs/frontend.py, line 68: hass.components.frontend.async_register_built_in_panel(, please create a bug report at https://github.com/hacs/integration/issues
2024-06-16 02:08:36.932 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to open inside the event loop by custom integration 'ha_cloud_music' at custom_components/ha_cloud_music/cloud_music.py, line 40: self.userinfo = load_json(self.userinfo_filepath) (offender: /usr/src/homeassistant/homeassistant/util/json.py, line 78: with open(filename, mode="rb") as fdesc:), please report it to the author of the 'ha_cloud_music' custom integration
你好,我用的ha版本是:
Home Assistant 2022.10.5
Supervisor 2022.10.2
前端版本: 20221010.0 - latest
mpd在另一台设备上,自定义端口号为:8600
我先尝试在集成里mpd host 配置:192.168.1.11:8600,但是播放没有反应,提示mpd host不存在(貌似)
然后我就在configuration.yaml里配置了
edia_player:
然后云音乐可以播放了,播放内容是网易云我收藏的歌单。但是出现的问题是没办法自动切换下一首,卡片视图显示如下
进度条不会走而且没有时间显示。
云音乐界面进度条可以走动,但是显示的也是错误的,每次刷新都是从0开始。
我查看了日志界面和配置下面的home-assistant.log文件,都没有相关的log输出。是不是我看log的姿势不对,烦请告知。
问题如上,请帮忙分析一下,不吝感激!
新版这个插件还能像以前一样调用服务来播放指定歌单和电台吗,我想设置指定时间播放我的收藏歌曲的自动化
播放歌单时遇到不能播放的歌(可能是因为没会员或版权原因),会卡住并报错。需要手动点击下一首才能恢复
最好能修复一下,使不能播放的歌自动跳过。
日志如下
Logger: aiohttp.server
Source: custom_components/ha_cloud_music/http.py:65
Integration: 云音乐 (documentation)
First occurred: 01:15:02 (9 occurrences)
Last logged: 01:15:37
Error handling request
Traceback (most recent call last):
File "********/.local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 435, in _handle_request
resp = await request_handler(request)
File "********/.local/lib/python3.10/site-packages/aiohttp/web_app.py", line 504, in _handle
resp = await handler(request)
File "********/.local/lib/python3.10/site-packages/aiohttp/web_middlewares.py", line 117, in impl
return await handler(request)
File "********/.local/lib/python3.10/site-packages/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware
return await handler(request)
File "********/.local/lib/python3.10/site-packages/homeassistant/components/http/forwarded.py", line 100, in forwarded_middleware
return await handler(request)
File "********/.local/lib/python3.10/site-packages/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
return await handler(request)
File "********/.local/lib/python3.10/site-packages/homeassistant/components/http/ban.py", line 82, in ban_middleware
return await handler(request)
File "********/.local/lib/python3.10/site-packages/homeassistant/components/http/auth.py", line 236, in auth_middleware
return await handler(request)
File "********/.local/lib/python3.10/site-packages/homeassistant/components/http/view.py", line 136, in handle
result = await result
File "********/.homeassistant/custom_components/ha_cloud_music/http.py", line 43, in get
result = await self.async_music_source(hass, song, singer)
File "********/.homeassistant/custom_components/ha_cloud_music/http.py", line 65, in async_music_source
ha_music_source = hass.data['ha_music_source']
KeyError: 'ha_music_source'
播放整个歌单的时候,云音乐播放完第一首歌之后,不会自动切换到下一首。需要手动点击下一首才可以。
首先感谢大佬开发出这么优秀的插件,已请大佬喝咖啡。
navidrome是很优秀的开源的本地音乐服务器,实测本地存5万首歌曲,扫描都是秒完成,希望可以整合进云音乐,实现本地音乐播放通过ha,这样网易云音乐欠缺的版权内容可以有本地音乐作为补充。
可以正常播放了,但是有时候播放要手动选择歌单,请问在nodered中怎么自动设置指定播放的歌单呢?比如日推
登录后播放
每日推荐 cloudmusic://163/my/daily
应该怎么设置
一、 用sonos音箱播放电台一直是单曲循环点了播放模式选择也没用
二、调取网易云音乐歌曲列表时报媒体浏览错误,api服务是正常的 。报错日志如下
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 27, in _handle_async_response
await func(hass, connection, msg)
File "/usr/src/homeassistant/homeassistant/components/media_player/init.py", line 1232, in websocket_browse_media
payload = await player.async_browse_media(media_content_type, media_content_id)
File "/config/custom_components/ha_cloud_music/media_player.py", line 158, in async_browse_media
return await self.cloud_music.async_browse_media(self, media_content_type, media_content_id)
File "/config/custom_components/ha_cloud_music/browse_media.py", line 496, in async_browse_media
playlist = await cloud_music.async_get_playlist(id)
File "/config/custom_components/ha_cloud_music/cloud_music.py", line 110, in async_get_playlist
return list(map(format_playlist, res['songs']))
File "/config/custom_components/ha_cloud_music/cloud_music.py", line 105, in format_playlist
url = self.get_play_url(id, song, singer, MusicSource.PLAYLIST.value)
File "/config/custom_components/ha_cloud_music/cloud_music.py", line 67, in get_play_url
base_url = get_url(self.hass, prefer_external=True)
File "/usr/src/homeassistant/homeassistant/helpers/network.py", line 201, in get_url
raise NoURLAvailableError
homeassistant.helpers.network.NoURLAvailableError
播放列表,播放一首歌就停,不会不自动下一首歌
声音输出是MPD
这个问题什么时候可以解决呢?
旁路由openwrt已经安装某解锁插件,需要云音乐设置为代理方式指向旁路由网关及端口,请问如何解决
选择歌曲之后不会播放,并且歌曲总时长一直是0
请问这个是什么原因啊。弄了两天了还是不行
写了一个demo走通了 自己够用
jwxa@1034152
因为现在直接账号密码登录拦截太厉害了,希望可以加入这个功能
python新手 注释都写了
替换了原来的login -> qr_login
步骤就是随便输入账密 点击下一步
然后登录窗口阻塞 直接关闭
查看通知栏
打开手机扫码
成功后会解析cookie写入.storage\cloud_music.userinfo
提示无法加载配置向导: {"message":"Invalid handler specified"},无其他日志输出,请问这是什么情况,谢谢
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.