d60 / twikit

Twitter API Scraper | Without an API key | Twitter Internal API | Free | Twitter scraper | Twitter Bot
https://twikit.readthedocs.io/en/latest/twikit.html
MIT License
1.18k stars 134 forks source link

twikit.errors.Forbidden: status: 403, message: "{"errors":[{"code":108,"message":"Cannot find specified user."}]}" #186

Open junzhongsong opened 3 weeks ago

junzhongsong commented 3 weeks ago

when I use this code:

获取用户ID并关注

USER_SCREEN_NAME = 'yinge133'  # 确保这个用户名是正确的
user = await client.get_user_by_screen_name(USER_SCREEN_NAME)
print(
    f'id: {user.id}',
    f'name: {user.name}',
    f'followers: {user.followers_count}',
    f'tweets count: {user.statuses_count}',
    sep='\n'
)
await client.follow_user(user.id)

it shows this error: twikit.errors.Forbidden: status: 403, message: "{"errors":[{"code":108,"message":"Cannot find specified user."}]}" Please tell me how to fix this error, thanks.

junzhongsong commented 2 weeks ago

@d60 Could you please help to check this issue. Thanks.