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()
@Shankar331505

Copy link
Copy Markdown

perfectly worked in windows but bro i am using mac one issue i am facing is how to completely close a app in background , i see in activity monitor its always running even after quit , i got toggles pro in terminal but nothing happened

press option + command + esc to force quit

@Shankar331505

Copy link
Copy Markdown

Use any IDE to create the python file like VS code or antigravity.

@samrza

samrza commented May 8, 2026

Copy link
Copy Markdown

hey all the man here helped me thanks to all wholeheartedly , as of 8th may 2026 cold turkey v4.9 it working completely fine on mac m2, when i will get money i will surely pay to this developer as a thanks

@siddhantlamichhane43-alt

Copy link
Copy Markdown

I put py main.py in the command but ":\Users\chris\AppData\Local\Programs\Python\Python314\python.exe: can't open file 'C:\Users\chris\main.py': [Errno 2] No such file or directory" just pops up

You saved in wrong location. navigate whare you have saved the file. First, save that py file in downloads and then paste this in cmd
cd /d "%userprofile%\Downloads"
Then Type py main.py It'll work

@AneebRasool

Copy link
Copy Markdown

I had a lot of problems running this code but there were many indentation problems. what I did to make it work exactly:

download latest version of cold turkey from website (4.9)
download python (if you havent already)

paste this to notepad:

import json
import sqlite3

DB_PATH = "C:/ProgramData/Cold Turkey/data-app.db"

def decode(s):
data = s[5:]
return ''.join(chr(int(data[i:i+2], 16) - 0x11) for i in range(0, len(data), 2))

def encode(s):
return "CTB17" + ''.join(f'{ord(c) + 0x11:02X}' for c in s)

conn = sqlite3.connect(DB_PATH)
c = conn.cursor()
raw = c.execute("SELECT value FROM settings WHERE key = 'settings'").fetchone()[0]
dat = json.loads(decode(raw))
dat["additional"]["proStatus"] = "free" if dat["additional"]["proStatus"] == "pro" else "pro"
c.execute("UPDATE settings SET value = ? WHERE key = 'settings'", (encode(json.dumps(dat)),))
conn.commit()
conn.close()
print("Toggled to:", dat["additional"]["proStatus"])

(ALSO: make sure to save in notepad, not as txt but under all files type in "main.py" and enter.
now use admin version of cmd, type in cd (your directory, ex C:\Users(your user)\Downloads
then type in py main.py and it should work

@naveganth

Copy link
Copy Markdown

If the previous version is not working, try this:

  1. Install Cold Turkey Blocker from its official website.

  2. After installation, make sure the application is completely closed:

    • Check the system tray (hidden icons on the taskbar).
    • Right-click the icon and exit the application.
  3. Open Notepad (or any text editor).

  4. Paste the following code:

import json
import sqlite3

DB_PATH = "C:/ProgramData/Cold Turkey/data-app.db"

def decode(s):
    data = s[5:]
    return ''.join(chr(int(data[i:i+2], 16) - 0x11) for i in range(0, len(data), 2))

def encode(s):
    return "CTB17" + ''.join(f'{ord(c) + 0x11:02X}' for c in s)

conn = sqlite3.connect(DB_PATH)
c = conn.cursor()

raw = c.execute("SELECT value FROM settings WHERE key = 'settings'").fetchone()[0]

# Handle both formats (encoded and plain JSON)
if raw.startswith("CTB17"):
    dat = json.loads(decode(raw))
    use_encode = True
else:
    dat = json.loads(raw)
    use_encode = False

dat["additional"]["proStatus"] = (
    "free" if dat["additional"]["proStatus"] == "pro" else "pro"
)

new_value = json.dumps(dat)
if use_encode:
    new_value = encode(new_value)

c.execute("UPDATE settings SET value = ? WHERE key = 'settings'", (new_value,))
conn.commit()
conn.close()

print("Toggled to:", dat["additional"]["proStatus"])
  1. Save the file as:
main.py
  1. Open Command Prompt as Administrator.
  2. Navigate to the folder where you saved the file:
cd path\to\your\folder
  1. Run the script:
py main.py

This is the only one working in the latest version, just download the Cold Turkey from the official website.

@OmkarGharat

OmkarGharat commented May 30, 2026

Copy link
Copy Markdown

Final Working Script

Thank me later

import json
import sqlite3

DB_PATH = "C:/ProgramData/Cold Turkey/data-app.db"

def decode(s):
    # Remove the CTB17 prefix and any whitespace/newlines
    data = s[5:].strip()
    
    # Ensure an even number of hex characters
    if len(data) % 2 != 0:
        data = data[:-1]
        
    result = []
    for i in range(0, len(data), 2):
        hex_pair = data[i:i+2]
        try:
            val = int(hex_pair, 16) - 0x11
            if 0 <= val <= 0x10FFFF:  # Valid Unicode range
                result.append(chr(val))
        except ValueError:
            continue  # Skip invalid hex pairs
            
    return ''.join(result)

def encode(s):
    return "CTB17" + ''.join(f'{ord(c) + 0x11:02X}' for c in s)

conn = sqlite3.connect(DB_PATH)
c = conn.cursor()

raw = c.execute("SELECT value FROM settings WHERE key = 'settings'").fetchone()[0]

# Handle both formats (encoded and plain JSON)
if raw.startswith("CTB17"):
    dat = json.loads(decode(raw))
    use_encode = True
else:
    dat = json.loads(raw)
    use_encode = False

dat["additional"]["proStatus"] = (
    "free" if dat["additional"]["proStatus"] == "pro" else "pro"
)

new_value = json.dumps(dat)
if use_encode:
    new_value = encode(new_value)

c.execute("UPDATE settings SET value = ? WHERE key = 'settings'", (new_value,))
conn.commit()
conn.close()

print("Toggled to:", dat["additional"]["proStatus"])

@ak5hiit

ak5hiit commented Jun 2, 2026

Copy link
Copy Markdown

Final Working Script

Thank me later

import json
import sqlite3

DB_PATH = "C:/ProgramData/Cold Turkey/data-app.db"

def decode(s):
    # Remove the CTB17 prefix and any whitespace/newlines
    data = s[5:].strip()
    
    # Ensure an even number of hex characters
    if len(data) % 2 != 0:
        data = data[:-1]
        
    result = []
    for i in range(0, len(data), 2):
        hex_pair = data[i:i+2]
        try:
            val = int(hex_pair, 16) - 0x11
            if 0 <= val <= 0x10FFFF:  # Valid Unicode range
                result.append(chr(val))
        except ValueError:
            continue  # Skip invalid hex pairs
            
    return ''.join(result)

def encode(s):
    return "CTB17" + ''.join(f'{ord(c) + 0x11:02X}' for c in s)

conn = sqlite3.connect(DB_PATH)
c = conn.cursor()

raw = c.execute("SELECT value FROM settings WHERE key = 'settings'").fetchone()[0]

# Handle both formats (encoded and plain JSON)
if raw.startswith("CTB17"):
    dat = json.loads(decode(raw))
    use_encode = True
else:
    dat = json.loads(raw)
    use_encode = False

dat["additional"]["proStatus"] = (
    "free" if dat["additional"]["proStatus"] == "pro" else "pro"
)

new_value = json.dumps(dat)
if use_encode:
    new_value = encode(new_value)

c.execute("UPDATE settings SET value = ? WHERE key = 'settings'", (new_value,))
conn.commit()
conn.close()

print("Toggled to:", dat["additional"]["proStatus"])

this finally works for me. I was previously getting indentation errors but now it works perfectly fine. thanks!

@Wehsuh-Sushi

Copy link
Copy Markdown

@ak5hiit is the GOAT frfr saving us the hassle with these indentation errors

@Thiag07

Thiag07 commented Jun 12, 2026

Copy link
Copy Markdown

Final Working Script

Thank me later

import json
import sqlite3

DB_PATH = "C:/ProgramData/Cold Turkey/data-app.db"

def decode(s):
    # Remove the CTB17 prefix and any whitespace/newlines
    data = s[5:].strip()
    
    # Ensure an even number of hex characters
    if len(data) % 2 != 0:
        data = data[:-1]
        
    result = []
    for i in range(0, len(data), 2):
        hex_pair = data[i:i+2]
        try:
            val = int(hex_pair, 16) - 0x11
            if 0 <= val <= 0x10FFFF:  # Valid Unicode range
                result.append(chr(val))
        except ValueError:
            continue  # Skip invalid hex pairs
            
    return ''.join(result)

def encode(s):
    return "CTB17" + ''.join(f'{ord(c) + 0x11:02X}' for c in s)

conn = sqlite3.connect(DB_PATH)
c = conn.cursor()

raw = c.execute("SELECT value FROM settings WHERE key = 'settings'").fetchone()[0]

# Handle both formats (encoded and plain JSON)
if raw.startswith("CTB17"):
    dat = json.loads(decode(raw))
    use_encode = True
else:
    dat = json.loads(raw)
    use_encode = False

dat["additional"]["proStatus"] = (
    "free" if dat["additional"]["proStatus"] == "pro" else "pro"
)

new_value = json.dumps(dat)
if use_encode:
    new_value = encode(new_value)

c.execute("UPDATE settings SET value = ? WHERE key = 'settings'", (new_value,))
conn.commit()
conn.close()

print("Toggled to:", dat["additional"]["proStatus"])

Thank you so much man

@drke3

drke3 commented Jun 14, 2026

Copy link
Copy Markdown

mac users change DB_PATH to:
DB_PATH = "/Library/Application Support/Cold Turkey/data-app.db"

@DevilRNK

Copy link
Copy Markdown

For people who are having trouble because the link for 4.5 is down. I have created a step by step guide:

Step 1: Keep your Cold Turkey Version 4.9 and open notepad

Step 2: Create a new note and paste this in: import json import sqlite3

DB_PATH = "C:/ProgramData/Cold Turkey/data-app.db"

def decode(s): data = s[5:] return ''.join(chr(int(data[i:i+2], 16) - 0x11) for i in range(0, len(data), 2))

def encode(s): return "CTB17" + ''.join(f'{ord(c) + 0x11:02X}' for c in s)

conn = sqlite3.connect(DB_PATH) c = conn.cursor() raw = c.execute("SELECT value FROM settings WHERE key = 'settings'").fetchone()[0] dat = json.loads(decode(raw)) dat["additional"]["proStatus"] = "free" if dat["additional"]["proStatus"] == "pro" else "pro" c.execute("UPDATE settings SET value = ? WHERE key = 'settings'", (encode(json.dumps(dat)),)) conn.commit() conn.close() print("Toggled to:", dat["additional"]["proStatus"])

After that, press ctrl,shift,s and save in downloads as main,py as the name.

VERY IMPORTANT STEP or it won't work: you have to go to task manager and end cold turkey as the task and after you have run the code and it said toggled to pro, only then you open cold turkey and it will work go to command prompt and type this, py main.py it will say toggled to pro and there you go, you have a pro version of cold turkey for free. THANK YOU SO MUCH to @Someone45 because he was the one who had the updated code and gave it to us

I am having the error :

C:\Users\Rup>py main.py
File "C:\Users\Rup\main.py", line 7
data = s[5:]
^^^^
IndentationError: expected an indented block after function definition on line 6

@qwerty0466

Copy link
Copy Markdown

This script works for the latest version (4.9):

import json
import sqlite3

DB_PATH = "C:/ProgramData/Cold Turkey/data-app.db"

def decode(s):
    data = s[5:]
    return ''.join(chr(int(data[i:i+2], 16) - 0x11) for i in range(0, len(data), 2))

def encode(s):
    return "CTB17" + ''.join(f'{ord(c) + 0x11:02X}' for c in s)

conn = sqlite3.connect(DB_PATH)
c = conn.cursor()
raw = c.execute("SELECT value FROM settings WHERE key = 'settings'").fetchone()[0]
dat = json.loads(decode(raw))
dat["additional"]["proStatus"] = "free" if dat["additional"]["proStatus"] == "pro" else "pro"
c.execute("UPDATE settings SET value = ? WHERE key = 'settings'", (encode(json.dumps(dat)),))
conn.commit()
conn.close()
print("Toggled to:", dat["additional"]["proStatus"])

W

@MakeSake

Copy link
Copy Markdown

This script works for the latest version (4.9):

import json
import sqlite3

DB_PATH = "C:/ProgramData/Cold Turkey/data-app.db"

def decode(s):
    data = s[5:]
    return ''.join(chr(int(data[i:i+2], 16) - 0x11) for i in range(0, len(data), 2))

def encode(s):
    return "CTB17" + ''.join(f'{ord(c) + 0x11:02X}' for c in s)

conn = sqlite3.connect(DB_PATH)
c = conn.cursor()
raw = c.execute("SELECT value FROM settings WHERE key = 'settings'").fetchone()[0]
dat = json.loads(decode(raw))
dat["additional"]["proStatus"] = "free" if dat["additional"]["proStatus"] == "pro" else "pro"
c.execute("UPDATE settings SET value = ? WHERE key = 'settings'", (encode(json.dumps(dat)),))
conn.commit()
conn.close()
print("Toggled to:", dat["additional"]["proStatus"])

Bro thankyou so much. Still works on 04/11

@MakeSake

Copy link
Copy Markdown

yo thanks a lot it works on 22/6

@gui-analyst

gui-analyst commented Jun 25, 2026

Copy link
Copy Markdown

Could someone help me with a step-by-step guide for Windows 11? I don't have much programming experience and didn't understand how to carry out the procedure. (version 4.9). I tried using AI to help me with this, but for ethical reasons they told me they won't help me with it.

@ayoubstudy2009-ops

Copy link
Copy Markdown

Could someone help me with a step-by-step guide for Windows 11? I don't have much programming experience and didn't understand how to carry out the procedure. (version 4.9). I tried using AI to help me with this, but for ethical reasons they told me they won't help me with it.

First install python (you can ask ai to help with that)

Create a folder name it cold turkey activator or anything really doesn't matter

Create a new python file OR create a new text file and edit the .txt to .py, after naming it exactly: "ColdTurkeyBlockerActivator" so you have a file named: ColdTurkeyBlockerActivator.py

in that folder right click any empty space and choose "open in terminal"

after opening terminal type: "py ColdTurkeyBlockerActivator.py"

after that restart coldturkey and pro should be toggled

@raffaelcopy2005

Copy link
Copy Markdown

For older versions where the DB is plain JSON (not CTB17 encoded), the script above throws a ValueError. Here's a version that auto-detects the format and works for both:

import json
import sqlite3

DB_PATH = "C:/ProgramData/Cold Turkey/data-app.db"

def decode(s):
    if s.startswith("CTB17"):
        data = s[5:]
        return ''.join(chr(int(data[i:i+2], 16) - 0x11) for i in range(0, len(data), 2))
    return s  # já é JSON puro

def encode(s, was_encoded):
    if was_encoded:
        return "CTB17" + ''.join(f'{ord(c) + 0x11:02X}' for c in s)
    return s  # devolve JSON puro

conn = sqlite3.connect(DB_PATH)
c = conn.cursor()
raw = c.execute("SELECT value FROM settings WHERE key = 'settings'").fetchone()[0]
was_encoded = raw.startswith("CTB17")
dat = json.loads(decode(raw))
dat["additional"]["proStatus"] = "free" if dat["additional"]["proStatus"] == "pro" else "pro"
c.execute("UPDATE settings SET value = ? WHERE key = 'settings'", (encode(json.dumps(dat), was_encoded),))
conn.commit()
conn.close()
print("Toggled to:", dat["additional"]["proStatus"])

@ptc-kek

ptc-kek commented Jul 4, 2026

Copy link
Copy Markdown

This actually worked. GOATed. (on M2 MacAir, MacOS Tahoe)

The only thing I changed was that I did not fully quit ColdTurkey as my OS did not allow it. Despite this, I still ran the script after I attempted to force close ColdTurkey then restarted my Mac. From here, it worked.

Best,
kek

@stellam-a

Copy link
Copy Markdown

The original script was displaying an indentation error for me, so I modified it and I can confirm it works for version 4.9 as well.

import json
import sqlite3
import os

DB_PATH = "C:/ProgramData/Cold Turkey/data-app.db"

def decode(s):
    """Decodes the custom hex layout if present in newer versions."""
    if s.startswith("CTB17"):
        data = s[5:]
        return ''.join(chr(int(data[i:i+2], 16) - 0x11) for i in range(0, len(data), 2))
    return s

def encode(s, was_encoded):
    """Re-encodes the string if the source database used custom encoding."""
    if was_encoded:
        return "CTB17" + ''.join(f'{ord(c) + 0x11:02X}' for c in s)
    return s

def activate():
    conn = None  # Explicitly initialize to avoid UnboundLocalError in finally block
    try:
        conn = sqlite3.connect(DB_PATH)
        c = conn.cursor()
        
        # Fetch current settings row
        row = c.execute("SELECT value FROM settings WHERE key = 'settings'").fetchone()
        if not row:
            print("Error: Settings payload not found inside the database.")
            return
            
        raw_string = row[0]
        was_encoded = raw_string.startswith("CTB17")
        
        # Safely extract and parse JSON payload
        decoded_string = decode(raw_string)
        dat = json.loads(decoded_string)
        
        # Safeguard structure checks
        if "additional" not in dat:
            dat["additional"] = {}

        if dat["additional"].get("proStatus") != "pro":
            print("Your version of Cold Turkey Blocker is not activated.")
            dat["additional"]["proStatus"] = "pro"
            print("Changing status to: PRO.")
            
            new_payload = encode(json.dumps(dat), was_encoded)
            c.execute("UPDATE settings SET value = ? WHERE key = 'settings'", (new_payload,))
            conn.commit()
            print("Successfully updated to Pro. Please restart Cold Turkey Blocker completely.")
        else:
            print("Looks like your copy of Cold Turkey Blocker is already activated.")
            print("Deactivating it back to Free status now.")
            dat["additional"]["proStatus"] = "free"
            
            new_payload = encode(json.dumps(dat), was_encoded)
            c.execute("UPDATE settings SET value = ? WHERE key = 'settings'", (new_payload,))
            conn.commit()
            print("Toggled back to Free successfully.")
            
    except sqlite3.Error as e:
        print("Database operation failed:", e)
        print("Tip: Make sure Cold Turkey is COMPLETELY closed down via Task Manager before running.")
    except Exception as e:
        print("An unexpected runtime error occurred:", e)
    finally:
        if conn:
            conn.close()

def main():
    if os.path.exists(DB_PATH):
        print("Data file found.\nRunning database execution sequence...")
        activate()
    else:
        print(f"File not found at: {DB_PATH}")
        print("Looks like Cold Turkey Blocker is not installed, or path differs on your environment.")

if __name__ == '__main__':
    main()

@swarnimchoudhary

Copy link
Copy Markdown

is there any crack available for cold turkey micromanager too?

@Hthancder

Copy link
Copy Markdown

this work in windows 👍

import json
import sqlite3
import os

DB_PATH = "C:/ProgramData/Cold Turkey/data-app.db"

def activate():
conn = None
try:
conn = sqlite3.connect(DB_PATH)
c = conn.cursor()
row = c.execute("SELECT value FROM settings WHERE key = 'settings'").fetchone()

    if row is None:
        print("Key 'settings' not found. Creating default settings.")
        dat = {"additional": {"proStatus": "free"}}
    else:
        s = row[0]
        if not s:
            print("Settings value is empty. Creating default settings.")
            dat = {"additional": {"proStatus": "free"}}
        else:
            try:
                dat = json.loads(s)
            except json.JSONDecodeError:
                print("Settings JSON is corrupted or in wrong format.")
                print("Overwriting with default settings (proStatus=free).")
                dat = {"additional": {"proStatus": "free"}}

    # Toggle trạng thái pro
    current_status = dat.get("additional", {}).get("proStatus", "free")
    if current_status != "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 it again.")
    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()

@JosephChomboM

Copy link
Copy Markdown

What worked for me on a Mac with an M5 chip (July 17, 2026)

These are the steps that worked for me:

  1. Create a file named main.py on your Desktop.

  2. Copy the following code into the file:

import json
import sqlite3
import os

DB_PATH = "/Library/Application Support/Cold Turkey/data-app.db"

def decode(s):
    """Decodes the custom hex layout if present in newer versions."""
    if s.startswith("CTB17"):
        data = s[5:]
        return ''.join(chr(int(data[i:i+2], 16) - 0x11) for i in range(0, len(data), 2))
    return s

def encode(s, was_encoded):
    """Re-encodes the string if the source database used custom encoding."""
    if was_encoded:
        return "CTB17" + ''.join(f'{ord(c) + 0x11:02X}' for c in s)
    return s

def activate():
    conn = None  # Explicitly initialize to avoid UnboundLocalError in finally block
    try:
        conn = sqlite3.connect(DB_PATH)
        c = conn.cursor()
        
        # Fetch current settings row
        row = c.execute("SELECT value FROM settings WHERE key = 'settings'").fetchone()
        if not row:
            print("Error: Settings payload not found inside the database.")
            return
            
        raw_string = row[0]
        was_encoded = raw_string.startswith("CTB17")
        
        # Safely extract and parse JSON payload
        decoded_string = decode(raw_string)
        dat = json.loads(decoded_string)
        
        # Safeguard structure checks
        if "additional" not in dat:
            dat["additional"] = {}

        if dat["additional"].get("proStatus") != "pro":
            print("Your version of Cold Turkey Blocker is not activated.")
            dat["additional"]["proStatus"] = "pro"
            print("Changing status to: PRO.")
            
            new_payload = encode(json.dumps(dat), was_encoded)
            c.execute("UPDATE settings SET value = ? WHERE key = 'settings'", (new_payload,))
            conn.commit()
            print("Successfully updated to Pro. Please restart Cold Turkey Blocker completely.")
        else:
            print("Looks like your copy of Cold Turkey Blocker is already activated.")
            print("Deactivating it back to Free status now.")
            dat["additional"]["proStatus"] = "free"
            
            new_payload = encode(json.dumps(dat), was_encoded)
            c.execute("UPDATE settings SET value = ? WHERE key = 'settings'", (new_payload,))
            conn.commit()
            print("Toggled back to Free successfully.")
            
    except sqlite3.Error as e:
        print("Database operation failed:", e)
        print("Tip: Make sure Cold Turkey is COMPLETELY closed down via Task Manager before running.")
    except Exception as e:
        print("An unexpected runtime error occurred:", e)
    finally:
        if conn:
            conn.close()

def main():
    if os.path.exists(DB_PATH):
        print("Data file found.\nRunning database execution sequence...")
        activate()
    else:
        print(f"File not found at: {DB_PATH}")
        print("Looks like Cold Turkey Blocker is not installed, or path differs on your environment.")

if __name__ == '__main__':
    main()
  1. Force quit Cold Turkey Blocker by pressing:
Option + Command + Esc

I did this about three times in a row, until Cold Turkey Blocker no longer appeared in the Force Quit window.

  1. Open Terminal and navigate to the folder where main.py is located. For example:
cd ~/Desktop
  1. Run the script with administrator privileges:
sudo python3 main.py

Terminal will ask for your Mac password. Nothing will appear on the screen while you type it, which is normal. Press Enter when you are done.

  1. Force quit Cold Turkey Blocker again, but this time use Activity Monitor:

    • Open Activity Monitor.
    • Find the Cold Turkey Blocker process.
    • Select it.
    • Click the X button at the top of the window.
    • Confirm that you want to quit or force quit the process.
  2. Finally, reopen Cold Turkey Blocker.

If you are lucky and everything worked correctly, Cold Turkey Blocker should now be activated.

This is simply what worked for me, so your results may vary.

@heerajsaini

heerajsaini commented Jul 19, 2026

Copy link
Copy Markdown

Microsoft Windows [Version 10.0.26200.8875]
(c) Microsoft Corporation. All rights reserved.

C:\Windows\System32>cd C:\Users\heera\Desktop

C:\Users\heera\Desktop>py main.py
Choose [mac|win]: win
WARNING -> Code is not tested for Windows.
Traceback (most recent call last):
File "C:\Users\heera\Desktop\main.py", line 91, in
main()
File "C:\Users\heera\Desktop\main.py", line 81, in main
upgrade_blocker(c)
File "C:\Users\heera\Desktop\main.py", line 47, in upgrade_blocker
data = json.loads(s)
^^^^^^^^^^^^^
File "C:\Users\heera\AppData\Local\Programs\Python\Python312\Lib\json_init_.py", line 346, in loads
return _default_decoder.decode(s)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\heera\AppData\Local\Programs\Python\Python312\Lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\heera\AppData\Local\Programs\Python\Python312\Lib\json\decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

C:\Users\heera\Desktop>

ERROR ... ERROR ... ERROR bhenchod
please koi help karo i badly need this

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