aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrygve Aaberge <trygveaa@gmail.com>2023-06-29 01:04:55 +0200
committerTrygve Aaberge <trygveaa@gmail.com>2023-06-29 22:15:55 +0200
commit15d36ee65f02f360cff9d46be97ccb6cb6a57e08 (patch)
tree5897c76cfdad9c9cc0f77d709d545717bc3ff84f
parent2e80baa98f1281557199ef7bb50b637e3d4134eb (diff)
downloadwee-slack-15d36ee65f02f360cff9d46be97ccb6cb6a57e08.tar.gz
Remove the token option from extract_token_from_browser.py
I see no value of having this option, and it's just confusing since the script is meant for extracting the token.
-rwxr-xr-xextract_token_from_browser.py18
1 files changed, 7 insertions, 11 deletions
diff --git a/extract_token_from_browser.py b/extract_token_from_browser.py
index 0534794..98e14af 100755
--- a/extract_token_from_browser.py
+++ b/extract_token_from_browser.py
@@ -40,7 +40,6 @@ parser = argparse.ArgumentParser(
parser.add_argument(
"browser", help="Which browser to extract from", metavar="<browser>"
)
-parser.add_argument("--token", help="Extracted token", metavar="<token>", nargs="?")
parser.add_argument(
"--profile", help="Profile to look up cookies for", metavar="<profile>", nargs="?"
)
@@ -175,15 +174,7 @@ try:
local_config_str = con.execute(local_storage_query).fetchone()[0]
local_config = json.loads(local_config_str)
except (OperationalError, TypeError):
- if not args.token and args.browser not in ["chrome", "chrome-beta"]:
- print(
- "Couldn't find the token for team, extract it manually "
- 'by running \'window.prompt("Session token:", '
- "TS.boot_data.api_token)' in your browser dev console "
- "and specify it in --token",
- file=sys.stderr,
- )
- sys.exit(1)
+ pass
finally:
if con:
con.close()
@@ -213,7 +204,12 @@ if local_config:
]
if not teams:
- teams = [{"token": args.token, "name": "Slack"}]
+ teams = [
+ {
+ "token": "<token>",
+ "name": "Couldn't find any tokens automatically, but you can try to extract it manually as described in the readme and register the team like this",
+ }
+ ]
register_commands = [
f"{team['name']}:\n/slack register {team['token']}:{cookie_value}" for team in teams