Sort bearers by most recent success & fix deploy issue

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

No files matched your search

+5
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