From c88ddc749a1a38c7107befdf6f9224b8b688feb6 Mon Sep 17 00:00:00 2001 From: muskit <15199219+muskit@users.noreply.github.com> Date: Sun, 17 Mar 2024 23:50:17 -0700 Subject: [PATCH] try using auth tokens on scraper --- src/account_pool.py | 4 ++-- src/scraper.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/account_pool.py b/src/account_pool.py index bf53004..9bba59b 100644 --- a/src/account_pool.py +++ b/src/account_pool.py @@ -11,9 +11,9 @@ class AccountPool: creds = dotenv_values(working_path(file=".env")) i = 0 while True: - if f"scraper_username{i}" in creds and f"scraper_password{i}" in creds: + if f"scraper_username_{i}" in creds and f"scraper_auth_token_{i}" in creds: self.__accounts.append( - (creds[f"scraper_username{i}"], creds[f"scraper_password{i}"]) + (creds[f"scraper_username_{i}"], creds[f"scraper_auth_token_{i}"]) ) i += 1 else: diff --git a/src/scraper.py b/src/scraper.py index df20f45..53553d8 100644 --- a/src/scraper.py +++ b/src/scraper.py @@ -37,9 +37,9 @@ class Scraper: try: self.app.connect() except: - self.app.sign_in(*acc) + self.app.load_auth_token(acc[1]) else: - self.app.sign_in(*acc) + self.app.load_auth_token(acc[1]) return True print("exhausted all accounts!") return False