TikTok-Live-Connector icon indicating copy to clipboard operation
TikTok-Live-Connector copied to clipboard

All events stopped working

Open OlegShklyarov opened this issue 2 years ago • 42 comments

Could you please check from your side? We get no events.

OlegShklyarov avatar Jul 20 '22 11:07 OlegShklyarov

Here it also stopped working

renelima avatar Jul 20 '22 11:07 renelima

maybe tiktok update their webcats, no event sent

adierebel avatar Jul 20 '22 11:07 adierebel

Could it be that live-connector no longer works?

renelima avatar Jul 20 '22 11:07 renelima

Seems so. Waiting for Zerody

OlegShklyarov avatar Jul 20 '22 11:07 OlegShklyarov

maybe our time has come. To go to the factory

OlegShklyarov avatar Jul 20 '22 11:07 OlegShklyarov

I have the same problem

asdfg314284230 avatar Jul 20 '22 12:07 asdfg314284230

Same Problem

pbreit1988 avatar Jul 20 '22 12:07 pbreit1988

Seems like TikTok no longer allows access to the webcast service without authentication. Adding a valid sessionid and the ttwid cookie seems to fix the problem.

let tiktokChatConnection = new WebcastPushConnection('kingmohehe', {
    requestHeaders: {
        "Cookie": "sessionid=f6324878b8b34dbb8f86f1a2aafe5a0a; ttwid=1%7CLw5aVXrdJshrcdKNG2-zgC617ecDJ2WsxVHMymzZArQ%7C1658320010%7C03913e3ebc15cda442d9164e4f3f426544564573935abce01da09a557fa5130b;",
    },
    websocketHeaders: {
        "Cookie": "sessionid=f6324878b8b34dbb8f86f1a2aafe5a0a; ttwid=1%7CLw5aVXrdJshrcdKNG2-zgC617ecDJ2WsxVHMymzZArQ%7C1658320010%7C03913e3ebc15cda442d9164e4f3f426544564573935abce01da09a557fa5130b;",
    }
});

zerodytrash avatar Jul 20 '22 12:07 zerodytrash

Can we use all the same source code? Copy Paste? Or must we generate something by our self?

pbreit1988 avatar Jul 20 '22 12:07 pbreit1988

Can we use all the same source code? Copy Paste? Or must we generate something by our self?

You need to extract the cookies (sessionid and ttwid) from your browser. The cookies mentioned in the example are invalid.

zerodytrash avatar Jul 20 '22 12:07 zerodytrash

Is there not a more elegant solution here? Pre Authentication via Nodejs and extracting the sessionid? I think the problem is that when I'm live I can't watch my own stream at the same time. So it could be that my sessionid does not allow me to connect to the stream.

pbreit1988 avatar Jul 20 '22 13:07 pbreit1988

I think the problem is that when I'm live I can't watch my own stream at the same time. So it could be that my sessionid does not allow me to connect to the stream.

The session id is valid for all streams. You don't have to renew it every time.

zerodytrash avatar Jul 20 '22 13:07 zerodytrash

Okay i test it. Thank you for your Support.

pbreit1988 avatar Jul 20 '22 13:07 pbreit1988

Can we use all the same source code? Copy Paste? Or must we generate something by our self?

You need to extract the cookies (sessionid and ttwid) from your browser. The cookies mentioned in the example are invalid.

How to obtain this data? We don't see sessionid and ttwid on browser's cookies

adierebel avatar Jul 20 '22 13:07 adierebel

And when user has many channels? He should authorize in the browser first, extract cookies and then put them to the call? For each channels separately?

aKVbQ0m0_700w_0

OlegShklyarov avatar Jul 20 '22 13:07 OlegShklyarov

I extract the sessionid and the ttwid from my Chrome Browser and set it in the source code. But it not working.

pbreit1988 avatar Jul 20 '22 13:07 pbreit1988

Here too! Did not work

renelima avatar Jul 20 '22 13:07 renelima

It's been solved. thank you

asdfg314284230 avatar Jul 20 '22 13:07 asdfg314284230

It's been solved. thank you

How? Share you cure, please

OlegShklyarov avatar Jul 20 '22 13:07 OlegShklyarov

Should we change the connectionWrapper?

this.connection = new WebcastPushConnection(uniqueId, options);

OlegShklyarov avatar Jul 20 '22 13:07 OlegShklyarov

this.connection = new WebcastPushConnection(uniqueId, {
	requestHeaders: {
		"Cookie": "sessionid=f6324878b8b34dbb8f86f1a2aafe5a0a;",
	},
});

Only this here solved my problem, I didn't put the ttwid and it worked normal

weteta avatar Jul 20 '22 13:07 weteta

this.connection = new WebcastPushConnection(uniqueId, {
	requestHeaders: {
		"Cookie": "sessionid=f6324878b8b34dbb8f86f1a2aafe5a0a;",
	},
});

Only this here solved my problem, I didn't put the ttwid and it worked normal

Thank you for the example. I wonder will it work for any user...

OlegShklyarov avatar Jul 20 '22 13:07 OlegShklyarov

And when user has many channels? He should authorize in the browser first, extract cookies and then put them to the call? For each channels separately?

you can connect to as many streams as you want using a single session id. you don't need the session id of the streamer. just use the session of a trash account in the backend.

zerodytrash avatar Jul 20 '22 13:07 zerodytrash

it works for me too

liessinoudjal avatar Jul 20 '22 13:07 liessinoudjal

@OlegShklyarov if you scroll up you will see a complete example. without the ttwid cookie (TikTok websocket ID) the websocket connection will fail and request polling will be used.

zerodytrash avatar Jul 20 '22 13:07 zerodytrash

I just use this on a client side:

socket.connect(uniqueId, {
    requestHeaders: {
"Cookie": "sessionid=7877777773c2fedf3923ce3c4;",
},
enableWebsocketUpgrade:false,
requestPollingIntervalMs: 500,

For how long is the session valid?

OlegShklyarov avatar Jul 20 '22 14:07 OlegShklyarov

For how long is the session valid?

90 days

adierebel avatar Jul 20 '22 14:07 adierebel

And if I will relog on that browser, session will be terminated?

OlegShklyarov avatar Jul 20 '22 14:07 OlegShklyarov

And if I will relog on that browser, session will be terminated?

Simply remove the cookie from the browser and you will be able to log in again without revoking the previous cookie.

zerodytrash avatar Jul 20 '22 14:07 zerodytrash

I've been trying to get it to work, but solution presented by zerody don't seem to work for me. Here's a video I made of me retrieving the sessionid and ttwid and inserting it into websocketHeaders and requestHeaders.

It is also not upgrading to websocket. Any ideas?

https://youtu.be/JvHyivp5VWs

diazndc avatar Jul 21 '22 00:07 diazndc