OzymandiasTheGreat / mopidy-ytmusic

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

Have keys changed? x-goog-authuser #40

Open karl0ss opened 2 years ago

karl0ss commented 2 years ago

I am trying to install this today on a Rpi3 using my YouTube music premium account.

I have logged in to YTM on FireFox and navigate about, find the /browse "POST" options and right click copy reqest headers, when I paste into the terminal I am getting


ERROR    [MainThread] mopidy_ytmusic YTMusic setup failed
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/mopidy_ytmusic/command.py", line 40, in run
    print(YTMusic.setup(filepath=str(path)))
  File "/usr/local/lib/python3.7/dist-packages/ytmusicapi/ytmusic.py", line 164, in setup
    return setup(filepath, headers_raw)
  File "/usr/local/lib/python3.7/dist-packages/ytmusicapi/setup.py", line 38, in setup
    + ". Please try a different request (such as /browse) and make sure you are logged in."
Exception: The following entries are missing in your headers: x-goog-authuser, cookie. Please try a different request (such as /browse) and make sure you are logged in.

When I look in the firefox console I can see that i do have x-goog-authuser but its in a different case/format

X-Goog-AuthUser: 0

Is your code case sensitive? also, is it expected to see 0 as the response here esp as i am logged in (and playing one of my "liked" songs..

Hope someone can help.

Thanks

karl0ss commented 2 years ago

Not too sure what the issues with the setup is, but I manually created the auth.json follow the format from -https://github.com/OzymandiasTheGreat/mopidy-ytmusic/issues/1#issuecomment-662394006

Then just copied the details from Firefox /browse command, all working fine now and i can play my songs, so the details were def in the request header..

IfedayoAwe commented 2 years ago

I also tried using the YTmusic api and received the same set of errors, I am currently trying to manually create the headers_auth.json file but I'm having difficulties, it's still not working and I'm not sure what I'm doing wrong and the link you included doesn't lead anywhere, please I need help on how you did it.

karl0ss commented 2 years ago

Here is the link to the correct issue - https://github.com/OzymandiasTheGreat/mopidy-ytmusic/issues/1