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

Multiple Account - Cookies #133

Closed
shandyisme opened this issue Apr 30, 2024 · 3 comments
Closed

Multiple Account - Cookies #133

shandyisme opened this issue Apr 30, 2024 · 3 comments

Comments

@shandyisme
Copy link

Hi @wkaisertexas , this is really nice code, I've been using this for last few months.

I'm doing multiple accounts, creating 1 folder for each accounts (upload.py, cookies.txt, mp4 video), everytime I want to switch account (running from different folder), I need to re-download the cookies from get locally to use it in order to make it work, otherwise the tiktok won't login automatically using cookies.

Is there a way to use the cookies file back and forth?

Thank you

@wkaisertexas
Copy link
Owner

You need one cookies.txt file per account. Your cookies file (among other things) contains a session token that identifies you as being logged in (effectively, this library is one big session token spoofing attack).

However, if you log out of one account and log back into another, logging out will invalidate the session tokens from your previous account.

I solved this in two ways:

  • use one browser (chrome, safari, edge) per account. You can stay signed in and everything is fine
  • Instead of signing out of accounts, clear your cookies. This will allow you to sign into a new account without signaling to TikTok that you logged out of your old one.

If you have any more questions, let me know!

@wkaisertexas wkaisertexas pinned this issue Apr 30, 2024
@shandyisme
Copy link
Author

Instead of signing out of accounts, clear your cookies. This will allow you to sign into a new account without signaling to TikTok that you logged out of your old one.

This is really simple good solution. Problem solved. Now I can easily manage multiple account.

Thank you!

@Vladddd46
Copy link

Let me clarify this issue because I spent some time on finding the solution.
I thought, that the problem is in the library itself and i debug it but it have not helped me.
The problem was in the way I get cookies. I get cookies using chrome extension. So, when i got cookies for one account, I logged out in order to login in another account and get cookies for it. It was a mistake because when i logged out from the account, it`s cookies became invalid. Instead of logging out, I had to simply clear cookies in chrome settings and then login into another tiktok account to get cookies.
ps.
when i intentionally clicked on logout button, then tiktok backend was notified, that i am logged, thus cookies became corrupted but when i clear cookies in chrome setting, tiktok backend did not get information, that i am logging out, thus cookies have not became invalid.

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

3 participants