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.14k stars 128 forks source link

Async Exception Handling #154

Open dany27227 opened 1 month ago

dany27227 commented 1 month ago

This block used to catch an exception when the account/user was private in the old/synced version. In the new async version it just gets an empty following and keeps going. Any idea of how to fix this?

`

if abs(liveCount - len(follows)) > MIN_DIFFERENCE:
    print(user + ': recaching')
    follows = []
    try:
        followList = await liveUser.get_following(count=liveCount)
    except:
        print(f'Skipped {user}: error getting profile (private / inactive)')
        continue

`

dany27227 commented 1 month ago

For my current use/problem I can just precheck the 'user.protected' attribute to exclude/jump private profiles. Still seems like a bug that was introduced in V2 that should be looked at.