Open bfrggit opened 2 years ago
Same here. Cant play anything ERROR 2022-02-13 17:18:31,568 [77098:YTMusicBackend-3] mopidy_ytmusic translate_uri error "'NoneType' object has no attribute 'get_signature'" WARNING 2022-02-13 17:18:31,569 [77098:Core-9] mopidy.core.tracklist Track is not playable: ytmusic:track:-Fe0vU205H4
Fixed this locally by updating pytube
and ytmusicapi
to the latest versions (12.0.0
and 0.20.0
respectively). Songs are definitely playing and I'm no longer seeing the get_signature
error. When I get a chance I'll put a PR together.
My installed versions are mopidy-ytmusic = 3.1.1 ytmusicapi = 2.25.1 pytube = 12.0.0
I am getting the following errors
Apr 15 21:35:42 MusicBox mopidy[18739]: Exception in thread Thread-6: Apr 15 21:35:42 MusicBox mopidy[18739]: Traceback (most recent call last): Apr 15 21:35:42 MusicBox mopidy[18739]: File "/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner Apr 15 21:35:42 MusicBox mopidy[18739]: self.run() Apr 15 21:35:42 MusicBox mopidy[18739]: File "/usr/local/lib/python3.9/dist-packages/mopidy_ytmusic/repeating_timer.py", line 18, in run Apr 15 21:35:42 MusicBox mopidy[18739]: self._method() Apr 15 21:35:42 MusicBox mopidy[18739]: File "/usr/local/lib/python3.9/dist-packages/mopidy_ytmusic/backend.py", line 99, in _refresh_youtube_player Apr 15 21:35:42 MusicBox mopidy[18739]: self.playback.update_cipher(playerurl=url) Apr 15 21:35:42 MusicBox mopidy[18739]: File "/usr/local/lib/python3.9/dist-packages/mopidy_ytmusic/playback.py", line 25, in update_cipher Apr 15 21:35:42 MusicBox mopidy[18739]: self.PyTubeCipher = Cipher(js=response.text) Apr 15 21:35:42 MusicBox mopidy[18739]: File "/usr/local/lib/python3.9/dist-packages/pytube/cipher.py", line 43, in init Apr 15 21:35:42 MusicBox mopidy[18739]: self.throttling_plan = get_throttling_plan(js) Apr 15 21:35:42 MusicBox mopidy[18739]: File "/usr/local/lib/python3.9/dist-packages/pytube/cipher.py", line 405, in get_throttling_plan Apr 15 21:35:42 MusicBox mopidy[18739]: raw_code = get_throttling_function_code(js) Apr 15 21:35:42 MusicBox mopidy[18739]: File "/usr/local/lib/python3.9/dist-packages/pytube/cipher.py", line 311, in get_throttling_function_code Apr 15 21:35:42 MusicBox mopidy[18739]: name = re.escape(get_throttling_function_name(js)) Apr 15 21:35:42 MusicBox mopidy[18739]: File "/usr/local/lib/python3.9/dist-packages/pytube/cipher.py", line 296, in get_throttling_function_name Apr 15 21:35:42 MusicBox mopidy[18739]: raise RegexMatchError( Apr 15 21:35:42 MusicBox mopidy[18739]: pytube.exceptions.RegexMatchError: get_throttling_function_name: could not find match for multiple Apr 15 21:36:11 MusicBox mopidy[18739]: INFO [MpdSession-28] mopidy_mpd.session New MPD connection from [::ffff:127.0.0.1]:52586 Apr 15 21:36:25 MusicBox mopidy[18739]: ERROR [YTMusicBackend-4] mopidy_ytmusic translate_uri error "'NoneType' object has no attribute 'get_signature'" Apr 15 21:36:25 MusicBox mopidy[18739]: WARNING [Core-18] mopidy.core.tracklist Track is not playable: ytmusic:track:RcQiR7Dkfao
Looks like this is caused by a bug in pytube. Link to the comment with workaround: https://github.com/pytube/pytube/issues/1293#issuecomment-1103362815. There is a manual workaround to replace the regex - it works for me
As instructed in the
setup
step, I pasted in the request headers of a POST request. Now I can see the YouTube playlists and auto playlists, however whenever I try to play a song, progress bar (Iris) shows 3~4 sec of progress and then stop. MPD client clicking on play button has no effect at all.