Coder Social home page Coder Social logo

ytube_music_player's People

Contributors

apxubatop avatar chmielad avatar denvers avatar drulikar avatar felixfischer avatar koljawindeler avatar leandroissa avatar lukaszp2 avatar mang1985 avatar mrueg avatar nemesis24 avatar pathofleastresistor avatar robinr1 avatar simonmannsfeld avatar stboch avatar tprelog avatar wrt54g 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ytube_music_player's Issues

Song progression when speaker is a chromecast?

Hi,

thank you for your excellent work, it's truly awesome!

I might simply be dumb, but I haven't find how to show the progression of the currently playing song when speaker is a chrome cast device. Is it expected behaviour or have I did something wrong?

EDIT : using the media-mini-player from kalkih.

Thanks!

Buy you a coffee or beer

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

I really like what you're doing here. I appreciate all the work you have already done and I'm looking forward to some of the future improvements you have mentioned in the forum. I know this is a lot of work and I want to help, however I am unable to contribute quality code so I would like to have another way I can contribute.

Describe the solution you'd like
A clear and concise description of what you want to happen.

I would like a link to buy you a coffee or something similar

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Becoming GitHub sponsor

Additional context
Add any other context or screenshots about the feature request here.

NA

Cannot find the repo in HACS

as above trying to install via HACS, but cannot find it. when I search nothing comes back. I am new to HA. Thanks in advance

Reminder: Proxy setting to config flow

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Player wouldnt turn on.

Hi,
Im getting following error last couple of days without changing much in the config and the player would not turno on.
Previously it worked just fine.

Logger: custom_components.ytube_music_player.media_player
Source: custom_components/ytube_music_player/media_player.py:857
Integration: YouTube Music Player (documentation)
First occurred: 8:56:13 (1 occurrences)
Last logged: 8:56:13

Traceback (most recent call last): File "/config/custom_components/ytube_music_player/media_player.py", line 410, in _update_playlists self._playlists = self._api.get_library_playlists(limit = 99) File "/usr/local/lib/python3.8/site-packages/ytmusicapi/mixins/library.py", line 29, in get_library_playlists results = find_object_by_key(nav(response, SINGLE_COLUMN_TAB + SECTION_LIST), File "/usr/local/lib/python3.8/site-packages/ytmusicapi/parsers/utils.py", line 148, in nav raise err File "/usr/local/lib/python3.8/site-packages/ytmusicapi/parsers/utils.py", line 142, in nav root = root[k] KeyError: 'contents'

When i try to start player im getting this

Logger: custom_components.ytube_music_player.media_player
Source: custom_components/ytube_music_player/media_player.py:221
Integration: YouTube Music Player (documentation)
First occurred: 9:23:56 (19 occurrences)
Last logged: 15:00:40

Can't start the player, no header file

Im on latest version but this issue was discovered on the previous version of the component

Play continuous setting not initialised when HA starts

DEBUG Output after HA restart

2021-01-20 19:23:56 DEBUG (SyncWorker_3) [custom_components.ytube_music_player.media_player] _sync_player
2021-01-20 19:23:56 DEBUG (SyncWorker_3) [custom_components.ytube_music_player.media_player] media_player.chromecast: playing -> idle
2021-01-20 19:23:56 DEBUG (SyncWorker_3) [custom_components.ytube_music_player.media_player] _get_track
2021-01-20 19:23:56 DEBUG (SyncWorker_3) [custom_components.ytube_music_player.media_player] - Playing track nr 1 / 1
2021-01-20 19:23:56 DEBUG (SyncWorker_3) [custom_components.ytube_music_player.media_player] play_media, media_type: track, media_id: 2yIGIQb9gSk
2021-01-20 19:23:56 DEBUG (SyncWorker_3) [custom_components.ytube_music_player.media_player] prepare_play
2021-01-20 19:23:56 DEBUG (SyncWorker_3) [custom_components.ytube_music_player.media_player] check_api
2021-01-20 19:23:56 DEBUG (SyncWorker_3) [custom_components.ytube_music_player.media_player] _update_remote_player
2021-01-20 19:23:56 DEBUG (SyncWorker_3) [custom_components.ytube_music_player.media_player] media_stop
2021-01-20 19:23:56 DEBUG (SyncWorker_3) [custom_components.ytube_music_player.media_player] - media_stop -> media_player.chromecast
2021-01-20 19:23:56 DEBUG (SyncWorker_3) [custom_components.ytube_music_player.media_player] _get_cipher
2021-01-20 19:23:59 DEBUG (SyncWorker_3) [custom_components.ytube_music_player.media_player] _tracks_to_attribute
2021-01-20 19:23:59 DEBUG (SyncWorker_3) [custom_components.ytube_music_player.media_player] _play
2021-01-20 19:23:59 DEBUG (SyncWorker_3) [custom_components.ytube_music_player.media_player] _get_track
2021-01-20 19:23:59 DEBUG (SyncWorker_3) [custom_components.ytube_music_player.media_player] - Playing track nr 0 / 1
2021-01-20 19:23:59 DEBUG (SyncWorker_3) [custom_components.ytube_music_player.media_player] get_url
2021-01-20 19:23:59 DEBUG (SyncWorker_3) [custom_components.ytube_music_player.media_player] check_api
2021-01-20 19:23:59 DEBUG (SyncWorker_3) [custom_components.ytube_music_player.media_player] - try to find URL on our own
2021-01-20 19:24:00 DEBUG (SyncWorker_3) [custom_components.ytube_music_player.media_player] - self decoded URL via cipher
2021-01-20 19:24:00 INFO (SyncWorker_7) [pychromecast.controllers] Not launching app CC1AD846 - already running
2021-01-20 19:24:00 DEBUG (SyncWorker_8) [custom_components.ytube_music_player.media_player] _sync_player
2021-01-20 19:24:00 DEBUG (SyncWorker_8) [custom_components.ytube_music_player.media_player] media_player.chromecast: idle -> idle
2021-01-20 19:24:01 DEBUG (SyncWorker_4) [custom_components.ytube_music_player.media_player] _sync_player
2021-01-20 19:24:01 DEBUG (SyncWorker_4) [custom_components.ytube_music_player.media_player] media_player.chromecast: idle -> playing
2021-01-20 19:24:02 DEBUG (SyncWorker_14) [custom_components.ytube_music_player.media_player] _sync_player
2021-01-20 19:24:02 DEBUG (SyncWorker_14) [custom_components.ytube_music_player.media_player] media_player.chromecast: playing -> playing
2021-01-20 19:24:16 DEBUG (SyncWorker_12) [custom_components.ytube_music_player.media_player] _sync_player
2021-01-20 19:24:16 DEBUG (SyncWorker_12) [custom_components.ytube_music_player.media_player] media_player.chromecast

DEBUG Output after set input_boolean.ytube_music_player_playcontinuous to ON and OFF again

2021-01-20 19:09:55 DEBUG (SyncWorker_11) [custom_components.ytube_music_player.media_player] _sync_player
2021-01-20 19:09:55 DEBUG (SyncWorker_11) [custom_components.ytube_music_player.media_player] media_player.chromecast: playing -> idle
2021-01-20 19:09:55 DEBUG (SyncWorker_11) [custom_components.ytube_music_player.media_player] _get_track
2021-01-20 19:09:55 DEBUG (SyncWorker_11) [custom_components.ytube_music_player.media_player] - Playing track nr 1 / 1
2021-01-20 19:09:55 INFO (SyncWorker_11) [custom_components.ytube_music_player.media_player] - End of playlist and playcontinuous is off
2021-01-20 19:09:55 DEBUG (SyncWorker_11) [custom_components.ytube_music_player.media_player] _turn_off_media_player

Describe the bug
Even though having the input_boolean ytube_music_player_playcontinuous to false, after HA restart, it does not take the input_boolean state.

Version
ytube_music_player 20210118
HA 2021.1.3

To Reproduce

  1. Set the input_boolean to false
  2. Restart HA
  3. Call service to play single track:
- service: media_player.play_media
    data:
      entity_id: media_player.ytube_music_player
      media_content_id: BzsrqaLgdpk
      media_content_type: track
  1. It never stops playing...

Thanks

Error: Cookie wasn't right while setting up integration.

Enable DEBUG Output
Please see: https://github.com/KoljaWindeler/ytube_music_player/#debug-information

Describe the bug
A clear and concise description of what the bug is, ideally a homeassistant log with debug enabled

Version
please provide the version you are using (see HACS)

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'Open Configuration -> Integrations -> "add integration" -> "YouTube Music Player".'
  2. Paste Cookie
  3. Click on 'Submit'
  4. See error
    Something with your cookie wasn't right. Format and fields are ok but the login failed
    Additional context
    Something with your cookie wasn't right. Format and fields are ok but the login failed

I am using Google 2 factor authentication

Thanks

hi there is a issue with intergration

hi i am having a issue where my one keeps i select a playlist and forever keeps looping on the loading then cancels forever i dont know how to fix and would greatly appricate some help

Thanks

ghost

Several bugs in logs

Hi, i am having several bugs in logs, already tried to update my cookies, it was working properly, last week.

image

image

input_select playlist not populating

DEBUG Output

Logger: custom_components.ytube_music_player.media_player
Source: custom_components/ytube_music_player/media_player.py:688
Integration: YouTube Music Player (documentation, issues)
First occurred: 13:40:52 (1 occurrences)
Last logged: 13:40:52

playlists empty

Describe the bug
Got your integration to work fine, it's playing my playlist when I hardcode it into the custom media player card.
However when opening the playlists folder in the media browser the folder is empty.
Also the input_select playlist stays on 'No playlists found'.
Tried multiple restarts, but the list and the media browser stay empty.

Version
Latest (20210102)

I can not see the media_player entity in lovelace

Information:
Home Assistant 2020.12.1
Home Assistant OS 5.9
Supervisor | 2020.12.7

Steps:

  1. Add repository in HACS
  2. Open Configuration -> Integrations -> "add integration" -> "YouTube Music Player"
  3. Paste the cookie into the indicated field
    3.1 Extract cookie youtube music and paste the following text in the installation HACS.

Captura de pantalla 2020-12-28 a las 11 37 59

accept-language: es-ES,es;q=0.9,en;q=0.8,th;q=0.7,pt;q=0.6
authorization: SAPISIDHASH <STRING>
content-length: 967
content-type: application/json
cookie: VISITOR_INFO1_LIVE<STRING>
origin: https://music.youtube.com
referer: https://music.youtube.com/
sec-fetch-dest: empty
sec-fetch-mode: cors
sec-fetch-site: same-origin
user-agent: Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Mobile Safari/537.36
x-client-data: CI<STRING>
Decoded:
message ClientVariations {
  // Active client experiment variation IDs.
  repeated int32 variation_id = [3300106, 3300133, 3300164, 3313321, 3318700, 3318774, 3319460, 3320540, 3329132, 3329546, 3329602];
}
x-goog-authuser: 0
x-goog-visitor-id: CgtzaWFyTEROM3RhSSid36b_BQ%3D%3D
x-origin: https://music.youtube.com
x-youtube-ad-signals: dt=1609<STRING>
x-youtube-client-name: 67
x-youtube-client-version: 0.1
x-youtube-device: cbr=Chrome+Mobile&cbrand=google&cbrver=<STRING>
x-youtube-identity-token: <STRING>
x-youtube-page-cl: <STRING>
x-youtube-page-label: youtube.music.web.client_<STRING>
x-youtube-time-zone: Atlantic/Canary
x-youtube-utc-offset: 0
  1. Restart Hassio

  2. Copy the entity definition in configuration.yaml

media_player:
  - platform: ytube_music_player
    speakers:
      - cuarto_de_estar
      - en_toda_la_casa
      - mibox3
  1. Restart HAssio

  2. Now, I want to add the media_player entity in lovelace, but I don't see the entity.

  3. Go to Home assistsnat Logs

Captura de pantalla 2020-12-28 a las 11 31 53

Can you help me?

media_player.turn_off results in "AttributeError: 'list' object has no attribute 'lower'"

I'm not sure when this started, but when I call the 'media_player.turn_off' service with 'media_player.ytube_music_player', I get the following in my log file:

2020-12-29 00:12:18 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [139751139782368] 'list' object has no attribute 'lower'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 135, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1445, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1480, in _execute_service
    await handler.job.target(service_call)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 204, in handle_service
    await self.hass.helpers.service.entity_service_call(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 593, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 664, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 630, in _handle_entity_call
    await result
  File "/usr/src/homeassistant/homeassistant/components/media_player/__init__.py", line 558, in async_turn_off
    await self.hass.async_add_executor_job(self.turn_off)
  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/ytube_music_player/media_player.py", line 319, in turn_off
    _player = self.hass.states.get(self._remote_player)
  File "/usr/src/homeassistant/homeassistant/core.py", line 1048, in get
    return self._states.get(entity_id.lower())
AttributeError: 'list' object has no attribute 'lower'

I believe it's because hass.states.get() is expecting a single entity_id and it's being passed a list of entity_ids.

Just got these errors

============= ytube_music_player Integration Error ================
2021-01-03 11:04:46 ERROR (SyncWorker_2) [custom_components.ytube_music_player.media_player] unfortunately we hit an error in the sub api, please open a ticket at
2021-01-03 11:04:46 ERROR (SyncWorker_2) [custom_components.ytube_music_player.media_player] https://github.com/sigma67/ytmusicapi/issues
2021-01-03 11:04:46 ERROR (SyncWorker_2) [custom_components.ytube_music_player.media_player] and paste the following output:

2021-01-03 11:04:46 ERROR (SyncWorker_2) [custom_components.ytube_music_player.media_player] Traceback (most recent call last):
File "/config/custom_components/ytube_music_player/media_player.py", line 133, in check_api
self._api = ytmusicapi.YTMusic(self._header_file)
File "/usr/local/lib/python3.8/site-packages/ytmusicapi/ytmusic.py", line 96, in init
self.sapisid = sapisid_from_cookie(self.headers['Cookie'])
File "/usr/local/lib/python3.8/site-packages/ytmusicapi/helpers.py", line 57, in sapisid_from_cookie
return cookie['__Secure-3PAPISID'].value
KeyError: '__Secure-3PAPISID'

2021-01-03 11:04:46 ERROR (SyncWorker_2) [custom_components.ytube_music_player.media_player]
thanks, Kolja
2021-01-03 11:04:46 ERROR (SyncWorker_2) [custom_components.ytube_music_player.media_player] ============= ytube_music_player Integration Error ================

Thanks

Sonos intergration?

Hi! I wonder if itโ€™s able to play the music through Sonos speaker? I have the options to choose my sonos speakers and it starts to play but there is no sound coming out of the speaker.
Is this just compatibility issue or should I be able to play music through my Sonos speaker? Google devices works great to play music through.

Playlists & Media Library won't load - Errors in log

Hello,

I just updated to the newest version, 20201229, and am able to see the music player. However it's not loading any of my playlists. Also when browsing media all the folder are empty and when I click on one it pops up saying "Media Browsing Error - unknown error". Below are my logs.

2020-12-29 08:24:48 ERROR (SyncWorker_5) [custom_components.ytube_music_player.media_player] Traceback (most recent call last): File "/config/custom_components/ytube_music_player/media_player.py", line 608, in _update_playlists self._playlists = self._api.get_library_playlists(limit = 99) File "/usr/local/lib/python3.8/site-packages/ytmusicapi/mixins/library.py", line 32, in get_library_playlists playlists = parse_content_list(results['items'][1:], parse_playlist) File "/usr/local/lib/python3.8/site-packages/ytmusicapi/parsers/browsing.py", line 165, in parse_content_list contents.append(parse_func(result['musicTwoRowItemRenderer'])) File "/usr/local/lib/python3.8/site-packages/ytmusicapi/parsers/browsing.py", line 202, in parse_playlist 'title': nav(data, TITLE_TEXT), File "/usr/local/lib/python3.8/site-packages/ytmusicapi/parsers/utils.py", line 167, in nav raise err File "/usr/local/lib/python3.8/site-packages/ytmusicapi/parsers/utils.py", line 161, in nav root = root[k] KeyError: 'runs' 2020-12-29 08:24:48 ERROR (SyncWorker_5) [custom_components.ytube_music_player.media_player] thanks, Kolja 2020-12-29 08:24:48 ERROR (SyncWorker_5) [custom_components.ytube_music_player.media_player] ============= ytube_music_player Integration Error ================ 2020-12-29 08:25:14 ERROR (Thread-10) [homeassistant.components.cast.media_player] Failed to cast media https://www.home-assistant.io/images/cast/splash.png. Please make sure the URL is: Reachable from the cast device and either a publicly resolvable hostname or an IP address 2020-12-29 08:25:15 ERROR (SyncWorker_3) [custom_components.ytube_music_player.media_player] playlists empty 2020-12-29 08:25:15 ERROR (SyncWorker_3) [custom_components.ytube_music_player.media_player] playlists empty 2020-12-29 08:25:15 ERROR (SyncWorker_3) [custom_components.ytube_music_player.media_player] Out of range! Number of tracks in track_queue == (0) 2020-12-29 08:25:21 ERROR (SyncWorker_1) [custom_components.ytube_music_player.media_player] playlists empty 2020-12-29 08:25:21 WARNING (SyncWorker_3) [pychromecast.controllers] STOP command requested but no session is active. 2020-12-29 08:25:21 ERROR (SyncWorker_1) [custom_components.ytube_music_player.media_player] playlists empty 2020-12-29 08:25:21 ERROR (SyncWorker_1) [custom_components.ytube_music_player.media_player] Out of range! Number of tracks in track_queue == (0) 2020-12-29 08:25:21 WARNING (SyncWorker_0) [pychromecast.controllers] STOP command requested but no session is active. 2020-12-29 08:25:21 WARNING (SyncWorker_5) [pychromecast.controllers] STOP command requested but no session is active. 2020-12-29 08:25:26 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [139687220588752] Error handling message: Unknown error Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 18, in _handle_async_response await func(hass, connection, msg) File "/usr/src/homeassistant/homeassistant/components/media_player/__init__.py", line 1066, in websocket_browse_media payload = await player.async_browse_media(media_content_type, media_content_id) File "/config/custom_components/ytube_music_player/media_player.py", line 1172, in async_browse_media response = await build_item_response(self.hass, self._api, payload) File "/config/custom_components/ytube_music_player/browse_media.py", line 58, in build_item_response media = await hass.async_add_executor_job(media_library.get_library_playlists,BROWSER_LIMIT) AttributeError: 'NoneType' object has no attribute 'get_library_playlists'

Uploads of music in YouTube music unavailable via YouTube api

The existing method to get youtube urls only works from music released via YouTube Music. Music uploaded via the music app return as unplayable on the YouTube site.

@KoljaWindeler at first pass looked at seeing if I could change the url to the music.youtube site instead of just YouTube while the js base is the same the regex used to find the cipher code might need to be adjusted to this new site. Was going to do more debugging and digging and see if I can get it working

[Request] - Custom Card

Hello

I've set up your integration today and it does work! Great work!

I've noticed though with my current setup I'm using the following card - https://github.com/kalkih/mini-media-player
And there are some issues which may be improved by having your own custom card

For example, switching what speaker it plays too with the input select doesn't change unless the power is switched off and then back on which loses the current song

It would be really cool (if possible of course) to have the following card

image

But have the input selects integrated into the actual media player card as buttons where then the functionality can be applied

get_playlist playlist KeyError: 'contents'

`Logger: custom_components.ytube_music_player.media_player
Source: custom_components/ytube_music_player/media_player.py:811
Integration: YouTube Music Player (documentation)
First occurred: 22:06:27 (1 occurrences)
Last logged: 22:06:27

Traceback (most recent call last): File "/config/custom_components/ytube_music_player/media_player.py", line 406, in _update_playlists extra_info = self._api.get_playlist(playlistId=playlist['playlistId']) File "/usr/local/lib/python3.8/site-packages/ytmusicapi/mixins/playlists.py", line 100, in get_playlist playlist['tracks'].extend(parse_playlist_items(results['contents'])) KeyError: 'contents'`

Seems like everything is set up correctly

  • HACS install worked normally
  • grabbed cookie and all seems to be fine with the configflow
  • config.yaml entered correctly
  • Seeing speakers and input selects in the ytube entities that were created
  • Im able to turn the ytube media player on and it speaks to my devices
  • input_select.ytube_music_player_playlist is borked and stuck on "loading"

Any ideas?

Long term - Multiple Accounts

I don't believe this is currently a feature of the solution, but I'd like to have multiple accounts. This could be multiple ytube music player instances... or whatever.

The use case is simple: she has a Nest mini in an area, I have a separate one elsewhere. We each have our own ytm accounts. I'd love to be able to play music for her with HA. I want that for me, too. Different music preferences, playlists, etc.

I know this won't be the near-term goal of the project, but if it can be part of a later version, I'd be a BIG fan.

Playlists not coming through, also clarification on usage

Enable DEBUG Output
Please see: https://github.com/KoljaWindeler/ytube_music_player/#debug-information

Describe the bug
A clear and concise description of what the bug is, ideally a homeassistant log with debug enabled

Great work on this, thank you very much. I have playlists in youtube music that aren't coming through either to the media browser or the input_select.

Version
please provide the version you are using (see HACS) latest from HACS

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

I've added some playlists, and can play them from ytube fine if I specify the id, but I can't see them in homeassistant.

image

Only 'Your Likes' is available.

image

Additional context
Add any other context about the problem here.

Thanks

ValueError: invalid literal for int() with base 10: '1,224'

2020-12-16 20:55:11 ERROR (SyncWorker_4) [custom_components.ytube_music_player.media_player] Traceback (most recent call last):
File "/config/custom_components/ytube_music_player/media_player.py", line 407, in _update_playlists
extra_info = self._api.get_playlist(playlistId=playlist['playlistId'])
File "/usr/local/lib/python3.8/site-packages/ytmusicapi/mixins/playlists.py", line 91, in get_playlist
song_count = to_int(
File "/usr/local/lib/python3.8/site-packages/ytmusicapi/helpers.py", line 71, in to_int
return locale.atoi(number)
File "/usr/local/lib/python3.8/locale.py", line 330, in atoi
return int(delocalize(string))
ValueError: invalid literal for int() with base 10: '1,224'
2020-12-16 20:55:11 ERROR (SyncWorker_4) [custom_components.ytube_music_player.media_player]
thanks, Kolja
2020-12-16 20:55:11 ERROR (SyncWorker_4) [custom_components.ytube_music_player.media_player] ============= ytube_music_player Integration Error ================

Support other mediaplayer

Currently cast devices work fine (but will log an error) many other devices aren't working. This could be due to the very long url or something completely different .. might be worth to look into

Add support for Adding Playlists and songs to MediaBrowser

Similar to Spotify App,
Add Contents of Playlists to MediaBrowser HA component...

*** things of note ***
Existing known issue would be the length the URL is vaild for and needing to refresh the content if we can't get the url when a song is requested.
Limits on enumerating all playlists and songs in those playlists. (Other people have described issues with this) These actions would also further the need to ensure these tasks are using asyncio.)

Autoload all Mediaplayer

Try to get ALL Mediaplayer and autofill the list with them
If one mediaplayer is provided as configuration: preselect this one on load

Also add this option to the config flow

cookie issue on latest release 20200110

Hello,
the integration fails to set up via the config flow, due to cookie error (on v. 20200110).
Error says 'Something with your cookie wasn't right. Format and fields are ok but the login failed'.

Previous version worked fine.
Tried different browsers, different PCs and log out - log in.

Raising this issue to see if it is something wrong with my cookie or a more general problem.

Thanks for your work.

Problem with integration

What I can get working: setting everything up, and pressing power on or play to play a random song.

Where I'm stuck: trying to use Mini Media Player to set up shortcut buttons to play specific channels or playlists. I get the below error when pressing on such a button.

- name: Name
  type: channel
  id: UCUJ3KuIIgvh8eVItvb-EdFQ

(For this https://music.youtube.com/channel/UCUJ3KuIIgvh8eVItvb-EdFQ)

See error log below.

Logger: custom_components.ytube_music_player.media_player
Source: custom_components/ytube_music_player/media_player.py:1171
Integration: YouTube Music Player (documentation, issues)
First occurred: 1:08:18 PM (1 occurrences)
Last logged: 1:08:18 PM

Traceback (most recent call last): File "/config/custom_components/ytube_music_player/media_player.py", line 984, in play_media self._tracks = self._api.get_playlist(playlistId=media_id)['tracks'] File "/usr/local/lib/python3.8/site-packages/ytmusicapi/mixins/playlists.py", line 66, in get_playlist results = nav(response, SINGLE_COLUMN_TAB + SECTION_LIST)[0]['musicPlaylistShelfRenderer'] File "/usr/local/lib/python3.8/site-packages/ytmusicapi/parsers/utils.py", line 167, in nav raise err File "/usr/local/lib/python3.8/site-packages/ytmusicapi/parsers/utils.py", line 161, in nav root = root[k] KeyError: 'contents'

HA detected I/O inside the event loop

Enable DEBUG Output
Please see: https://github.com/KoljaWindeler/ytube_music_player/#debug-information

Describe the bug
A clear and concise description of what the bug is, ideally a homeassistant log with debug enabled

Two Log entries from HA asking me to send them to you.

Detected I/O inside the event loop. This is causing stability issues. Please report issue to the custom component author for ytube_music_player doing I/O at custom_components/ytube_music_player/const.py, line 245: api = YTMusic(user_input[CONF_HEADER_PATH])
Detected I/O inside the event loop. This is causing stability issues. Please report issue to the custom component author for ytube_music_player doing I/O at custom_components/ytube_music_player/const.py, line 246: api.get_library_songs()

Version
please provide the version you are using (see HACS)
20200110

To Reproduce
Steps to reproduce the behavior:
Just start HA with the addin installed. (Used the new way btw aka removed all remnants of the former way from configuration.yaml and cleanly reinstalled it)

Additional context
Add any other context about the problem here.

Thanks

Stop after every track

Enable DEBUG Output
Logger: custom_components.ytube_music_player.media_player
Source: custom_components/ytube_music_player/media_player.py:306
Integration: YouTube Music Player (documentation, issues)
First occurred: 17:05:39 (1 occurrences)
Last logged: 17:05:39

self._state is: (playing).

Describe the bug
Traceback (most recent call last):
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/ytube_music_player/media_player.py", line 433, in _sync_player
if _player.state == 'playing' and _player.attributes['media_position']>0:
TypeError: '>' not supported between instances of 'str' and 'int'

Version
20210106

Additional context
Stop after each track. If I switch the track to manual then I hear the next one. But when playing after each track, stop. I'm using speakers connected to the pi. media player mpd addon. Thank you.

Thanks

Integration not showing up

Hi,

The integration never shows up for me under Configuration -> Integrations -> Add Integration. I have tried several different browsers, cleared the browser cache, restarted HA all to no avail.

Any ideas?

Thanks,

Mark

Input field for playmode

Add input field for shuffle/random mode. So the user CAN change the playmode without rebooting

Unable to play from playlist

Can't seem to get the player to work after I redid my playlists on Youtube Music. Now it just errors when I try to cast to my speaker group.

Logger: homeassistant.components.websocket_api.http.connection
Source: custom_components/ytube_music_player/media_player.py:691
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 1:14:16 AM (1 occurrences)
Last logged: 1:14:16 AM

[548279126960] object of type 'NoneType' has no len()
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 135, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1445, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1480, in _execute_service
    await handler.job.target(service_call)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 204, in handle_service
    await self.hass.helpers.service.entity_service_call(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 593, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 664, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 630, in _handle_entity_call
    await result
  File "/usr/src/homeassistant/homeassistant/components/media_player/__init__.py", line 748, in async_toggle
    await self.async_turn_on()
  File "/usr/src/homeassistant/homeassistant/components/media_player/__init__.py", line 550, in async_turn_on
    await self.hass.async_add_executor_job(self.turn_on)
  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/ytube_music_player/media_player.py", line 280, in turn_on
    self._play()
  File "/config/custom_components/ytube_music_player/media_player.py", line 680, in _play
    self._get_track()
  File "/config/custom_components/ytube_music_player/media_player.py", line 691, in _get_track
    _LOGGER.debug("Playing track nr "+str(self._next_track_no)+" / "+str(len(self._tracks)))
TypeError: object of type 'NoneType' has no len()

Playlist with training space cannot be played

I discovered that one of my playlists would not work. Took me a bit to discover that the playlist name had a trailing space. "Christmas " instead of "Christmas". While it would show in the input select, you could not choose it.
I was able to work around the problem by removing the space in the playlist name, but you might want to account for this possible issue in code.

Add support for MediaSource

Hi,
The work you've done is great and I'm looking forward to it being developed further.
One thing that I think would be very useful is to add MediaSource support, so one could browse YouTube music from a side panel or - even better - from any player which supports MediaSource (currently Chromecasts). The rationale behind is that one doesn't have to add another entity to the UI to browse files. For instance I'd love to be able to pick a YouTube music playlist directly from my Chromecast entity in the UI. That's what Media Source is all about.

I mean this thing here: https://github.com/home-assistant/core/tree/dev/homeassistant/components/media_source

Looks like Xbox and Netatmo integration added it so far, so not too many examples, but still something to explore.

Keep on doing the great work!

Do you want me to add GitHub actions?

If you want, I can add some advanced CI to your repo in a PR. Let me know if you want that.

  • Do you want to enable auto-formatting?
  • Do you want packaged or independent (I recommend packaged because I can send updates)?

Add support for brand accounts

I reinstalled ytube_music_player but I get the same error.

Logger: homeassistant
Source: custom_components/ytube_music_player/media_player.py:387
First occurred: 19:07:51 (1 occurrences)
Last logged: 19:07:51

Error doing job: Future exception was never retrieved
Traceback (most recent call last):
  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/ytube_music_player/media_player.py", line 356, in _update_sources
    self._update_playlists()
  File "/config/custom_components/ytube_music_player/media_player.py", line 387, in _update_playlists
    self._playlists = self._api.get_library_playlists(limit = 99)
  File "/usr/local/lib/python3.8/site-packages/ytmusicapi/mixins/library.py", line 29, in get_library_playlists
    results = find_object_by_key(nav(response, SINGLE_COLUMN_TAB + SECTION_LIST),
  File "/usr/local/lib/python3.8/site-packages/ytmusicapi/parsers/utils.py", line 148, in nav
    raise err
  File "/usr/local/lib/python3.8/site-packages/ytmusicapi/parsers/utils.py", line 142, in nav
    root = root[k]
KeyError: 'contents'

Error with version 20201221

Hi. Just updated to the new version via HACS. (20201221) The following error shows up in the logs. I've tried to regenerate the header file but did not fix it.

2020-12-21 18:35:28 INFO (MainThread) [homeassistant.components.media_player] Setting up media_player.ytube_music_player
2020-12-21 18:35:28 INFO (MainThread) [homeassistant.components.media_player] Setting up media_player.ytube_music_player
2020-12-21 18:35:28 INFO (MainThread) [homeassistant.setup] Setup of domain scene took 3.6 seconds
2020-12-21 18:35:28 ERROR (SyncWorker_19) [custom_components.ytube_music_player.media_player]
============= ytube_music_player Integration Error ================
2020-12-21 18:35:28 ERROR (SyncWorker_19) [custom_components.ytube_music_player.media_player] unfortunately we hit an error in the sub api, please open a ticket at
2020-12-21 18:35:28 ERROR (SyncWorker_19) [custom_components.ytube_music_player.media_player] https://github.com/sigma67/ytmusicapi/issues
2020-12-21 18:35:28 ERROR (SyncWorker_19) [custom_components.ytube_music_player.media_player] and paste the following output:
2020-12-21 18:35:28 ERROR (SyncWorker_19) [custom_components.ytube_music_player.media_player] Traceback (most recent call last):
File "/config/custom_components/ytube_music_player/media_player.py", line 91, in __init__
self._api = ytmusicapi.YTMusic(config.get(CONF_HEADER_PATH, default_header_file))
File "/usr/local/lib/python3.8/site-packages/ytmusicapi/ytmusic.py", line 96, in __init__
self.sapisid = sapisid_from_cookie(self.headers['Cookie'])
File "/usr/local/lib/python3.8/site-packages/ytmusicapi/helpers.py", line 57, in sapisid_from_cookie
return cookie['__Secure-3PAPISID'].value
KeyError: '__Secure-3PAPISID'
2020-12-21 18:35:28 ERROR (SyncWorker_19) [custom_components.ytube_music_player.media_player]
thanks, Kolja
2020-12-21 18:35:28 ERROR (SyncWorker_19) [custom_components.ytube_music_player.media_player] ============= ytube_music_player Integration Error ================

Thanks

Log File Error

Enable DEBUG Output
Please see: https://github.com/KoljaWindeler/ytube_music_player/#debug-information

Describe the bug

I installed the integration, added the cookie, and the full_control yaml view in the packages folder. The playlists do not seem to load and the following error shows up in the log.

2021-01-10 22:07:35 ERROR (SyncWorker_0) [custom_components.ytube_music_player.media_player] Traceback (most recent call last):
File "/config/custom_components/ytube_music_player/media_player.py", line 705, in _update_playlists
self._playlists = self._api.get_library_playlists(limit = 99)
File "/usr/local/lib/python3.8/site-packages/ytmusicapi/mixins/library.py", line 39, in get_library_playlists
get_continuations(results, 'gridContinuation', limit - len(playlists),
File "/usr/local/lib/python3.8/site-packages/ytmusicapi/parsers/utils.py", line 86, in get_continuations
contents = get_continuation_contents(results, parse_func)
File "/usr/local/lib/python3.8/site-packages/ytmusicapi/parsers/utils.py", line 129, in get_continuation_contents
return parse_func(continuation[term])
File "/usr/local/lib/python3.8/site-packages/ytmusicapi/mixins/library.py", line 37, in
parse_func = lambda contents: parse_content_list(contents, parse_playlist)
File "/usr/local/lib/python3.8/site-packages/ytmusicapi/parsers/browsing.py", line 165, in parse_content_list
contents.append(parse_func(result['musicTwoRowItemRenderer']))
File "/usr/local/lib/python3.8/site-packages/ytmusicapi/parsers/browsing.py", line 202, in parse_playlist
'title': nav(data, TITLE_TEXT),
File "/usr/local/lib/python3.8/site-packages/ytmusicapi/parsers/utils.py", line 167, in nav
raise err
File "/usr/local/lib/python3.8/site-packages/ytmusicapi/parsers/utils.py", line 161, in nav
root = root[k]
KeyError: 'runs'

2021-01-10 22:07:35 ERROR (SyncWorker_0) [custom_components.ytube_music_player.media_player]

Version
20200110

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Additional context
Add any other context about the problem here.

Thanks

Component not working

============= ytube_music_player Integration Error ================
2021-01-07 15:30:32 ERROR (SyncWorker_18) [custom_components.ytube_music_player.media_player] unfortunately we hit an error in the sub api, please open a ticket at
2021-01-07 15:30:32 ERROR (SyncWorker_18) [custom_components.ytube_music_player.media_player] https://github.com/sigma67/ytmusicapi/issues
2021-01-07 15:30:32 ERROR (SyncWorker_18) [custom_components.ytube_music_player.media_player] and paste the following output:

2021-01-07 15:30:32 ERROR (SyncWorker_18) [custom_components.ytube_music_player.media_player] Traceback (most recent call last):
File "/config/custom_components/ytube_music_player/media_player.py", line 143, in check_api
self._api = ytmusicapi.YTMusic(self._header_file)
File "/usr/local/lib/python3.8/site-packages/ytmusicapi/ytmusic.py", line 96, in init
self.sapisid = sapisid_from_cookie(self.headers['Cookie'])
File "/usr/local/lib/python3.8/site-packages/ytmusicapi/helpers.py", line 57, in sapisid_from_cookie
return cookie['__Secure-3PAPISID'].value
KeyError: '__Secure-3PAPISID'

2021-01-07 15:30:32 ERROR (SyncWorker_18) [custom_components.ytube_music_player.media_player]
thanks, Kolja
2021-01-07 15:30:32 ERROR (SyncWorker_18) [custom_components.ytube_music_player.media_player] ============= ytube_music_player Integration Error ================

Error on boot

Can you pls check why I am receiving this error:

Logger: homeassistant.components.media_player
Source: custom_components/ytube_music_player/media_player.py:74
Integration: Media player (documentation, issues)
First occurred: 8:57:39 PM (1 occurrences)
Last logged: 8:57:39 PM

Error while setting up ytube_music_player platform for media_player
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_

platform.py", line 199, 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/ytube_music_player/media_player.py", line 43, in setup_platform
    add_entities([yTubeMusicComponent(hass, config)], True)
  File "/config/custom_components/ytube_music_player/media_player.py", line 74, in __init__
    self._api = YTMusic(config.get(CONF_HEADER_PATH, default_header_file))
  File "/usr/local/lib/python3.8/site-packages/ytmusicapi/ytmusic.py", line 96, in __init__
    self.sapisid = sapisid_from_cookie(self.headers['Cookie'])
  File "/usr/local/lib/python3.8/site-packages/ytmusicapi/helpers.py", line 57, in sapisid_from_cookie
    return cookie['__Secure-3PAPISID'].value
KeyError: '__Secure-3PAPISID'

System Health

version 1.0.0b0
installation_type Home Assistant OS
dev false
hassio true
docker true
virtualenv false
python_version 3.8.6
os_name Linux
os_version 5.4.81
arch x86_64
timezone Europe/Brussels
Home Assistant Cloud
logged_in false
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
Hass.io
host_os HassOS 4.19
update_channel beta
supervisor_version 2020.12.4
docker_version 19.03.12
disk_total 19.0 GB
disk_used 10.6 GB
healthy true
supported true
board ova
supervisor_api ok
version_api ok
installed_addons Terminal & SSH (8.6.0), AppDaemon 4 (0.3.2), WireGuard (0.4.0), Mosquitto broker (5.1), Home Assistant Google Drive Backup (0.102.0), SSH & Web Terminal (7.8.0), Visual Studio Code (2.9.1), API Consumer (0.101), Check Home Assistant configuration (3.6.0), TasmoBackup (1.04.02), chrony (1.1.2), JupyterLab Lite (0.3.1)
Lovelace
dashboards 2
mode storage
views 18
resources 27

Service end point for reload speaker list and albums

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Call service to refresh drop downs

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

No module named 'integrationhelper'

Hi, i'm trying to add new integration with config flow in HA and i'm getting this error, any idea what (if anything) i'm doing wrong?

Logger: homeassistant.config_entries
Source: config_entries.py:537
First occurred: 18:51:14 (2 occurrences)
Last logged: 19:00:55

Error occurred loading configuration flow for integration ytube_music_player: No module named 'integrationhelper'

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.