From 27cf9340f25a4fa62bbf4f8bd179f7179a5d027e Mon Sep 17 00:00:00 2001 From: Dylan Date: Sun, 13 Aug 2023 16:57:49 +0100 Subject: [PATCH] Randomly use tokens --- twExtract/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/twExtract/__init__.py b/twExtract/__init__.py index 47e5ae9..005d8b5 100644 --- a/twExtract/__init__.py +++ b/twExtract/__init__.py @@ -35,6 +35,7 @@ def extractStatus_token(url): raise twExtractError.TwExtractError(400, "Extract error (no tokens defined)") # get tweet tokens = config["config"]["workaroundTokens"].split(",") + random.shuffle(tokens) for authToken in tokens: try: csrfToken=str(uuid.uuid4()).replace('-', '') @@ -110,6 +111,7 @@ def extractStatusV2(url): raise twExtractError.TwExtractError(400, "Extract error (no tokens defined)") # get tweet tokens = config["config"]["workaroundTokens"].split(",") + random.shuffle(tokens) for authToken in tokens: try: csrfToken=str(uuid.uuid4()).replace('-', '') @@ -185,6 +187,7 @@ def extractUser(url): screen_name = m.group(1) # get user tokens = config["config"]["workaroundTokens"].split(",") + random.shuffle(tokens) for authToken in tokens: try: csrfToken=str(uuid.uuid4()).replace('-', '')