vladkens / twscrape

2024! X / Twitter API scrapper with authorization support. Allows you to scrape search results, User's profiles (followers/following), Tweets (favoriters/retweeters) and more.
https://pypi.org/project/twscrape/
MIT License
951 stars 121 forks source link

Unhandled error <class 'httpx.ConnectTimeout'>: #113

Closed HaroldXue23 closed 5 months ago

HaroldXue23 commented 8 months ago

Hi there. Thanks for sharing. I'm using cli commands but whenever I try to search something it says this:

2024-01-24 23:14:25.693 | WARNING  | twscrape.queue_client:req:224 - Unhandled error <class 'httpx.ConnectTimeout'>: 
2024-01-24 23:14:25.713 | INFO     | twscrape.accounts_pool:get_for_queue_or_wait:275 - No account available for queue "SearchTimeline". Next available at 23:29:25

When I check twscrape stats it says:

queue                       locked  available 
locked_SearchTimeline  1       0         

Total: 1 - Active: 1 - Inactive: 0

Anybody knows how to resolve it? Much appreciated!

vladkens commented 7 months ago

Hi, @HaroldXue23.

Hard to say what is it. Possible you have bad interned connection OR twitter have connection problems.

I updated code to not lock account for 15 minutes in such cases. Now on ConnectTimeout exception will be raised.