yt-dlc icon indicating copy to clipboard operation
yt-dlc copied to clipboard

[youtube] make sure live chat playerOffsetMs is positive

Open siikamiika opened this issue 4 years ago • 0 comments

Please follow the guide below

  • You will be asked some questions, please read them carefully and answer honestly
  • Put an x into all the boxes [ ] relevant to your pull request (like that [x])
  • Use Preview tab to see how your pull request will actually look like

Before submitting a pull request make sure you have:

In order to be accepted and merged into youtube-dl each piece of code must be in public domain or released under Unlicense. Check one of the following options:

  • [x] I am the original author of this code and I am willing to release it under Unlicense
  • [ ] I am not the original author of this code but it is in public domain or released under Unlicense (provide reliable evidence)

What is the purpose of your pull request?

  • [x] Bug fix
  • [ ] Improvement
  • [ ] New extractor
  • [ ] New feature

Description of your pull request and other information

If the /live_chat_replay/get_live_chat_replay endpoint is given a negative value to playerOffsetMs, it will return 400 bad request. It can happen when the first batch of messages is so large that all of them come before 5 seconds into the video. This pull request defaults the parameter to 0 when it's negative.

It's unclear if setting the parameter actually does anything when sequentially fetching all chat, but at least it looks more like what the browser does.

siikamiika avatar Nov 28 '20 00:11 siikamiika