try using auth tokens on scraper
This commit is contained in:
+2
-2
@@ -11,9 +11,9 @@ class AccountPool:
|
|||||||
creds = dotenv_values(working_path(file=".env"))
|
creds = dotenv_values(working_path(file=".env"))
|
||||||
i = 0
|
i = 0
|
||||||
while True:
|
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(
|
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
|
i += 1
|
||||||
else:
|
else:
|
||||||
|
|||||||
+2
-2
@@ -37,9 +37,9 @@ class Scraper:
|
|||||||
try:
|
try:
|
||||||
self.app.connect()
|
self.app.connect()
|
||||||
except:
|
except:
|
||||||
self.app.sign_in(*acc)
|
self.app.load_auth_token(acc[1])
|
||||||
else:
|
else:
|
||||||
self.app.sign_in(*acc)
|
self.app.load_auth_token(acc[1])
|
||||||
return True
|
return True
|
||||||
print("exhausted all accounts!")
|
print("exhausted all accounts!")
|
||||||
return False
|
return False
|
||||||
|
|||||||
Reference in New Issue
Block a user