[GH-ISSUE #412] unable to play music #311

Closed
opened 2026-02-27 23:00:07 +03:00 by kerem · 1 comment
Owner

Originally created by @jurgenweber on GitHub (Jul 19, 2023).
Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/412

Hello and thanks for using ytmusicapi! Please fill out the issue template below. Issues not following this template will be closed without comment. If you have a question only, please use GitHub discussions or gitter (linked in README).

**Describe the bug**
music no longer plays

**To Reproduce**
when I hit play I get the following error

```
2023-07-19 13:29:33.297 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140376120406096] get_transform_object: could not find match for var for={(.*?)};
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 205, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1965, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2005, in _execute_service
    return await cast(
           ^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 235, in handle_service
    return await service.entity_service_call(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 848, in entity_service_call
    response_data = task.result()  # pop exception if have
                    ^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1192, in async_request_call
    return await coro
           ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 892, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/config/custom_components/ytube_music_player/media_player.py", line 1465, in async_play_media
    if(not(await self.async_prepare_play())):
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/ytube_music_player/media_player.py", line 588, in async_prepare_play
    await self.async_get_cipher('BB2mjBuAtiQ')
  File "/config/custom_components/ytube_music_player/media_player.py", line 706, in async_get_cipher
    self._cipher = pytube.cipher.Cipher(js=self._js)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/ytube_music_player/media_player.py", line 51, in patched__init__
    self.transform_map = pytube.cipher.get_transform_map(js, var)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pytube/cipher.py", line 218, in get_transform_map
    transform_object = get_transform_object(js, var)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pytube/cipher.py", line 200, in get_transform_object
    raise RegexMatchError(caller="get_transform_object", pattern=pattern)
pytube.exceptions.RegexMatchError: get_transform_object: could not find match for var for={(.*?)};
```

**Additional context**
I tried restarting HASS
Originally created by @jurgenweber on GitHub (Jul 19, 2023). Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/412 # Hello and thanks for using ytmusicapi! Please fill out the issue template below. Issues not following this template will be closed without comment. If you have a question only, please use GitHub discussions or gitter (linked in README). ~~~~~~~~~~~~~ **Describe the bug** music no longer plays **To Reproduce** when I hit play I get the following error ``` 2023-07-19 13:29:33.297 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140376120406096] get_transform_object: could not find match for var for={(.*?)}; Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 205, in handle_call_service await hass.services.async_call( File "/usr/src/homeassistant/homeassistant/core.py", line 1965, in async_call response_data = await coro ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2005, in _execute_service return await cast( ^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 235, in handle_service return await service.entity_service_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 848, in entity_service_call response_data = task.result() # pop exception if have ^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1192, in async_request_call return await coro ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 892, in _handle_entity_call result = await task ^^^^^^^^^^ File "/config/custom_components/ytube_music_player/media_player.py", line 1465, in async_play_media if(not(await self.async_prepare_play())): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/ytube_music_player/media_player.py", line 588, in async_prepare_play await self.async_get_cipher('BB2mjBuAtiQ') File "/config/custom_components/ytube_music_player/media_player.py", line 706, in async_get_cipher self._cipher = pytube.cipher.Cipher(js=self._js) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/ytube_music_player/media_player.py", line 51, in patched__init__ self.transform_map = pytube.cipher.get_transform_map(js, var) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/pytube/cipher.py", line 218, in get_transform_map transform_object = get_transform_object(js, var) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/pytube/cipher.py", line 200, in get_transform_object raise RegexMatchError(caller="get_transform_object", pattern=pattern) pytube.exceptions.RegexMatchError: get_transform_object: could not find match for var for={(.*?)}; ``` **Additional context** I tried restarting HASS
kerem closed this issue 2026-02-27 23:00:07 +03:00
Author
Owner

@jurgenweber commented on GitHub (Jul 19, 2023):

lol, in the wrong project. :)

<!-- gh-comment-id:1641362489 --> @jurgenweber commented on GitHub (Jul 19, 2023): lol, in the wrong project. :)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ytmusicapi#311
No description provided.