twikit icon indicating copy to clipboard operation
twikit copied to clipboard

Sometimes get the error: twikit.errors.TwitterException

Open brandon840 opened this issue 9 months ago • 1 comments

Most of the time, after I try to login, I get the following error:

""" twikit.errors.TwitterException: Nous avons bloqué une tentative d'accès à votre compte car nous n'étions pas sûrs qu'il s'agissait bien de vous.

Cela se produit quand nous constatons une activité de connexion inhabituelle, comme des tentatives de connexion trop nombreuses, ou depuis un lieu ou un appareil différent.

Vous devrez attendre avant d'essayer de vous reconnecter. Certains blocages sont supprimés automatiquement. """

Code:

import asyncio
import time
from twikit import Client

usernames = [...]
emails = [...]
passwords = [...]

clients = []
for _ in range(NUM_ACCOUNTS):
 clients.append(Client('en-US'))

async def scrape_tweets():
    for i, client in enumerate(clients):
        await client.login(
            auth_info_1=usernames[i],
            auth_info_2=emails[i],
            password=passwords[i]
        )
        time.sleep(5)

brandon840 avatar Mar 26 '25 21:03 brandon840

Use a proxy, don't make too many login attempts

dwqekc avatar Apr 20 '25 16:04 dwqekc