Skip to content

Commit

Permalink
Updated location of Slack's leveldb
Browse files Browse the repository at this point in the history
Another day, another change to Slack. New leveldb location found using "lsof". Also requires an update to pycookiecheat because the keyring name has also changed. See n8henrie/pycookiecheat#69.

All the docs for updating a PyPI package have changed since the last update, so also took the opportunity to get up to speed. It was awful, but seems to be working now. Basically setup.cfg is superseded and now everything goes in pyproject.toml.
  • Loading branch information
hraftery committed Sep 5, 2024
1 parent c6cbef6 commit b8c88ad
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 35 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# SlackTokens
Extract personal tokens and authentication cookie from the Slack app, to use with the Slack API.

**Update Sept 2024:** Slack has once again moved its database, so this does not work with the current version of Slack. There may or may not be a fix coming.

---

# Description
Expand Down
36 changes: 35 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,38 @@
[build-system]
requires = ["setuptools>=42"]
requires = ["setuptools >= 61.0"]
build-backend = "setuptools.build_meta"

[project]
name = "slacktokens"
version = "0.2.4"

dependencies = [
"leveldb==0.201",
"pycookiecheat",
]
# Python 3.12 deprecates "PyUnicode_AS_UNICODE", which python-leveldb relies on. I
# haven't found a workaround, so just still with 3.11 for now. I've read "Should You
# Use Upper Bound Version Contraints" and there seems to be a thick cultural barrier
# to me understanding all the stated reasons not to to do this. So I'm doing it.
requires-python = ">=3.7, <3.12"

authors = [ {name = "Heath Raftery", email = "[email protected]" } ]
description = "Extract personal tokens and authentication cookie from the Slack app"
readme = "README.md"

classifiers = [
"Development Status :: 4 - Beta",
"Environment :: Console",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Intended Audience :: Developers",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Topic :: Software Development :: Libraries",
"Topic :: Utilities",
]

[project.urls]
Repository = "https://github.com/hraftery/slacktokens"

[tool.setuptools]
py-modules = ["slacktokens"]
31 changes: 0 additions & 31 deletions setup.cfg

This file was deleted.

3 changes: 2 additions & 1 deletion slacktokens.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ def get_tokens():
import json

if sys.platform == "darwin":
LEVELDB_PATH='~/Library/Application Support/Slack/Local Storage/leveldb'
# LEVELDB_PATH='~/Library/Application Support/Slack/Local Storage/leveldb'
LEVELDB_PATH='~/Library/Containers/com.tinyspeck.slackmacgap/Data/Library/Application Support/Slack/Local Storage/leveldb'
elif sys.platform.startswith("linux"):
LEVELDB_PATH='~/.config/Slack/Local Storage/leveldb'
else:
Expand Down

0 comments on commit b8c88ad

Please sign in to comment.