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

Two Issues : pygobject and Session ID is invalid #35

Open
HamzaBenLhouari opened this issue Jan 20, 2023 · 10 comments
Open

Two Issues : pygobject and Session ID is invalid #35

HamzaBenLhouari opened this issue Jan 20, 2023 · 10 comments

Comments

@HamzaBenLhouari
Copy link

Hello,
hope you are doing great, just when I'm trying to run the script I have 2 issues :
first one :
playsound is relying on another python subprocess. Please use pip install pygobject if you want playsound to run more efficiently.

PS : when a try to run this command : " pip install pygobject " it's complete with errors so the installation get failled

second :
{'status': 'Session ID is invalid', 'status_code': 5}
.
PS : I have a correct session Id
how to solve them?
thanks in advance.

@Iucasmaia
Copy link

Fix:

Line 73 change "api16-normal-useast5.us.tiktokv.com" for "api16-normal-v6.tiktokv.com".

@HamzaBenLhouari
Copy link
Author

Fix:

Line 73 change "api16-normal-useast5.us.tiktokv.com" for "api16-normal-v6.tiktokv.com".

I found a linke in an other prject worked fine for me ... thanks but how I get like this link if I face this problem in future ?

@compakevon
Copy link

Hello, hope you are doing great, just when I'm trying to run the script I have 2 issues : first one : playsound is relying on another python subprocess. Please use pip install pygobject if you want playsound to run more efficiently.

PS : when a try to run this command : " pip install pygobject " it's complete with errors so the installation get failled

second : {'status': 'Session ID is invalid', 'status_code': 5} . PS : I have a correct session Id how to solve them? thanks in advance.

Did you fix the second option?

@HamzaBenLhouari
Copy link
Author

Hello,
still facing the same issue
we need a working link like the last one " api16-normal-v6.tiktokv.com "
and tell us how do you get these links to solve this issue by ourselves.
thanks

@ElonGaties
Copy link

I'm assuming that you just need to have proxy running on your phone to see the endpoint contacted, or emulate a phone with some sort of proxy.

@szacomelli
Copy link

Did anyone find a fix?

@ElonGaties
Copy link

ElonGaties commented Aug 22, 2023

Just to follow up here, in order to get a session ID you need to have a sort of MITM on your mobile device or an emulator with TikTok installed, and snatch up the session ID from a request done by the app.

The way I have done this is using mitmproxy in HTTP mode with a proxy configured on my phone, it's really simplistic if you try to do this method.

Edit: this is one method to do so, however this can be done on a computer using the TikTok web app, defined here Wiki - Obtaining Session ID, however to get the actual request API endpoint, which seems to be different in different regions, you may need to follow my method described above.

@denver-code
Copy link

Just to follow up here, in order to get a session ID you need to have a sort of MITM on your mobile device or an emulator with TikTok installed, and snatch up the session ID from a request done by the app.

The way I have done this is using mitmproxy in HTTP mode with a proxy configured on my phone, it's really simplistic if you try to do this method.

Edit: this is one method to do so, however this can be done on a computer using the TikTok web app, defined here Wiki - Obtaining Session ID, however to get the actual request API endpoint, which seems to be different in different regions, you may need to follow my method described above.

I couldn't get a session ID via my MITM proxy from phone, but I got api url instead, which is api31-normal-useast2a.tiktokv.com for me
then I authorised in web version, and made few actions(scroll, enter comment section) and through Network explorer(basic developer tool in every browser) got my sessionID from request cookies, fun thing that I couldn't find sessionID directly in web storage

@ElonGaties
Copy link

I seem to be able to find it inside of the storage tab in cookies of the window, which isn't too surprising as I wouldn't they would store a (possibly) changing ID in local storage (granted cookies are pretty similar to local storage in this case), I also seem to be able to get the session ID using MITM in the request headers, but if you couldn't get it using MITM, your method is also a good way of retrieving both the endpoint and ID.

@benf152
Copy link

benf152 commented Dec 7, 2023

api31-normal-useast2a.tiktokv.com

idk who you are but this worked thank you!!

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

No branches or pull requests

7 participants