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

Error 400 integration does not start #375

Open
poulti opened this issue Dec 1, 2024 · 1 comment
Open

Error 400 integration does not start #375

poulti opened this issue Dec 1, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@poulti
Copy link

poulti commented Dec 1, 2024

Describe the bug
Integration does not start and asked to post this error as an issue here - so here you go!

Version
20241125.01

To Reproduce
Steps to reproduce the behavior:

  1. Start Home Assistant

Additional context
Traceback (most recent call last): File "/config/custom_components/ytube_music_player/media_player.py", line 1136, in async_update_playlists self._playlists = await self.hass.async_add_executor_job(lambda: self._api.get_library_playlists(limit=self._trackLimit)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/ytube_music_player/media_player.py", line 1136, in self._playlists = await self.hass.async_add_executor_job(lambda: self._api.get_library_playlists(limit=self._trackLimit)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/ytmusicapi/mixins/library.py", line 33, in get_library_playlists response = self._send_request(endpoint, body) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/ytmusicapi/ytmusic.py", line 242, in _send_request raise YTMusicServerError(message + error) ytmusicapi.exceptions.YTMusicServerError: Server returned HTTP 400: Bad Request. Request contains an invalid argument.

Thanks

@poulti poulti added the bug Something isn't working label Dec 1, 2024
@ChrisODonnell25
Copy link

I was having the same issue and I had a bit of play around with the content I was pasting from the network tab. Eventually I realised that what I had copied (from Chrome) had a bunch of extra fields when compared to the setup images. Specifically:

priority
sec-ch-ua
sec-ch-ua-arch
sec-ch-ua-bitness
sec-ch-ua-form-factors
sec-ch-ua-full-version
sec-ch-ua-full-version-list
sec-ch-ua-mobile
sec-ch-ua-model
sec-ch-ua-platform
sec-ch-ua-platform-version
sec-ch-ua-wow64
x-client-data

Once I removed those, it worked. I hope this works for you too!

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