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

Need to set HTTP Length header on post requests #13

Open
lanrat opened this issue Aug 5, 2022 · 1 comment · May be fixed by #15
Open

Need to set HTTP Length header on post requests #13

lanrat opened this issue Aug 5, 2022 · 1 comment · May be fixed by #15

Comments

@lanrat
Copy link

lanrat commented Aug 5, 2022

Currently _get_lounge_id() is failing with an HTTP 411 response code because the remote API is requiring that the post request have the HTTP Length header set.

_do_post() should be updated to set the correct length.

Stacktrace:

  File "/usr/local/lib/python3.10/site-packages/casttube/YouTubeSession.py", line 89, in play_video
    self._start_session()
  File "/usr/local/lib/python3.10/site-packages/casttube/YouTubeSession.py", line 160, in _start_session
    self._get_lounge_id()
  File "/usr/local/lib/python3.10/site-packages/casttube/YouTubeSession.py", line 169, in _get_lounge_id
    response = self._do_post(LOUNGE_TOKEN_URL, data=data)
  File "/usr/local/lib/python3.10/site-packages/casttube/YouTubeSession.py", line 263, in _do_post
    response.raise_for_status()
  File "/usr/local/lib/python3.10/site-packages/requests/models.py", line 1021, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 411 Client Error: Length Required for url: https://www.youtube.com/api/lounge/pairing/get_lounge_token_batch
@alexdelorenzo
Copy link

Running into this error, as well.

@alexdelorenzo alexdelorenzo linked a pull request Feb 11, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants