GithubHelp home page GithubHelp logo

ha_cloud_music's Introduction

Hi!👋 你好鸭 🦆

做人呢,最重要的就是要...😄

shaonianzhentan's github stats

关注我的微信订阅号,了解更多HomeAssistant相关知识

HomeAssistant家庭助理

如果我开发的项目对你有帮助,请我喝杯咖啡奶茶吧😘

支付宝 微信
奶茶= 支付宝 微信支付

ha_cloud_music's People

Contributors

shaonianzhentan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ha_cloud_music's Issues

media_duration: 0

DLNA模式播放时,get不到歌曲总时长,导致没有进度条和不能自动下一曲,是api解析歌曲url的问题吗,手动在地址栏输入API的地址就可以获取media_duration信息。

如何通过服务,播放媒体库 local media下的音乐?

我通过一系列操作,成功把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

每次只能在云音乐的配置设定内选择“关联媒体播放器”来选择

媒体浏览错误

登录后可以看到自己的歌单,但点进每一个歌单就会报错。
image

日志的报错信息如下
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

播放音乐报错,播放电台正常

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已经设置外网连接地址

这个新版云音乐插件和cloud_music_mpd里最新的是能一起用的吗?

您好,
我的Home Assistant是2022.12.5版,ha_cloud_music最新版,cloud_music_mpd最新版
我单独装新版云音乐的插件,用媒体控制卡片是可以正常播放、暂停、下一首之类的操作的,但是我装上cloud_music_mpd之后,mpd用媒体控制卡片点播放什么的都会报错,请问是不是现在的这个mpd是适配之前那个4.7.4的云音乐插件的?

另外这个最新的插件,点开卡片的属性之后,下面没有列表、播放源、搜索那些东西了,是原本就是这样的吗?

1

获取当前用户喜欢的音乐列表出错

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}

插件导致 Home Assistant 日志里持续报错

大佬你好,首先插件是可以正常使用的,但是在日志里却持续不断地报错:

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'

麻烦帮忙看一下是怎么回事,谢谢

新版报错

此错误来自自定义集成。

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'

SONOS音箱不支持

大佬,我是用的是sonos音箱,NAS音乐可以正常使用Sonos音箱播放音乐,但使用这个插件,发现无法关联到sonos音箱,能否帮忙说下怎么操作?谢谢

新版集成登陆失败

最新版在HA集成里面点开云音乐插件登陆失败,F12显示
500 Internal Server Error
Server got itself in trouble

添加集成显示无法加载配置向导

用 hacs 安装和下载手动复制文件到对应文件夹,重启后点击添加集成,都会出现报错
无法加载配置向导: {"message":"Invalid handler specified"}

thewind.xyz 无法访问

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'))

小爱音响DLNA的问题

不知道为啥,大佬不愿意测试 @qqdwtypm 大佬的方法可以解决该问题的,该大佬的方法可以解决小爱音响DLNA无法自动切换下一首的问题,大佬让我自行fork一份,是不是解决该问题更好呢? #22

cloudmusic://163/my/ilike 无法获取我喜欢的歌曲列表问题

云音乐 版本: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

mpd播放没有进度条显示,一首歌播放完成不会切换下一首

你好,我用的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:

  • platform: mpd
    name: 卧室音乐播放器
    host: 192.168.1.11
    port: 8600

然后云音乐可以播放了,播放内容是网易云我收藏的歌单。但是出现的问题是没办法自动切换下一首,卡片视图显示如下
image
进度条不会走而且没有时间显示。

云音乐界面进度条可以走动,但是显示的也是错误的,每次刷新都是从0开始。
image

我查看了日志界面和配置下面的home-assistant.log文件,都没有相关的log输出。是不是我看log的姿势不对,烦请告知。

问题如上,请帮忙分析一下,不吝感激!

登陆成功无法正常播放进度条没有变化

image

表现: 点击播放,进度条无变化,完全没有声音

测试内容如下:
1,使用云音乐里面的本地媒体库打开可以正常播放,但在线列表无法正常播放。(应该可以证明DLNA连接配置正常,另外音量正常可以调节)
2,使用Vercel 部署和本地docker部署都试过,均无法正常运行。

版本:2023年4月10日初次部署

新版这个插件能调用服务吗

新版这个插件还能像以前一样调用服务来播放指定歌单和电台吗,我想设置指定时间播放我的收藏歌曲的自动化

播放歌单时遇到不能播放的歌,会卡住并报错

播放歌单时遇到不能播放的歌(可能是因为没会员或版权原因),会卡住并报错。需要手动点击下一首才能恢复
最好能修复一下,使不能播放的歌自动跳过。
日志如下

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作为播放源

首先感谢大佬开发出这么优秀的插件,已请大佬喝咖啡。

navidrome是很优秀的开源的本地音乐服务器,实测本地存5万首歌曲,扫描都是秒完成,希望可以整合进云音乐,实现本地音乐播放通过ha,这样网易云音乐欠缺的版权内容可以有本地音乐作为补充。

sonos音箱不能自动下一曲播放,网易云音乐播放列表报错

一、 用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

如何让这个插件使用代理

旁路由openwrt已经安装某解锁插件,需要云音乐设置为代理方式指向旁路由网关及端口,请问如何解决

二维码扫码登录feature

写了一个demo走通了 自己够用
jwxa@1034152
因为现在直接账号密码登录拦截太厉害了,希望可以加入这个功能
python新手 注释都写了

替换了原来的login -> qr_login
步骤就是随便输入账密 点击下一步
然后登录窗口阻塞 直接关闭
image
查看通知栏
image
打开手机扫码
image

成功后会解析cookie写入.storage\cloud_music.userinfo

安装集成不成功

提示无法加载配置向导: {"message":"Invalid handler specified"},无其他日志输出,请问这是什么情况,谢谢

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.