Skip to content

Instantly share code, notes, and snippets.

@Frost-Lord
Last active October 30, 2024 17:26
Show Gist options
  • Save Frost-Lord/e2db9b7e27ee4866ac304c489dc165cf to your computer and use it in GitHub Desktop.
Save Frost-Lord/e2db9b7e27ee4866ac304c489dc165cf to your computer and use it in GitHub Desktop.
Cold Turkey Blocker Premium Activator

Step one: Close cold turkey app and the minitray icon of coldTurkey

Create a file called ColdTurkeyBlockerPremium.py then open CMD to this dir.

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.\nIf it is installed then run it at least once.")

if __name__ == '__main__':
    main()

Make sure you have python installed and do py ColdTurkeyBlockerPremium.py or python ColdTurkeyBlockerPremium.py

Then re-open the app & now you have pro

@Frost-Lord
Copy link
Author

Frost-Lord commented Oct 2, 2024

Please try the following to solve the issue:

  1. Make sure Cold Turkey Blocker is completely closed before running the script. This includes checking if the minitray icon (in the system tray) is closed. You can do this by:

    Right-clicking the icon and selecting "Exit."
    Alternatively, end the process from the Task Manager if necessary.

  2. Make sure you have sufficient permissions to modify data-app.db. You might want to run the Python script as an administrator if you're not already doing so.

    Open command Prompt as an administrator (right-click on CMD and select "Run as Administrator").
    Navigate to the directory where your ColdTurkeyBlockerPremium.py is located.
    Run the script again using py oldTurkeyBlockerPremium.py or python ColdTurkeyBlockerPremium.py.

  3. Cold Turkey Blocker Caching Mechanism: If Cold Turkey Blocker caches certain settings, it may still use the old value even though the database is updated. Restart your computer to clear any cache that might be holding the old values.

If none of these work don't hesitate to reply here and I'll look further into it.

@lisan-al-ghaib
Copy link

It worked bro. Thank you so much.

@Frost-Lord
Copy link
Author

Np

@JaazielC
Copy link

Still works. TY <3

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