TikTok-Live-Connector
TikTok-Live-Connector copied to clipboard
Websocket connection failed, Error: Expected a Sec-WebSocket-Protocol header.
Hi
Would someone know why I'm getting the following error all of a sudden while it has been working for months when I try to scrape data of presents that are being send in the live:
General error! { info: 'Upgrade to websocket failed', exception: 'Websocket connection failed, Error: Expected a Sec-WebSocket-Protocol header.' }
Thanks in advance and kind regards
Same error from today
Upgrade to latest commit
Upgrade to latest commit
Thx! It works again.
Upgrade to latest commit
Thank you! It works
After 2 months with that Parse Error issue and realizing that it was my fault for not keeping my Node JS up to date with the latest version (upgraded to 21) - I've now upgraded my error status to this one. I've updated to latest commit on the library and I'm getting the combo info: 'Upgrade to websocket failed', exception: 'Websocket connection failed, Error: Expected a Sec-WebSocket-Protocol header.' and then followed by
Error while connecting, Error: TikTok does not offer a websocket upgrade. Please provide a valid sessionId
to use request polling instead.
{
info: 'Error while connecting',
exception: Error: TikTok does not offer a websocket upgrade. Please provide a valid sessionId
to use request polling instead.
at WebcastPushConnection.connect (node_modules\tiktok-live-connector\dist\index.js:287:17)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
}
I used to have the .env file with the Sessionid and the ttwid - and thought that was the issue. I removed that. And upgraded to the latest commit. Same issue.
Wondering if this is a real issue or has something to do with the sig server and too many requests?
Okay, after a combination sequences of fresh downloads of the tiktok-live-connector to a different directory on my PC and clearing and restoring from backup and running npm update and npm i tikok-live-connector command on it and manually copying and pasting on top of the existing code in node_modules\tiktok-live-connector
I finally - Finally, -- FINALLY got the connector to work!
And was able to go live for an hour with solid chat, gifts, and like events being delivered to my custom game. (and happy followers rejoicing they could PLAY again after a 2 month hiatus - that's what this is all about, right? Bring joy to others through our crafts)
And then, no more than 15 hours later. I'm getting that Connection failed, Error: Missing cursor in initial fetch response and then the 429 error that means I gotta wait to try again.
I'm starting to think that the Connection failed, Error: Missing cursor in initial fetch response isn't me, it is the euler server with either too many connections of some random error that might be unhandled. Not sure. Unless TikTok did change something in 15 hours. There is no commits that I am aware of.
Just doing my QA and code testing here trying to get an answer.