Giter Site home page Giter Site logo

shaonianzhentan / cloud_music Goto Github PK

View Code? Open in Web Editor NEW

This project forked from maomao1996/vue-mmplayer

141.0 141.0 94.0 26.74 MB

在HA里使用的网易云音乐播放器

Home Page: https://gitee.com/shaonianzhentan/ha_cloud_music

License: MIT License

JavaScript 34.72% HTML 2.92% Vue 23.55% Python 37.46% Less 1.35%

cloud_music's Introduction

Hi!👋 你好鸭 🦆

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

shaonianzhentan's github stats

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

HomeAssistant家庭助理

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

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

cloud_music's People

Contributors

maomao1996 avatar nesror avatar shaonianzhentan avatar utick 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  avatar

Watchers

 avatar  avatar  avatar  avatar

cloud_music's Issues

树莓派srv+python3.7环境,会导致media_player平台无法加载

Platform error: media_player
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/config.py", line 762, in async_process_component_config
platform = p_integration.get_platform(domain)
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/loader.py", line 232, in get_platform
f"{self.pkg_path}.{platform_name}"
File "/srv/homeassistant/lib/python3.7/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1006, in _gcd_import
File "", line 983, in _find_and_load
File "", line 967, in _find_and_load_unlocked
File "", line 677, in _load_unlocked
File "", line 728, in exec_module
File "", line 219, in _call_with_frames_removed
File "/home/homeassistant/.homeassistant/custom_components/ha_cloud_music/media_player.py", line 28, in
from .api_tts import ApiTTS
File "/home/homeassistant/.homeassistant/custom_components/ha_cloud_music/api_tts.py", line 2, in
from mutagen.mp3 import MP3
File "/srv/homeassistant/lib/python3.7/site-packages/mutagen/mp3/init.py", line 17, in
from mutagen.id3 import ID3FileType, delete
File "/srv/homeassistant/lib/python3.7/site-packages/mutagen/id3/init.py", line 33, in
from ._file import ID3, ID3FileType, delete, ID3v1SaveOptions
File "/srv/homeassistant/lib/python3.7/site-packages/mutagen/id3/_file.py", line 20, in
from ._tags import ID3Tags, ID3Header, ID3SaveConfig
File "/srv/homeassistant/lib/python3.7/site-packages/mutagen/id3/_tags.py", line 15, in
from mutagen._compat import PY3, itervalues, izip_longest
ImportError: cannot import name 'izip_longest' from 'mutagen._compat' (/srv/homeassistant/lib/python3.7/site-packages/mutagen/_compat.py)

login是时候,res返回的是None?

如题,还没深入排除问题
Error while setting up ha_cloud_music platform for media_player
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 178, in _async_setup_platform
await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
return fut.result()
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/ha_cloud_music/media_player.py", line 125, in setup_platform
loop.run_until_complete(mp.api_music.login())
File "/usr/local/lib/python3.7/asyncio/base_events.py", line 587, in run_until_complete
return future.result()
File "/config/custom_components/ha_cloud_music/api_music.py", line 32, in login
if res['code'] == 200:
TypeError: 'NoneType' object is not subscriptable

VLC telnet 下的若干错误

使用环境

  • hass运行在mac上,vlc运行在一台局域网内的机器上,通过vlc telnet连接。
  • in hass
media_player:
  - platform: vlc_telnet
    name: VLC Player
    host: 10.0.0.13
    port: 4212
    password: myvlc
  - platform: ha_cloud_music
    api_url: http://localhost:3000
  • 操作在mac端safari浏览器,桌面模式。

错误信息

  • vlc的播放进度和网页不一致。
  • 网页拖动进度条无效。
  • 歌曲结束网页播放时间会过头,且不会自动切歌。
  • 结束后因为还在播放状态,播放按钮的状态就还是暂停。但是点击的话,是从头播放。
  • 总之好像都是围绕着进度条来的,可能 vlc telnet 也得不到进度条?

附 telnet 设置

  • vlc播放器内,ctrl+P打开设置
  • 点左下角显示设置/全部
  • 界面/主界面>勾选telnet
  • 界面/主界面/lua>lua telnet/密码(这里必须设一个密码,比如myvlc,不然hass里会报无密码,没试过留空。)

额外问题

  • 现在是不是只能以访客身份获得自己公开的专辑等等?
  • 那个 node js 版的倒是支持 api,我看是支持日推和私人FM。
  • 另外这个播放器的原理是什么?会用到本地缓存嘛?有的话请问在什么目录?

好几个环境下都无法自动播放下一曲

ha环境:
docker版 105.5
python版108.x

首先是切换播放器比较难,都是一闪而过需要多点几次才能选中。
然后是播放一曲之后就不播放了,不管是dlna还是vlc。

log里会循环出现这个错误,一直循环不播放也会报。

2020-04-30 17:05:45 ERROR (SyncWorker_8) [homeassistant.core] Error doing job: Future exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/ha_cloud_music/media_player.py", line 310, in interval
    if ':' in _media_position:
TypeError: argument of type 'int' is not iterable

一首播放完了自动停止之后重新点击下一首会出现如下报错,但是正常会播放。

2020-04-30 17:26:17 ERROR (MainThread) [homeassistant.helpers.service] Service async_media_stop for media_player.dlna_m_red incorrectly returns a coroutine object. Await result instead in service handler. Report bug to integration author.
2020-04-30 17:26:18 ERROR (MainThread) [homeassistant.helpers.service] Service async_play_media for media_player.dlna_m_red incorrectly returns a coroutine object. Await result instead in service handler. Report bug to integration author.

安装报错

感谢更新维护的这个项目,之前HA没有网页播放器,我尝试安装,虽然曲折,最后成功,各种功能十分牛*。

现在更换设备,再次安装时发现报错,遂来反馈,也可能是我操作问题,望指点。

操作环境:
ubuntu18.04
docker环境安装,具体可看图片。
https://github.com/Tao173/Photos/blob/master/3.jpg
网易的API也是docker环境安装,命令:
docker run -d -p 3000:3000 --name netease_cloud_music_api -e http_proxy= -e https_proxy= -e no_proxy= -e HTTP_PROXY= -e HTTPS_PROXY= -e NO_PROXY= binaryify/netease_cloud_music_api

安装完成报错,找不到切换播放器的接口。
https://github.com/Tao173/Photos/blob/master/2.png
https://github.com/Tao173/Photos/blob/master/1.png

具体HA日志:
https://github.com/Tao173/Photos/blob/master/ha_cloud_music-bug

再次感谢这个项目。

感谢分享这样的好东西,最近发现网易云歌单播放时出现问题。

不是播放器的问题,是网易云最近不知道加了什么,所有外链的歌单,包括个人的,都只能显示前10首音乐而已。我设置网页页面直接打开歌单地址。以前可以全部都看到。
现在不行了。
也是只有前10首,提示查看更多内容,请下载客户端,希望大神有空能解决一下!

求助登录问题

大佬实在不好意思,开个问题来问问怎么登录?
我在前端页面没有登录按钮
屏幕截图 2021-01-19 230520
我开始怀疑是主题的问题,换为官方的也没有,浏览器缓存也清理过
然后我又试了接口登录,STATUS返回CODE200,不知道是不是登录上了,反正后面信息很多,用户名那些也出来了
这个时候我又回前端,但是前端到我的歌单还是提示需要登录,请问这是个啥情况?

HA其他播放器调用无响应

感谢老哥的优秀项目,一直在关注和使用,最近看6.3升级很多,
但是只有选择master才能更新,什么时候可以发个Releases呀,
另外有一个问题,我是用的Xiaomi Miot Auto的项目接入的小爱音箱,HA服务里面调用tts没有问题,
自动化播放指定文本也可以使用,但是到云音乐播放选择成小爱的时候,他就无响应,
主要表现为:云音乐播放条进度不动,音乐时长为0,但是切换为网页播放器和mpd播放器之后,一切正常,进度条和音乐时长都出现了。
日志没有报错项目。。。

账户无法登录?

PVE虚拟ubuntu做服务环境,HA和相关服务都在docker里面跑,安装后无法登录账户,网易云音乐的API是通的。并且FM列表可以播放,说明内外网无问题。
点击登录输入用户ID无效,无任何反应。
1585118275603

WechatIMG21

插件加载报错无法运行。。。。

error.....错误信息如下:

`2020-10-03 01:33:04 ERROR (MainThread) [homeassistant.components.media_player] Error while setting up ha_cloud_music platform for media_player

Traceback (most recent call last):

File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 193, in _async_setup_platform
await asyncio.shield(task)

File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)

File "/config/custom_components/ha_cloud_music/media_player.py", line 65, in setup_platform
api_config = ApiConfig(hass.config.path(".shaonianzhentan/ha_cloud_music"))

File "/config/custom_components/ha_cloud_music/api_config.py", line 17, in init
os.mkdir(_dir)

FileNotFoundError: [Errno 2] No such file or directory: '/config/.shaonianzhentan/ha_cloud_music'`

选择播放源“网页播放器”没声音?

作者你好!
运行无错误,也能够正常播放uid收藏的音乐,但是:~~~
选择播放源“网页播放器”没声音?
另外选择dlna发现的播放源也没有声音?
不知是我配置的不对还是缺少了什么?

DLAN播放器下不能自动下一首

环境:群晖docker Home Assistant 0.110.7,DLNA插件是虫子的,发声设备是斐讯R1。
一首歌播放完切换下一首时会发生各种奇怪的问题,有的时候播放一秒左右就没声音但是进度条在走,有的时候播放一秒左右直接暂停,点了播放没反应或者两个声音一前一后同时播放。

hassos core 4.6 ,system 5.13,云音乐有错误

云音乐版本4.6出现以下问题:
1、播放歌曲无声,但播放电台正常
2、拉动进度条提示错误,如下:
调用服务 media_player/media_seek 失败。expected float for dictionary value@data['seek_position']
调用服务 media_player/volume_set 失败。expected float for dictionary value@data['volume_level']

请问大佬这个是hassos系统问题还是插件有问题

每播放一首歌都提示”请重新选择源播放器”,然后进度一直不动,也没有声音

配置文件如下:
default_config:

tts:

  • platform: google_translate

group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

media_player:

  • platform: mpd
    host: 127.0.0.1
  • platform: ha_cloud_music
    api_url: 'http://localhost:3000'
    sidebar_title: 云音乐
    sidebar_icon: mdi:music
    show_mode: fullscreen
    is_debug: true

recorder:
exclude:
entities:
- media_player.yun_yin_le

播放歌单 推荐 等都是空的

media_player:

  • platform: mpd
    host: 192.168.50.196
    port: 6600
  • platform: ha_cloud_music
    api_url: 'http://localhost:3009'
    sidebar_title: 云音乐
    sidebar_icon: mdi:music
    show_mode: fullscreen
    uid:
    user: [email protected]
    passwowrd: 666666
    tts_before_message: '主人:'
    tts_after_message: '。我是爱你的小喵'
    tts_mode: 4
    is_voice: true
    is_notify: true
    is_debug: true

搜索 我的歌单 登录都用不了 只有FM电台可以听

在树莓派上运行出现的报错

2月 04 06:19:19 raspberrypi hass[539]: 2021-02-04 06:19:19 ERROR (MainThread) [aiohttp.server] Error handling request
2月 04 06:19:19 raspberrypi hass[539]: Traceback (most recent call last):
2月 04 06:19:19 raspberrypi hass[539]: File "/usr/local/lib/python3.8/site-packages/aiohttp/web_protocol.py", line 422, in _handle_request
2月 04 06:19:19 raspberrypi hass[539]: resp = await self._request_handler(request)
2月 04 06:19:19 raspberrypi hass[539]: File "/usr/local/lib/python3.8/site-packages/aiohttp/web_app.py", line 499, in _handle
2月 04 06:19:19 raspberrypi hass[539]: resp = await handler(request)
2月 04 06:19:19 raspberrypi hass[539]: File "/usr/local/lib/python3.8/site-packages/aiohttp/web_middlewares.py", line 118, in impl
2月 04 06:19:19 raspberrypi hass[539]: return await handler(request)
2月 04 06:19:19 raspberrypi hass[539]: File "/usr/local/lib/python3.8/site-packages/homeassistant/components/http/security_filter.py", line 56, in security_filter_middleware
2月 04 06:19:19 raspberrypi hass[539]: return await handler(request)
2月 04 06:19:19 raspberrypi hass[539]: File "/usr/local/lib/python3.8/site-packages/homeassistant/components/http/request_context.py", line 18, in request_context_middleware
2月 04 06:19:19 raspberrypi hass[539]: return await handler(request)
2月 04 06:19:19 raspberrypi hass[539]: File "/usr/local/lib/python3.8/site-packages/homeassistant/components/http/ban.py", line 72, in ban_middleware
2月 04 06:19:19 raspberrypi hass[539]: return await handler(request)
2月 04 06:19:19 raspberrypi hass[539]: File "/usr/local/lib/python3.8/site-packages/homeassistant/components/http/auth.py", line 127, in auth_middleware
2月 04 06:19:19 raspberrypi hass[539]: return await handler(request)
2月 04 06:19:19 raspberrypi hass[539]: File "/usr/local/lib/python3.8/site-packages/homeassistant/components/http/view.py", line 129, in handle
2月 04 06:19:19 raspberrypi hass[539]: result = await result
2月 04 06:19:19 raspberrypi hass[539]: File "/home/pi/.homeassistant/custom_components/ha_cloud_music/api_view.py", line 60, in post
2月 04 06:19:19 raspberrypi hass[539]: _result = await mp.api_music.search_music(_name)
2月 04 06:19:19 raspberrypi hass[539]: File "/home/pi/.homeassistant/custom_components/ha_cloud_music/api_music.py", line 165, in search_music
2月 04 06:19:19 raspberrypi hass[539]: if obj['code'] == 200:
2月 04 06:19:19 raspberrypi hass[539]: TypeError: 'NoneType' object is not subscriptable

mv

大佬,能否支持播放mv音乐

无法识别HA安装的播放器

Hassio0.103.2已安装Vlc和Kodi,但是插件依然报错检测到HA中没有安装播放器。请问在configuration.yaml中的media_player项除了ha_cloud_music还要把系统播放器加进去吗?

内网穿透访问无法播放,前一个版本可以

Logger: frontend.js.latest.202011112
Source: components/system_log/init.py:193
First occurred: 上午12:05:45 (14 occurrences)
Last logged: 下午5:50:33

https://3#######打吗o.co/ha_cloud_music-web/card/ha_cloud_music.js?v=4.4:10:32 TypeError: null is not an object (evaluating 'this.hass.states[this.entity_id]')
https://3########打吗o.co/ha_cloud_music-web/card/ha_cloud_music.js?v=4.4:10:32 Uncaught TypeError: Cannot read property 'media_player.yun_yin_le' of null
:0:0 Script error.

再报告个,感觉好像是tts的锅

日志如下:出现在调用tts服务自动播报开关状态之后,不是所有时候都会触发,不知道该如何解决
ps:这个tts服务感觉很不错。大佬可否帮忙判断下是啥原因啊?
2020-02-16 03:39:28 INFO (SyncWorker_7) [custom_components.dlna] dlna devices ['http://192.168.99.29:49153/description.xml']
2020-02-16 03:39:31 INFO (MainThread) [homeassistant.components.automation] Executing Door is Closed
2020-02-16 03:39:31 INFO (MainThread) [homeassistant.helpers.script] Script Door is Closed: Running script
2020-02-16 03:39:31 INFO (MainThread) [homeassistant.helpers.script] Script Door is Closed: Executing step call service
2020-02-16 03:39:41 INFO (MainThread) [homeassistant.helpers.script] Script Door is Closed: Executing step call service
2020-02-16 03:39:45 INFO (MainThread) [homeassistant.components.automation] Executing switch_status_tts
2020-02-16 03:39:45 INFO (MainThread) [homeassistant.helpers.script] Script switch_status_tts: Running script
2020-02-16 03:39:45 INFO (MainThread) [homeassistant.helpers.script] Script switch_status_tts: Executing step call service
2020-02-16 03:39:47 INFO (SyncWorker_12) [custom_components.ha_cloud_music.media_player] 【播放列表类型】:music
2020-02-16 03:39:47 INFO (SyncWorker_12) [custom_components.ha_cloud_music.media_player] 【当前播放音乐】【None】:【http://192.168.99.130:8123/api/tts_proxy/d8cecd22713bd01106aa1f52291be1fe550890c6_zh_15390481186305659454_baidu.mp3】
这是一个正常的错误: local variable 'music_info' referenced before assignment
2020-02-16 03:39:47 INFO (SyncWorker_12) [custom_components.ha_cloud_music.media_player] 【调用服务[media_player.192_168_99_29]】play_media:{'entity_id': 'media_player.192_168_99_29', 'media_content_id': 'http://192.168.99.130:8123/api/tts_proxy/d8cecd22713bd01106aa1f52291be1fe550890c6_zh_15390481186305659454_baidu.mp3', 'media_content_type': 'music'}
2020-02-16 03:39:48 ERROR (MainThread) [homeassistant.components.automation] Error while executing automation automation.door_is_closed. Unknown error for call_service at pos 2:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/automation/init.py", line 431, in action
await script_obj.async_run(variables, context)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 151, in async_run
await self._handle_action(action, variables, context)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 235, in _handle_action
await self._actions[_determine_action(action)](action, variables, context)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 318, in _async_call_service
context=context,
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 98, in async_call_from_config
domain, service_name, service_data, blocking=blocking, context=context
File "/usr/src/homeassistant/homeassistant/core.py", line 1235, in async_call
await asyncio.shield(self._execute_service(handler, service_call))
File "/usr/src/homeassistant/homeassistant/core.py", line 1260, in _execute_service
await handler.func(service_call)
File "/usr/src/homeassistant/homeassistant/components/tts/init.py", line 165, in async_say_handle
DOMAIN_MP, SERVICE_PLAY_MEDIA, data, blocking=True
File "/usr/src/homeassistant/homeassistant/core.py", line 1235, in async_call
await asyncio.shield(self._execute_service(handler, service_call))
File "/usr/src/homeassistant/homeassistant/core.py", line 1260, in _execute_service
await handler.func(service_call)
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 210, in handle_service
self._platforms.values(), func, call, service_name, required_features
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 349, in entity_service_call
future.result() # pop exception if have
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 373, in _handle_service_platform_call
await func(entity, data)
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/onkyo/media_player.py", line 385, in play_media
source = self._reverse_mapping[self._current_source]
KeyError: None
2020-02-16 03:39:59 INFO (SyncWorker_9) [custom_components.dlna] dlna devices ['http://192.168.99.29:49153/description.xml']

然后就会出现homeassistant无法通过web访问的情况

新年好,2020元旦 执行错误,binary_sensor插件无法工作

日志
File "/home/pi/homeassistant/bin/hass", line 11, in
sys.exit(main())
File "/home/pi/homeassistant/lib/python3.6/site-packages/homeassistant/main.py", line 399, in main
exit_code = asyncio_run(setup_and_run_hass(config_dir, args))
File "/home/pi/homeassistant/lib/python3.6/site-packages/homeassistant/util/async_.py", line 27, in asyncio_run
return loop.run_until_complete(main)
File "/usr/local/lib/python3.6/asyncio/base_events.py", line 471, in run_until_complete
self.run_forever()
File "/usr/local/lib/python3.6/asyncio/base_events.py", line 438, in run_forever
self._run_once()
File "/usr/local/lib/python3.6/asyncio/base_events.py", line 1415, in _run_once
event_list = self._selector.select(timeout)
File "/usr/local/lib/python3.6/selectors.py", line 445, in select
fd_event_list = self._epoll.poll(timeout, max_ev)

can not log in

Hi
thanks for your effort and hard work.
I had problem on login .
condition :
1. running HA in docker and raspberry Pi
2. install ha_cloud_music thru HACS.
3. set up below item in configuration.yaml
But problem : can not log in cloud music.
could you advise some idea?
tks

  • platform: ha_cloud_music
    api_url: 'http://10.0.0.200:3000'
    sidebar_title: 云音乐
    sidebar_icon: mdi:music
    show_mode: fullscreen
    uid: 100340334

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.