Skip to content

Instantly share code, notes, and snippets.

@miketartar
Created September 26, 2020 04:21
Show Gist options
  • Save miketartar/0fc8d7bca2369ce73ea9ee7b6e0c3775 to your computer and use it in GitHub Desktop.
Save miketartar/0fc8d7bca2369ce73ea9ee7b6e0c3775 to your computer and use it in GitHub Desktop.
Cold Turkey Blocker Activator
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()
@Tosiboser
Copy link

so I am still seeing a lot of interests in this thing and honestly stop using it as there is basically no support or love for this script by the original creator, rather I would recommend using this: https://github.com/coderhisham/ColdTurkeyBlockerPro-Activator-FREE. This works for anything below and on v4.6 but doesnt work yet for 4.7. It does have a work around for it tho which is basically downgrading to 4.6

This has been blocked sadly. i need it soooooo bad

@JustaTurtle21
Copy link

This has been blocked sadly. i need it soooooo bad

What do you mean by blocked?? Are you on the correct version also if this doesn't work try this one: https://github.com/arv-anshul/ColdTurkeyBlocker-Pro Only works for v4.5. If you can't download it because of geocentric blocking use a vpn

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment