-
Notifications
You must be signed in to change notification settings - Fork 216
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
File name too long error on ytmusicapi authentication because headers are passed to new Path() #721
Comments
Yeah that was kinda stupid. PR welcome |
I have a fix ready but was unable to successfully verify because I am still getting 401 with browser-based approach. I read something about YT Family accounts not working anymore with browser-based authentication and the need to switch to Oauth with Google Cloud Console account. Could that be the cause for the 401? |
No, both methods should work with any account. Although I'm not the owner in my family plan so I can't personally verify |
I just can't get browser auth to work with spotify_to_ytmusic for my account (which is a member of a family account, not the owner, just like your setup). This used to work. I just tried OAuth with spotify_to_ytmusic but I think that it is no longer compatible with the 1.9.x versions of ytmusicapi as the config file and codebase is missing client_secret when trying to setup OAuth from sporitfy_to_ytmusic. Will open another bug with sporitfy_to_ytmusic project. Created a PR for the browser auth Path issue anyway but I am not familiar with Python and it looks like I didn't get the syntax right? |
Thanks @sigma67 for providing a fix. I also wanted to report back that my browser auth issue has been resolved. Unfortunately, I was using a YouTube cookie instead of a YouTube Music cookie. Although logged-in with the same account, apparently the credentials are not interchangeable. |
File ".local/pipx/venvs/spotify-to-ytmusic/lib/python3.9/site-packages/ytmusicapi/ytmusic.py", line 128, in init
if (auth_path := Path(auth_str)).is_file():
File "/usr/lib/python3.9/pathlib.py", line 1439, in is_file
return S_ISREG(self.stat().st_mode)
File "/usr/lib/python3.9/pathlib.py", line 1221, in stat
return self._accessor.stat(self)
OSError: [Errno 36] File name too long: '<HEADER_CONTENT>'
...with HEADER_CONTENT being the value of [youtube].headers
Looks like ytmusic.py is check if provided self.auth is a file name but since spotify_to_ytmusic passes the headers which are quite long, Python complains that the file name string is too long when trying to create a Path() instance out of the passed header string.
The text was updated successfully, but these errors were encountered: