update scraper.py
This commit is contained in:
+4
-5
@@ -96,8 +96,9 @@ class Scraper:
|
|||||||
except RateLimitReached:
|
except RateLimitReached:
|
||||||
print("RateLimitReached occurred")
|
print("RateLimitReached occurred")
|
||||||
self.login_wait(private_user)
|
self.login_wait(private_user)
|
||||||
except UnknownError:
|
except UnknownError as e:
|
||||||
print("UnknownError occurred, probably rate-limited")
|
print(f"UnknownError occurred: {e.message}")
|
||||||
|
print("treating like RateLimitReached...")
|
||||||
# traceback.print_exc()
|
# traceback.print_exc()
|
||||||
self.login_wait(private_user)
|
self.login_wait(private_user)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
@@ -169,9 +170,7 @@ class Scraper:
|
|||||||
if isinstance(e, Tweet):
|
if isinstance(e, Tweet):
|
||||||
add_tweet(e)
|
add_tweet(e)
|
||||||
if e == cur_page[-1]:
|
if e == cur_page[-1]:
|
||||||
print(
|
print(f"{e.date} (last tweet) < {since.date} (since) ?")
|
||||||
f"{e.date} (last tweet date) < {since} (since date) ?"
|
|
||||||
)
|
|
||||||
elif isinstance(e, SelfThread):
|
elif isinstance(e, SelfThread):
|
||||||
# FIXME: rework when replied_to is fixed (currently populates user_mentions)
|
# FIXME: rework when replied_to is fixed (currently populates user_mentions)
|
||||||
# latest tweet in thread = og author's reply
|
# latest tweet in thread = og author's reply
|
||||||
|
|||||||
Reference in New Issue
Block a user