November update #2

Merged
Future merged 34 commits from github/origin into alterware 2025-11-10 07:43:08 +00:00
Showing only changes of commit a27b768ff3 - Show all commits

View File

@@ -47,6 +47,9 @@ userByScreenNameGraphql_api="96tVxbPqMZDoYB5pmzezKA"
userByRestIdGraphql_api="8r5oa_2vD0WkhIAOkY4TTA"
twitterUrl = "x.com" # doubt this will change but just in case
simultaneousRequests = int(os.getenv("VXTWITTER_SIMULTANEOUS_REQUESTS",1))
class TwExtractError(Exception):
def __init__(self, code, message):
self.code = code
@@ -65,7 +68,7 @@ def parallel_token_request(twid, tokens, request_function):
except Exception as e:
return {'success': False, 'error': str(e)}
with concurrent.futures.ThreadPoolExecutor(max_workers=min(2, len(tokens))) as executor:
with concurrent.futures.ThreadPoolExecutor(max_workers=min(simultaneousRequests, len(tokens))) as executor:
futures = {executor.submit(try_token, token): token for token in tokens}
for future in concurrent.futures.as_completed(futures):
result = future.result()