Get map_functions: could not find match for multiple
linkwellfook opened this issue · 1 comments
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:
- Go to '...'
- Click on '....'
- Scroll down to '....'
- See error
Additional context
Add any other context about the problem here.
Thanks
When playing a track I get the following error
map_functions: could not find match for multiple
Home Assistant 2024.8 VM
Youtup Media Palyer Version number: 20240709.01
Card used: mini-media-player
Card code
type: custom:mini-media-player entity: media_player.ytube_music_player name: Youtube Music artwork: cover hide: shuffle: true icon_state: true
Steps to reproduce
Click on the mini-media-player
Click on Browse Media
Click on any of the selections eg 'Last played song'
Select a track
Click on Play
The error pops up
Debug output
2024-08-09 15:25:40.881 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] [S] TURNON 2024-08-09 15:25:40.881 ERROR (MainThread) [custom_components.ytube_music_player.media_player] playlist to index is none! 2024-08-09 15:25:40.885 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] [S] async_turn_off_media_player [E] 2024-08-09 15:25:40.885 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] [E] (fail) TURNON 2024-08-09 15:25:42.151 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] async_browse_media 2024-08-09 15:25:42.152 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] [S] async_check_api [E] 2024-08-09 15:25:43.943 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] async_browse_media 2024-08-09 15:25:43.943 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] [S] async_check_api [E] 2024-08-09 15:25:43.944 DEBUG (MainThread) [custom_components.ytube_music_player.browse_media] - build_item_response for: history 2024-08-09 15:25:44.625 DEBUG (MainThread) [custom_components.ytube_music_player.browse_media] - Calc / grab time: 0.681616 sec 2024-08-09 15:25:45.754 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] [S] play_media, media_type: track, media_id: oCWordf7uLQ 2024-08-09 15:25:45.754 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] [S] async_prepare_play 2024-08-09 15:25:45.754 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] [S] async_check_api [E] 2024-08-09 15:25:45.754 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] [S] async_update_remote_player(Input / current media_player.office) [E] 2024-08-09 15:25:45.755 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] [S] async_turn_on_media_player [E] 2024-08-09 15:25:45.962 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] [S] async_get_cipher 2024-08-09 15:25:45.962 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] [S] async_sync_player ... media_player.office: off -> idle ... not playing [E] 2024-08-09 15:25:46.695 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140196988463296] Unexpected exception Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 241, in handle_call_service response = await hass.services.async_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2763, in async_call response_data = await coro ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2806, in _execute_service return await target(service_call) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 999, in entity_service_call single_response = await _handle_entity_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1071, in _handle_entity_call result = await task ^^^^^^^^^^ File "/config/custom_components/ytube_music_player/media_player.py", line 1623, in async_play_media if(not(await self.async_prepare_play())): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/ytube_music_player/media_player.py", line 617, in async_prepare_play await self.async_get_cipher('BB2mjBuAtiQ') File "/config/custom_components/ytube_music_player/media_player.py", line 735, in async_get_cipher self._cipher = pytube.cipher.Cipher(js=self._js) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/ytube_music_player/media_player.py", line 48, in patched__init__ self.transform_map = pytube.cipher.get_transform_map(js, var) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pytube/cipher.py", line 250, in get_transform_map fn = map_functions(function) ^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pytube/cipher.py", line 697, in map_functions raise RegexMatchError(caller="map_functions", pattern="multiple") pytube.exceptions.RegexMatchError: map_functions: could not find match for multiple 2024-08-09 15:25:48.484 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] [S] play_media, media_type: history, media_id: history 2024-08-09 15:25:48.484 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] [S] async_prepare_play 2024-08-09 15:25:48.484 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] [S] async_check_api [E] 2024-08-09 15:25:48.484 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] [S] async_update_remote_player(Input / current media_player.Office) [E] 2024-08-09 15:25:48.485 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] self._state is: (idle). 2024-08-09 15:25:49.363 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140196988463296] Unexpected exception Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 241, in handle_call_service response = await hass.services.async_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2763, in async_call response_data = await coro ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2806, in _execute_service return await target(service_call) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 999, in entity_service_call single_response = await _handle_entity_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1071, in _handle_entity_call result = await task ^^^^^^^^^^ File "/config/custom_components/ytube_music_player/media_player.py", line 1623, in async_play_media if(not(await self.async_prepare_play())): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/ytube_music_player/media_player.py", line 617, in async_prepare_play await self.async_get_cipher('<removed>') File "/config/custom_components/ytube_music_player/media_player.py", line 735, in async_get_cipher self._cipher = pytube.cipher.Cipher(js=self._js) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/ytube_music_player/media_player.py", line 48, in patched__init__ self.transform_map = pytube.cipher.get_transform_map(js, var) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pytube/cipher.py", line 250, in get_transform_map fn = map_functions(function) ^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pytube/cipher.py", line 697, in map_functions raise RegexMatchError(caller="map_functions", pattern="multiple") pytube.exceptions.RegexMatchError: map_functions: could not find match for multiple