-
-
Save miketartar/0fc8d7bca2369ce73ea9ee7b6e0c3775 to your computer and use it in GitHub Desktop.
import json | |
import sqlite3 | |
import os | |
DB_PATH = "C:/ProgramData/Cold Turkey/data-app.db" | |
def activate(): | |
try: | |
conn = sqlite3.connect(DB_PATH) | |
c = conn.cursor() | |
s = c.execute("SELECT value FROM settings WHERE key = 'settings'").fetchone()[0] | |
dat = json.loads(s) | |
if dat["additional"]["proStatus"] != "pro": | |
print("Your version of Cold Turkey Blocker is not activated.") | |
dat["additional"]["proStatus"] = "pro" | |
print("But now it is activated.\nPlease close Cold Turkey Blocker and run again it.") | |
c.execute("""UPDATE settings SET value = ? WHERE "key" = 'settings'""", (json.dumps(dat),)) | |
conn.commit() | |
else: | |
print("Looks like your copy of Cold Turkey Blocker is already activated.") | |
print("Deactivating it now.") | |
dat["additional"]["proStatus"] = "free" | |
c.execute("""UPDATE settings set value = ? WHERE "key" = 'settings'""", (json.dumps(dat),)) | |
conn.commit() | |
except sqlite3.Error as e: | |
print("Failed to activate", e) | |
finally: | |
if conn: | |
conn.close() | |
def main(): | |
if os.path.exists(DB_PATH): | |
print("Data file found.\nLet's activate your copy of Cold Turkey Blocker.") | |
activate() | |
else: | |
print("Looks like Cold Turkey Blocker is not installed.\n If it is installed then run it at least once.") | |
if __name__ == '__main__': | |
main() |
Anyone knows how to download a older version of Cold Turkey Blocker? (4.5) To make this script work...
Anyone knows how to download a older version of Cold Turkey Blocker? (4.5) To make this script work...
i downloaded it from the wayback machine
Do you have the link? @Ghost-07a
Hi everyone,
I was previously using Cold Turkey Blocker version 4.7. I completely uninstalled it using BCUninstaller, then tried installing versions 4.5 and 4.6. However, I'm still getting the same error every time I launch the app:
Error Reading Database
The database where your settings are stored is locked and can't be read. Try opening Cold Turkey Blocker in a few seconds.
I’ve already checked the task manager and made sure no background processes are running.
Has anyone experienced this issue? Any ideas on how to fix it?
Thanks in advance!
@xtiigma the same happened with me, i couldnt solve it
Already tried deleting the db file itself?
Already tried deleting the db file itself?
Of course, with the uninstaller delete the entire folder
Do you have the link? @Ghost-07a
@domodigitalbusiness https://web.archive.org/web/20250000000000*/https://getcoldturkey.com/pricing/
Jan 2 one for example is v5.5, I used that
i got error saying
"Failed to parse settings JSON: Expecting value: line 1 column 1 (char 0)"
can anyone help