Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to complete setup #136

Closed
salsaman opened this issue Sep 26, 2021 · 4 comments
Closed

Unable to complete setup #136

salsaman opened this issue Sep 26, 2021 · 4 comments
Labels
bug Something isn't working

Comments

@salsaman
Copy link

salsaman commented Sep 26, 2021

I followed the instructions referred to in the integration setup window, and obtained cookie data from a browser window. However when I paste this in to the setup, I get an error "Something with your cookie wasn't right. Format and fields are ok but the login failed". I have a YT music subscription and the cookie data was copied verbatim from the request headers in a logged in session.

The cookie data begins with "VISITOR_INFO1_LIVE=...:" and then contains several other pieces of data separated with ";" ending with "__Secure-3PSIDCC=...".

@salsaman salsaman added the bug Something isn't working label Sep 26, 2021
@salsaman
Copy link
Author

salsaman commented Sep 26, 2021

Checking the logs, I discovered this:

2021-09-26 15:34:59 ERROR (MainThread) [custom_components.ytube_music_player.config_flow] Traceback (most recent call last):
File "/config/custom_components/ytube_music_player/config_flow.py", line 188, in async_check_data
YTMusic.setup(filepath = user_input[CONF_HEADER_PATH], headers_raw = c)
File "/usr/local/lib/python3.9/site-packages/ytmusicapi/ytmusic.py", line 156, in setup
return setup(filepath, headers_raw)
File "/usr/local/lib/python3.9/site-packages/ytmusicapi/setup.py", line 36, in setup
raise Exception(
Exception: The following entries are missing in your headers: cookie, x-goog-authuser. Please try a different request (such as /browse) and make sure you are logged in.

However, that field does exist in the cookie text, ie:
"x-goog-authuser": "0",

I can confirm this was copied from a /browse request and I am logged in.

Maybe you need to use x-goog-visitor-id instead ? Could this be an issue related to two step authorization which I have enabeld on my account ?

@KoljaWindeler
Copy link
Owner

It might help to use a chrome incognito session.
Sadly there is nothing I can do about it.

@salsaman
Copy link
Author

I see the same thing even after logging in from an incognito window.

Is it not possible to use an application password, or to set up oauth cloud access using client_id, client_secret ? The Google Nest integration uses something like this.

@KoljaWindeler
Copy link
Owner

Appears to be not possible .. please read sigma67/ytmusicapi#10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants