From 805a1355fa52ed78da3c6ff60372ad063ca81c86 Mon Sep 17 00:00:00 2001 From: muskit <15199219+muskit@users.noreply.github.com> Date: Mon, 18 Mar 2024 00:42:47 -0700 Subject: [PATCH] update scraper.py --- src/scraper.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/scraper.py b/src/scraper.py index a184109..0d88642 100644 --- a/src/scraper.py +++ b/src/scraper.py @@ -96,8 +96,9 @@ class Scraper: except RateLimitReached: print("RateLimitReached occurred") self.login_wait(private_user) - except UnknownError: - print("UnknownError occurred, probably rate-limited") + except UnknownError as e: + print(f"UnknownError occurred: {e.message}") + print("treating like RateLimitReached...") # traceback.print_exc() self.login_wait(private_user) except Exception as e: @@ -169,9 +170,7 @@ class Scraper: if isinstance(e, Tweet): add_tweet(e) if e == cur_page[-1]: - print( - f"{e.date} (last tweet date) < {since} (since date) ?" - ) + print(f"{e.date} (last tweet) < {since.date} (since) ?") elif isinstance(e, SelfThread): # FIXME: rework when replied_to is fixed (currently populates user_mentions) # latest tweet in thread = og author's reply