plugins.kick: refactor, fix clips + 403 API issues #6491
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Some API requests might fail randomly and solving a JS challenge is required, similar to Twitch's client-integrity token. The JS challenge requirement however seems to be rare and subsequent API request attempts are almost always successful.
Fixes #6414
No issues while testing these URLs and lots of other in the past half an hour. But as said in the commit message, sometimes API requests will fail. It's possible that this is also timing-based, which I already suspected in previous PRs.
Either way, having these changes on master should already be an improvement.
Solving the JS challenge is a bit "challenging" when most API requests succeed without it being a requirement. I already had a plugin version which solved the challenge and stored all the cookies, as well as any request headers made by Chromium during the solve, but this didn't work when re-using the cookies and other headers on the API endpoints when using python-requests.
Non-existent channel
Offline channel
Live channel
invalid VOD
VOD
invalid clip
clip