Sort bearers by most recent success & fix deploy issue

This commit is contained in:
Dylan
2024-05-21 20:22:07 +01:00
parent ff07ddc8ee
commit e192f9ae2b
2 changed files with 6 additions and 1 deletions

View File

@ -57,6 +57,11 @@ def cycleBearerTokenGet(url,headers):
# try another bearer token
print(f"Error 429 but {rateLimitRemaining} remaining")
continue
else:
# move successful token to the front if it's not already there
if token != bearerTokens[0]:
bearerTokens.insert(0,bearerTokens.pop(bearerTokens.index(token)))
return tweet
except Exception as e:
pass
return tweet