-
-
Notifications
You must be signed in to change notification settings - Fork 132
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
ct0 not in cookies (most likely ip ban) #214
Comments
A note: it takes time from logging in manually to twscrape accepting the login, about 15 minutes. |
Guys I found the solution Go to
To obtain a client transaction id, use chrome to login any twitter account then use the F12 developer tools to randomly grab one from the network records. It seems like once you have a valid one you'll be able to login all accounts, so it's quite convenient once you setup everything. Read this stackoverflow for more about how this x-client-transaction-id is generated. I don't have time to reverse engineer this but I hope someone could invent a way to generate these ids automatically in Python |
Forgot to mention I added a few print statements for debugging purposes. These print statements shouldn't affect the functionality and can be ignored |
@frameartist Thanks for sharing your finding! I also found https://antibot.blog/twitter/ where someone investigates this mystic "x-client-transaction-id" header. This is also consistent with @Jwom's finding in #175 (comment). FWIW this header is very likely to be related to account bans. There are also some cloned repos e.g. https://github.com/yeyuchen198/twitter-tid-generator. Highly appreciated if someone can create a python version. |
收到
|
@frameartist Thanks you very much. Based on your answer I modified the login function this way and it worked for me
I have a dozen of accounts and I took one ct0 string from one random logged account using F12 too. It worked for all accounts. |
@caterpillar1219 someone on twitter have read this article and changed hash salt from "bird" to "obfiowerehiring" (obfio is article author username on github), the script doesn't work anymore. they changed last byte from 1 to 3, some of the inputs like |
So @frameartist is hard-coding x-client-transaction-id and @bachelow is hard-coding x-csrf-token. |
For me yes, but it become unmanageable with more than 4/5 accounts. |
Why unmanageable? I read that you could use the same x-csrf-token on multiple accounts. Did I read that wrong? On Aug 23, 2024, at 5:14 AM, bachelow ***@***.***> wrote:
So @frameartist is hard-coding x-client-transaction-id and @bachelow is hard-coding x-csrf-token. Are both of these still working - same code over multiple accounts, still alive after a few days?
For me yes, but it become unmanageable with more than 4/5 accounts.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: ***@***.***>
|
Your provided solution works great, but I am receiving another issue now |
Yeah that's why I said earlier it was tedious with more than 4/5 accounts. To answer your remark and the one of @takabinance I had to relog using |
Ok, I found the solution, but I'm not sure about the quality. |
收到
|
It's working for me as well. maybe a PR? |
The problem is we need to hardcode the id, which apparently won't last forever. So I'd prefer filing a PR once we reverse engineer the whole mechanism. |
I tried this method, this base64 string was grab from netword record in chrome(same account), but it still didn't work. |
Hi! Any chance to share your solution ? |
Lately,
The following error has been appearing to me when I try to log in using
twscrape login_accounts
.2024-08-14 12:15:33.159 | ERROR | twscrape.accounts_pool:login:165 - Failed to login 'XAccount': ct0 not in cookies (most likely ip ban)
When I logged in to the account I found out it wasn't blocked.
I have solved that issue for some accounts by logging in manually and then removing the accounts from the database using
twscrape del_accounts XAccount ...
. Then log in to the account manually. Then add the account usingtwscrape add_accounts ...
, then try re-login again usingtwscrape relogin XAccount ...
.It solved the issue for me, but I have to do that manually whenever I face it again. Can we consider automating that?
I have found out that sometimes Twitter requests the email in the middle of your login even if you typed the account name.
Maybe that's something new to the Twitter login process.
I don't know exactly if that's an issue with me or with the login process. But I am here to learn.
The text was updated successfully, but these errors were encountered: