OzymandiasTheGreat / mopidy-ytmusic

Mopidy extension for playling music/managing playlists in Youtube Music
Apache License 2.0
80 stars 28 forks source link

Having trouble playing any track from YTMusic #32

Open familyguy0398 opened 3 years ago

familyguy0398 commented 3 years ago

I am having trouble playing any track. I have not had any issues before today and I already ran the re-auth several times. I am not sure if I am missing something. I am running Mopidy as a service and making sure I am using the right commands for re-auth. You can see the error messages attached and any help is greatly appreciated

May 29 17:55:34 raspberrypi mopidy[18121]: ERROR [YTMusicBackend-3] mopidy_ytmusic No streams found for DddHGLDc4J0. Falling back to youtube-dl. May 29 17:55:34 raspberrypi mopidy[18121]: WARNING [Core-11] mopidy.core.tracklist Track is not playable: ytmusic:track:DddHGLDc4J0 May 29 17:55:35 raspberrypi mopidy[18121]: ERROR [YTMusicBackend-3] mopidy_ytmusic No streams found for tcig6XUIp5c. Falling back to youtube-dl. May 29 17:55:35 raspberrypi mopidy[18121]: WARNING [Core-11] mopidy.core.tracklist Track is not playable: ytmusic:track:tcig6XUIp5c May 29 17:55:35 raspberrypi mopidy[18121]: ERROR [YTMusicBackend-3] mopidy_ytmusic No streams found for SjAgP7GwsGA. Falling back to youtube-dl. May 29 17:55:35 raspberrypi mopidy[18121]: WARNING [Core-11] mopidy.core.tracklist Track is not playable: ytmusic:track:SjAgP7GwsGA May 29 17:55:36 raspberrypi mopidy[18121]: ERROR [YTMusicBackend-3] mopidy_ytmusic No streams found for pOOItvMnMB0. Falling back to youtube-dl. May 29 17:55:36 raspberrypi mopidy[18121]: WARNING [Core-11] mopidy.core.tracklist Track is not playable: ytmusic:track:pOOItvMnMB0 May 29 17:55:38 raspberrypi mopidy[18121]: ERROR [YTMusicBackend-3] mopidy_ytmusic No streams found for fFQ82ZMpaL8. Falling back to youtube-dl. May 29 17:55:38 raspberrypi mopidy[18121]: WARNING [Core-11] mopidy.core.tracklist Track is not playable: ytmusic:track:fFQ82ZMpaL8

mopidyissue

OzymandiasTheGreat commented 3 years ago

Are you running the latest version? Because this looks like the issue @impliedchaos just fixed.

familyguy0398 commented 3 years ago

Are you running the latest version? Because this looks like the issue @impliedchaos just fixed.

I ran "sudo python3 -m pip install Mopidy-YTMusic" to try to fix the problem but it didn't make a difference. Is there more to the update process than this? I am very new with Mopidy and apologize for my ignorance

OzymandiasTheGreat commented 3 years ago

Try adding the --upgrade flag after install. As far as I know, pip doesn't install newer versions without it. Just run sudo python3 -m pip install --upgrade mopidy-ytmusic and report how it goes. It should print that mopidy-ytmusic 0.3.0 was installed.

familyguy0398 commented 3 years ago

Try adding the --upgrade flag after install. As far as I know, pip doesn't install newer versions without it. Just run sudo python3 -m pip install --upgrade mopidy-ytmusic and report how it goes. It should print that mopidy-ytmusic 0.3.0 was installed.

Perfect! That worked without a hitch and I am back to listening to my playlists. Thanks a lot for your quick and helpful response! Is the upgrade process noted anywhere in the documentation? Because if so, I did not see it

lokiberra commented 3 years ago

I have 0.3.0 installed and I am getting the same error. Let me know if there is some additional information I can provide

lokiberra commented 3 years ago

The error I'm getting on 0.3.0: Sep 01 16:21:03 Mopidy mopidy[436]: ERROR [YTMusicBackend-3] mopidy_ytmusic translate_uri error "'NoneType' object has no attribute 'get_signature'" Sep 01 16:21:03 Mopidy mopidy[436]: WARNING [Core-10] mopidy.core.tracklist Track is not playable: ytmusic:track:8Znfc-x9Fho

ljnui69hg6 commented 3 years ago

Same error here: mopidy_ytmusic translate_uri error "'NoneType' object has no attribute 'get_signature'"

ljnui69hg6 commented 3 years ago

No change after update to Mopidy-YTMusic-0.3.1: ERROR [YTMusicBackend-3] mopidy_ytmusic translate_uri error "'NoneType' object has no attribute 'get_signature'" WARNING [Core-9] mopidy.core.tracklist Track is not playable: ytmusic:track:BE5GpoKijus

impliedchaos commented 3 years ago

The only reason this would happen is if it was unable to get the URL to the current player javascript file. Which should generate an error like "YTMusic unable to extract player URL". So is this the only error?

lokiberra commented 3 years ago

I still have the same issue too after upgrading to 0.3.1. I also tried uninstalling and re-authenticating. Is there somewhere I can look for additional errors? Thanks for the help!

Sep 05 16:11:35 Mopidy mopidy[6657]: ERROR [YTMusicBackend-3] mopidy_ytmusic translate_uri error "'NoneType' object has no attribute 'get_signature'" Sep 05 16:11:35 Mopidy mopidy[6657]: WARNING [Core-15] mopidy.core.tracklist Track is not playable: ytmusic:track:MTdYFZm4zK0

lokiberra commented 3 years ago

Some additional logs after turning the verbosity up:

Sep 05 16:25:34 Mopidy mopidy[6733]: DEBUG [Audio-2] mopidy.audio.gst Changing state to GST_STATE_READY: result=GST_STATE_CHANGE_SUCCESS Sep 05 16:25:34 Mopidy mopidy[6733]: DEBUG [YTMusicBackend-3] mopidy_ytmusic YTMusic PlaybackProvider.translate_uri "ytmusic:track:1bbW0nUBXOI" Sep 05 16:25:34 Mopidy mopidy[6733]: DEBUG [YTMusicBackend-3] urllib3.connectionpool https://music.youtube.com:443 "POST /youtubei/v1/player?alt=json&key=AIzaSyC9XL3ZjWddXya6X74dJoCTL-WEYFDNX30 Sep 05 16:25:34 Mopidy mopidy[6733]: DEBUG [YTMusicBackend-3] mopidy_ytmusic Found #1 preference stream 141 Sep 05 16:25:34 Mopidy mopidy[6733]: ERROR [YTMusicBackend-3] mopidy_ytmusic translate_uri error "'NoneType' object has no attribute 'get_signature'" Sep 05 16:25:34 Mopidy mopidy[6733]: DEBUG [YTMusicBackend-3] mopidy_ytmusic Backend translated URI from ytmusic:track:1bbW0nUBXOI to None Sep 05 16:25:34 Mopidy mopidy[6733]: WARNING [Core-15] mopidy.core.tracklist Track is not playable: ytmusic:track:1bbW0nUBXOI

impliedchaos commented 3 years ago

Thanks, since you turned up the verbosity, maybe we can check some things.

First, can you search for all errors: grep ERROR [mopidy log filename].

Then, let's specifically look for any issues with the following: grep signatureTimestamp [mopidy log file] and grep "layer URL" [mopidy log file].

Thanks again.

lokiberra commented 3 years ago

grep ERROR [mopidy log filename] returns: Sep 05 15:27:46 Mopidy mopidy[6464]: ERROR [YTMusicBackend-3] mopidy_ytmusic YTMusic unable to get image url for ytmusic:artist:MPLAUCQUFDXfCns0dJE7PPAXIWNg Sep 05 15:27:46 Mopidy mopidy[6464]: ERROR [YTMusicBackend-3] mopidy_ytmusic YTMusic unable to get image url for ytmusic:artist:MPLAUCMplVYEWcY3ATxyMlQOyyNQ Sep 05 15:27:49 Mopidy mopidy[6464]: ERROR [YTMusicBackend-3] mopidy_ytmusic YTMusic unable to get image url for ytmusic:artist:MPLAUCgeg9jKZXsVBWhOMQx94hnA Sep 05 15:27:52 Mopidy mopidy[6464]: ERROR [YTMusicBackend-3] mopidy_ytmusic YTMusic unable to get image url for ytmusic:artist:MPLAUCDdlWTV_9QK9E4vuVbqtvbA Sep 05 15:27:52 Mopidy mopidy[6464]: ERROR [YTMusicBackend-3] mopidy_ytmusic YTMusic unable to get image url for ytmusic:artist:MPLAUCR4tOMuXtONrNV4iQa1ZVFA Sep 05 15:27:53 Mopidy mopidy[6464]: ERROR [YTMusicBackend-3] mopidy_ytmusic YTMusic unable to get image url for ytmusic:artist:MPLAUCe5yOIiVeCigtm_WHQOneOw Sep 05 15:27:54 Mopidy mopidy[6464]: ERROR [YTMusicBackend-3] mopidy_ytmusic YTMusic unable to get image url for ytmusic:artist:MPLAUCSHHLY-Z0llyKsdhtvqokdQ Sep 05 15:27:54 Mopidy mopidy[6464]: ERROR [YTMusicBackend-3] mopidy_ytmusic YTMusic unable to get image url for ytmusic:artist:MPLAUC-E_I5MlG0Xg2nN3ZGdrdkg Sep 05 15:27:54 Mopidy mopidy[6464]: ERROR [YTMusicBackend-3] mopidy_ytmusic YTMusic unable to get image url for ytmusic:artist:MPLAUC3Y5SnS8t16lXhKiwYZtZ3g Sep 05 15:34:52 Mopidy mopidy[6464]: ERROR [YTMusicBackend-3] mopidy_ytmusic YTMusic unable to get image url for ytmusic:artist:MPLAUC5erOKcUMZJB0DFaIhs-yzA Sep 05 15:34:52 Mopidy mopidy[6464]: ERROR [YTMusicBackend-3] mopidy_ytmusic YTMusic unable to get image url for ytmusic:artist:MPLAUCQUFDXfCns0dJE7PPAXIWNg Sep 05 15:34:52 Mopidy mopidy[6464]: ERROR [YTMusicBackend-3] mopidy_ytmusic YTMusic unable to get image url for ytmusic:artist:MPLAUCMplVYEWcY3ATxyMlQOyyNQ Sep 05 15:34:52 Mopidy mopidy[6464]: ERROR [YTMusicBackend-3] mopidy_ytmusic YTMusic unable to get image url for ytmusic:artist:MPLAUCgeg9jKZXsVBWhOMQx94hnA Sep 05 15:34:52 Mopidy mopidy[6464]: ERROR [YTMusicBackend-3] mopidy_ytmusic YTMusic unable to get image url for ytmusic:artist:MPLAUCDdlWTV_9QK9E4vuVbqtvbA Sep 05 15:34:53 Mopidy mopidy[6464]: ERROR [YTMusicBackend-3] mopidy_ytmusic YTMusic unable to get image url for ytmusic:artist:MPLAUCR4tOMuXtONrNV4iQa1ZVFA Sep 05 15:34:53 Mopidy mopidy[6464]: ERROR [YTMusicBackend-3] mopidy_ytmusic YTMusic unable to get image url for ytmusic:artist:MPLAUCe5yOIiVeCigtm_WHQOneOw Sep 05 15:34:53 Mopidy mopidy[6464]: ERROR [YTMusicBackend-3] mopidy_ytmusic YTMusic unable to get image url for ytmusic:artist:MPLAUCSHHLY-Z0llyKsdhtvqokdQ Sep 05 15:34:53 Mopidy mopidy[6464]: ERROR [YTMusicBackend-3] mopidy_ytmusic YTMusic unable to get image url for ytmusic:artist:MPLAUC-E_I5MlG0Xg2nN3ZGdrdkg Sep 05 15:34:53 Mopidy mopidy[6464]: ERROR [YTMusicBackend-3] mopidy_ytmusic YTMusic unable to get image url for ytmusic:artist:MPLAUC3Y5SnS8t16lXhKiwYZtZ3g Sep 05 15:35:36 Mopidy mopidy[6464]: ERROR [YTMusicBackend-3] mopidy_ytmusic YTMusic failed parsing artist Fall Out Boy Sep 05 15:35:45 Mopidy mopidy[6464]: ERROR [YTMusicBackend-3] mopidy_ytmusic translate_uri error "'NoneType' object has no attribute 'get_signature'" Sep 05 15:36:23 Mopidy mopidy[6464]: ERROR [YTMusicBackend-3] mopidy_ytmusic translate_uri error "'NoneType' object has no attribute 'get_signature'" Sep 05 15:36:24 Mopidy mopidy[6464]: ERROR [YTMusicBackend-3] mopidy_ytmusic translate_uri error "'NoneType' object has no attribute 'get_signature'" Sep 05 15:36:26 Mopidy mopidy[6464]: ERROR [YTMusicBackend-3] mopidy_ytmusic translate_uri error "'NoneType' object has no attribute 'get_signature'" Sep 05 15:36:26 Mopidy mopidy[6464]: ERROR [YTMusicBackend-3] mopidy_ytmusic translate_uri error "'NoneType' object has no attribute 'get_signature'" Sep 05 15:36:26 Mopidy mopidy[6464]: ERROR [YTMusicBackend-3] mopidy_ytmusic translate_uri error "'NoneType' object has no attribute 'get_signature'" Sep 05 15:36:28 Mopidy mopidy[6464]: ERROR [YTMusicBackend-3] mopidy_ytmusic translate_uri error "'NoneType' object has no attribute 'get_signature'" Sep 05 15:36:28 Mopidy mopidy[6464]: ERROR [YTMusicBackend-3] mopidy_ytmusic translate_uri error "'NoneType' object has no attribute 'get_signature'" Sep 05 15:36:28 Mopidy mopidy[6464]: ERROR [YTMusicBackend-3] mopidy_ytmusic translate_uri error "'NoneType' object has no attribute 'get_signature'" Sep 05 15:36:28 Mopidy mopidy[6464]: ERROR [YTMusicBackend-3] mopidy_ytmusic translate_uri error "'NoneType' object has no attribute 'get_signature'" Sep 05 16:06:03 Mopidy mopidy[6464]: ERROR [YTMusicBackend-3] mopidy_ytmusic translate_uri error "'NoneType' object has no attribute 'get_signature'" Sep 05 16:11:35 Mopidy mopidy[6657]: ERROR [YTMusicBackend-3] mopidy_ytmusic translate_uri error "'NoneType' object has no attribute 'get_signature'" Sep 05 16:13:44 Mopidy mopidy[6657]: ERROR [YTMusicBackend-3] mopidy_ytmusic translate_uri error "'NoneType' object has no attribute 'get_signature'" Sep 05 16:21:40 Mopidy mopidy[6657]: ERROR [YTMusicBackend-3] mopidy_ytmusic translate_uri error "'NoneType' object has no attribute 'get_signature'" Sep 05 16:25:26 Mopidy mopidy[6733]: ERROR [YTMusicBackend-3] mopidy_ytmusic translate_uri error "'NoneType' object has no attribute 'get_signature'" Sep 05 16:25:28 Mopidy mopidy[6733]: ERROR [YTMusicBackend-3] mopidy_ytmusic translate_uri error "'NoneType' object has no attribute 'get_signature'" Sep 05 16:25:28 Mopidy mopidy[6733]: ERROR [YTMusicBackend-3] mopidy_ytmusic translate_uri error "'NoneType' object has no attribute 'get_signature'" Sep 05 16:25:30 Mopidy mopidy[6733]: ERROR [YTMusicBackend-3] mopidy_ytmusic translate_uri error "'NoneType' object has no attribute 'get_signature'" Sep 05 16:25:30 Mopidy mopidy[6733]: ERROR [YTMusicBackend-3] mopidy_ytmusic translate_uri error "'NoneType' object has no attribute 'get_signature'" Sep 05 16:25:30 Mopidy mopidy[6733]: ERROR [YTMusicBackend-3] mopidy_ytmusic translate_uri error "'NoneType' object has no attribute 'get_signature'" Sep 05 16:25:34 Mopidy mopidy[6733]: ERROR [YTMusicBackend-3] mopidy_ytmusic translate_uri error "'NoneType' object has no attribute 'get_signature'" Sep 05 16:25:34 Mopidy mopidy[6733]: ERROR [YTMusicBackend-3] mopidy_ytmusic translate_uri error "'NoneType' object has no attribute 'get_signature'" Sep 05 16:25:35 Mopidy mopidy[6733]: ERROR [YTMusicBackend-3] mopidy_ytmusic translate_uri error "'NoneType' object has no attribute 'get_signature'"

Nothing returns for grep signatureTimestamp [mopidy log file].

grep "layer URL" [mopidy log file] returns Sep 05 16:21:48 Mopidy mopidy[6733]: DEBUG [Thread-7] mopidy_ytmusic YTMusic updated player URL to /s/player/9da24d97/player_ias.vflset/en_US/base.js

stuartf commented 3 years ago

I was having the same issue, and found that before these get_signature errors I was seeing:

Sep 16 11:29:42 gamera mopidy[680313]: Exception in thread Thread-8:
Sep 16 11:29:42 gamera mopidy[680313]: Traceback (most recent call last):
Sep 16 11:29:42 gamera mopidy[680313]:   File "/usr/lib/python3.9/threading.py", line 973, in _bootstrap_inner
Sep 16 11:29:42 gamera mopidy[680313]:     self.run()
Sep 16 11:29:42 gamera mopidy[680313]:   File "/home/stuart/.pyenv/versions/3.9.1/envs/mopidy-3.9.1/lib/python3.9/site-packages/mopidy_ytmusic/repeating_timer.py", line 18, in run
Sep 16 11:29:42 gamera mopidy[680313]:     self._method()
Sep 16 11:29:42 gamera mopidy[680313]:   File "/home/stuart/.pyenv/versions/3.9.1/envs/mopidy-3.9.1/lib/python3.9/site-packages/mopidy_ytmusic/backend.py", line 99, in _refresh_youtube_player
Sep 16 11:29:42 gamera mopidy[680313]:     self.playback.update_cipher(playerurl=url)
Sep 16 11:29:42 gamera mopidy[680313]:   File "/home/stuart/.pyenv/versions/3.9.1/envs/mopidy-3.9.1/lib/python3.9/site-packages/mopidy_ytmusic/playback.py", line 25, in update_cipher
Sep 16 11:29:42 gamera mopidy[680313]:     self.PyTubeCipher = Cipher(js=response.text)
Sep 16 11:29:42 gamera mopidy[680313]:   File "/home/stuart/.pyenv/versions/3.9.1/envs/mopidy-3.9.1/lib/python3.9/site-packages/pytube/cipher.py", line 43, in __init__
Sep 16 11:29:42 gamera mopidy[680313]:     self.throttling_plan = get_throttling_plan(js)
Sep 16 11:29:42 gamera mopidy[680313]:   File "/home/stuart/.pyenv/versions/3.9.1/envs/mopidy-3.9.1/lib/python3.9/site-packages/pytube/cipher.py", line 389, in get_throttling_plan
Sep 16 11:29:42 gamera mopidy[680313]:     raw_code = get_throttling_function_code(js)
Sep 16 11:29:42 gamera mopidy[680313]:   File "/home/stuart/.pyenv/versions/3.9.1/envs/mopidy-3.9.1/lib/python3.9/site-packages/pytube/cipher.py", line 295, in get_throttling_function_code
Sep 16 11:29:42 gamera mopidy[680313]:     name = re.escape(get_throttling_function_name(js))
Sep 16 11:29:42 gamera mopidy[680313]:   File "/home/stuart/.pyenv/versions/3.9.1/envs/mopidy-3.9.1/lib/python3.9/site-packages/pytube/cipher.py", line 280, in get_throttling_function_name
Sep 16 11:29:42 gamera mopidy[680313]:     raise RegexMatchError(
Sep 16 11:29:42 gamera mopidy[680313]: pytube.exceptions.RegexMatchError: get_throttling_function_name: could not find match for multiple

Which appears to be this pytube bug: https://github.com/pytube/pytube/pull/1099 which they fix in 11.0.1

I hot patched the pytube in my virtualenv with the regex change from that issue and am able to use mopidy-ytmusic again, but I have a feeling the other changes in 11.0 will break other things so I doubt it can just be drop-in replaced.

impliedchaos commented 3 years ago

Thank you, @stuartf! I'll look into updating this ASAP.

impliedchaos commented 3 years ago

Closed this on accident. I've pushed out v0.30.2 that requires the new PyTube. Fortunately we only use a single method from PyTube.Cipher so this was a drop in replacement.

lokiberra commented 3 years ago

I haven't tested thoroughly, but playback seems to work good now in 0.30.2. Thanks everyone for thier help!

stuartf commented 3 years ago

Confirmed, this is working for me as well.

jsalatiel commented 2 years ago

I am facing the same problem, but I suppose I have updated packages.

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

Packages:

mopidy-ytmusic         0.3.3               
ytmusicapi             0.19.5         
pytube                 11.0.2