mirror of
https://github.com/Watchful1/PushshiftDumps.git
synced 2025-07-24 15:15:24 -04:00
Handle the incorrect reauth
This commit is contained in:
parent
2570594ab1
commit
0adaae53aa
1 changed files with 10 additions and 0 deletions
|
@ -52,9 +52,19 @@ def re_auth_pushshift(old_token):
|
||||||
discord_logging.flush_discord()
|
discord_logging.flush_discord()
|
||||||
return new_token
|
return new_token
|
||||||
elif 'detail' in result:
|
elif 'detail' in result:
|
||||||
|
if result['detail'] == 'Access token is still active and can not be refreshed.':
|
||||||
|
log.warning(f"Access token still active, trying request again")
|
||||||
|
time.sleep(5)
|
||||||
|
return old_token
|
||||||
|
|
||||||
log.warning(f"Reauth failed: {result['detail']}")
|
log.warning(f"Reauth failed: {result['detail']}")
|
||||||
discord_logging.flush_discord()
|
discord_logging.flush_discord()
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
else:
|
||||||
|
log.warning(f"Something went wrong re-authing")
|
||||||
|
discord_logging.flush_discord()
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def query_pushshift(ids, bearer, object_type):
|
def query_pushshift(ids, bearer, object_type):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue