distinguish RateLimitReached from UnknownError
This commit is contained in:
+6
-2
@@ -179,8 +179,12 @@ class Scraper:
|
|||||||
add_tweet(t)
|
add_tweet(t)
|
||||||
|
|
||||||
cur = search.cursor
|
cur = search.cursor
|
||||||
except (UnknownError, RateLimitReached):
|
except RateLimitReached:
|
||||||
print("UnknownError occurred, probably rate-limited")
|
print("RateLimitReached occurred")
|
||||||
|
self.login_wait(uid in talent_lists.privated_accounts)
|
||||||
|
except UnknownError as e:
|
||||||
|
print(f"UnknownError occurred: {e.message}")
|
||||||
|
print("treating like RateLimitReached...")
|
||||||
self.login_wait(uid in talent_lists.privated_accounts)
|
self.login_wait(uid in talent_lists.privated_accounts)
|
||||||
|
|
||||||
tweets.sort(key=lambda t: t.id)
|
tweets.sort(key=lambda t: t.id)
|
||||||
|
|||||||
Reference in New Issue
Block a user