Created
November 30, 2017 18:22
-
-
Save adamaharony/6bd6aeae836e5a492f5672227a95556b to your computer and use it in GitHub Desktop.
Discord get token from local DB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import shutil | |
import os | |
import sqlite3 | |
IsCanary = False | |
if IsCanary: | |
shutil.copy(os.getenv('APPDATA') + '\discordcanary\Local Storage\https_canary.discordapp.com_0.localstorage', 'localstorage.db') | |
else: | |
shutil.copy(os.getenv('APPDATA') + '\discord\Local Storage\https_discordapp.com_0.localstorage', 'localstorage.db') | |
db = sqlite3.connect('localstorage.db') | |
cursor = db.cursor() | |
cursor.execute("SELECT * FROM ItemTable WHERE key = 'token'") | |
token = str(cursor.fetchone()[1]).lstrip("b'").rstrip("'").replace(r'\x00','').lstrip('"').rstrip('"') | |
db.close() | |
os.remove("localstorage.db") |
doesnt work
Please, I urge you to look at when I posted this gist.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
BTW, that works only on Windows PCs.