Skip to content

Instantly share code, notes, and snippets.

@miketartar
Created September 26, 2020 04:21
Show Gist options
  • Select an option

  • Save miketartar/0fc8d7bca2369ce73ea9ee7b6e0c3775 to your computer and use it in GitHub Desktop.

Select an option

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()
@MaazKhan008
Copy link

The above code does not work for me. ^

However, I found a way that is more simple but does require a little bit of effort. This is for WINDOWS ONLY. (Tested on Windows 11 24H2). You will also be using Python (Just running a simple script, I promise!)

  1. Download version 4.5 of Cold Turkey Blocker from this link: https://cold-turkey.en.uptodown.com/windows/download/1030193999
  2. Run the .exe and install it. Open the program at least once.
  3. Go to this link and download the python script. (On the right hand side there should be a download icon saying "Download Raw File". It's the second icon over from where it says RAW. https://github.com/arv-anshul/ColdTurkeyBlocker-Pro/blob/main/main.py
  4. Install Python for Windows and all its necessary dependencies. https://www.python.org/downloads/windows/
  5. Locate the main.py file you downloaded from step 3. Right click anywhere in the empty space in wherever you have it and select "Open in Terminal". MAKE SURE YOU ARE RUNNING TERMINAL IN ADMINISTRATOR.
  6. Now type in the terminal "py main.py" but without the quotation marks.
  7. Your Cold Turkey Blocker will now become Pro.
  8. Now you can install the higher version (4.7 from the time of this writing). The pro license will carry over to the newer version.
  9. Profit.

Thank you so much!
I used this method and it worked really good, after that I updated it to V4.9 which is latest and it worked.

@ballsucker184-hub
Copy link

can someone help me please I am not a techy person i just have a windows 11 laptop, I really need pro version of cold turkey so that I can block reddit and other sites for a year and a half because I have my entrance tests please anyone is reading this please help me

@ballsucker184-hub
Copy link

The above code does not work for me. ^
However, I found a way that is more simple but does require a little bit of effort. This is for WINDOWS ONLY. (Tested on Windows 11 24H2). You will also be using Python (Just running a simple script, I promise!)

  1. Download version 4.5 of Cold Turkey Blocker from this link: https://cold-turkey.en.uptodown.com/windows/download/1030193999
  2. Run the .exe and install it. Open the program at least once.
  3. Go to this link and download the python script. (On the right hand side there should be a download icon saying "Download Raw File". It's the second icon over from where it says RAW. https://github.com/arv-anshul/ColdTurkeyBlocker-Pro/blob/main/main.py
  4. Install Python for Windows and all its necessary dependencies. https://www.python.org/downloads/windows/
  5. Locate the main.py file you downloaded from step 3. Right click anywhere in the empty space in wherever you have it and select "Open in Terminal". MAKE SURE YOU ARE RUNNING TERMINAL IN ADMINISTRATOR.
  6. Now type in the terminal "py main.py" but without the quotation marks.
  7. Your Cold Turkey Blocker will now become Pro.
  8. Now you can install the higher version (4.7 from the time of this writing). The pro license will carry over to the newer version.
  9. Profit.

Thank you so much! I used this method and it worked really good, after that I updated it to V4.9 which is latest and it worked.

bro can you teach me how to do it please I am not a techy person this is my first time doing something

@animerugade-creator
Copy link

sure do you have discord it's more easier. I think it would be the same process for window. just dm me

@ace9804
Copy link

ace9804 commented Jan 5, 2026

The above code does not work for me. ^
However, I found a way that is more simple but does require a little bit of effort. This is for WINDOWS ONLY. (Tested on Windows 11 24H2). You will also be using Python (Just running a simple script, I promise!)

  1. Download version 4.5 of Cold Turkey Blocker from this link: https://cold-turkey.en.uptodown.com/windows/download/1030193999
  2. Run the .exe and install it. Open the program at least once.
  3. Go to this link and download the python script. (On the right hand side there should be a download icon saying "Download Raw File". It's the second icon over from where it says RAW. https://github.com/arv-anshul/ColdTurkeyBlocker-Pro/blob/main/main.py
  4. Install Python for Windows and all its necessary dependencies. https://www.python.org/downloads/windows/
  5. Locate the main.py file you downloaded from step 3. Right click anywhere in the empty space in wherever you have it and select "Open in Terminal". MAKE SURE YOU ARE RUNNING TERMINAL IN ADMINISTRATOR.
  6. Now type in the terminal "py main.py" but without the quotation marks.
  7. Your Cold Turkey Blocker will now become Pro.
  8. Now you can install the higher version (4.7 from the time of this writing). The pro license will carry over to the newer version.
  9. Profit.

Thank you so much! I used this method and it worked really good, after that I updated it to V4.9 which is latest and it worked.

bro can you teach me how to do it please I am not a techy person this is my first time doing something

Confirmed working on Windows 11.

For anyone who is not "tech-savvy" or getting errors, here is a detailed breakdown of the steps with explanations for beginners:

NOTE: DELETE COLD TURKEY IF YOU HAVE ALREADY INSTALLED IT AND THEN FOLLOW THE BELOW STEPS
LINK TO DELETE IT https://getcoldturkey.com/support/reinstall-instructions/ (IGNORE STEP3 THAT ASKS YOU TO REINSTALL IT)
ONCE COLD TURKEY IS COMPLETELY DELETED FOLLOW THE BELOW INSTRUCTIONS

this is super easy, go step by step and if you have any problems or errors you can ask here

1. Download version 4.5 of Cold Turkey Blocker

2. Run the .exe and install it. Open the program at least once.

  • Important: Open the app after installing so it creates the necessary database files on your computer. Then close it completely (check your system tray near the clock to make sure it's not running in the background).

3. Download the Python script (main.py)

  • Link: GitHub Script Link
  • How: On the right side, click the "Download raw file" icon (it looks like a small arrow pointing down into a tray). Save this file into a new folder on your Desktop or Downloads (e.g., name the folder CT_Hack).

4. Install Python for Windows (CRITICAL STEP)

  • Link: Python Downloads
  • The Trap: When you run the installer, look at the bottom of the very first screen. You MUST check the box that says [X] Add python.exe to PATH.
  • If you miss this checkbox, the commands in Step 6 will not work.

5. Open Terminal as Administrator in your folder

  • The Problem: Windows protects system files to prevent viruses from changing them. To run this script, you need "Administrator" (Superuser) rights to bypass that protection.

  • The Fix:

    1. Press the Windows Key and type PowerShell.
    2. Right-click the result and choose Run as Administrator. (Click 'Yes' if a window pops up).
    3. Now you need to tell PowerShell to look inside your folder. Choose ONE of these methods:

    Method A: The "Copy Address" Trick (Recommended)

    1. Open your downloaded folder in the normal File Explorer.
    2. Click inside the Address Bar at the very top (where it shows the folder path). The text will turn blue.
    3. Right-click the blue text and select Copy.
    4. Go back to your PowerShell window.
    5. Type cd " (that is: cd, space, and a quotation mark).
    6. Right-click anywhere in the window (or press Ctrl+V) to paste the address.
    7. Type another " to close the quote.
      • It should look like this: cd "C:\Users\Name\Downloads\CT_Hack"
    8. Press Enter.

    Method B: The "Drag and Drop" Trick (Faster)

    1. In PowerShell, type cd (make sure you add a space at the end).
    2. Click and hold your folder icon from your File Explorer.
    3. Drag it right into the blue PowerShell window and let go.
    4. Windows will automatically type the full address for you.
    5. Press Enter.

6. Type "python main.py" in the terminal

  • Command: Type python main.py (or py main.py) and hit Enter.
  • Prompt: It will ask you to choose Mac or Win. Type win and hit Enter.
  • If it says "Changing status to pro", you succeeded.

7. Profit (and Update)

  • Open Cold Turkey v4.5. It should say "Pro".
  • Final Step: Download the latest version (v4.9+) from the official site and install it over the top of this one. Your Pro status will stick!

Hope this helps anyone struggling with the commands!

after completing the tutorial you can watch this video to get an idea on how to use Cold Turkey for blocking websites
link : https://youtu.be/2qDE048ovsI

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