-
-
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() |
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!
version 4.7 works fine but for 4.5 I'm getting the same error still haven't figured out how to solve it
Latest mac version? Anyone?
Ran into this problem, please help out
The mac version is below.
How to use:
- Go to Allow in Background and turn off
Felix Belzile.- Press
option+command+escto quit Cold Turkey Blocker.- Open TextEdit and create a new file named
ColdTurkeyBlockerActivator.py(save it as .txt first, then rename it to .py).- Paste
cd ~/Documentsin Terminal and press Enter.- Run the script with
sudo python3 ColdTurkeyBlockerActivator.pyand enter your password when prompted.- Enjoy your activated Cold Turkey Blocker!
import json import sqlite3 import os DB_PATH = "/Library/Application Support/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()
Can Anyboady tell me How to do this like a detailed guide. I have cold turkey 4.5
First where to put the code and where to make the folder is it in cold turkey or in 'c' folder
second do i need to python to be installed in my pc
Third If anybody can make a video or write it briefly it will be helpful.
I ran it and the app is still on the free version.
Run the code of SobhnathxLuffy. Its worked for me
bro its not working for 4.6 any tips you can provide?
I'm on 4.6 version and this worked for me. Try the code JustaTurtle21 just updated above, https://gist.github.com/miketartar/0fc8d7bca2369ce73ea9ee7b6e0c3775?permalink_comment_id=5426749#gistcomment-5426749. Just download python, set up the environment, create a file name.txt, and open CMD, type "python name.txt" and it should be worked.
What is the emaning of setting up environment? I don't know
If you have previously installed Cold Turkey version 4.6 or later, please uninstall it first using the instructions here: https://getcoldturkey.com/support/reinstall-instructions/
Then, download the earlier versions and follow the steps provided in the README file carefully.
C:\Users\USER\Downloads>py activator.py
Data file found.
Let's activate your copy of Cold Turkey Blocker.
Traceback (most recent call last):
File "C:\Users\USER\Downloads\activator.py", line 41, in
main()
~~~~^^
File "C:\Users\USER\Downloads\activator.py", line 36, in main
activate()
~~~~~~~~^^
File "C:\Users\USER\Downloads\activator.py", line 12, in activate
dat = json.loads(s)
File "C:\Python313\Lib\json_init_.py", line 346, in loads
return _default_decoder.decode(s)
~~~~~~~~~~~~~~~~~~~~~~~^^^
File "C:\Python313\Lib\json\decoder.py", line 345, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python313\Lib\json\decoder.py", line 363, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
im getting this error. does it have to do with the codifications of the s object? please help
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
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
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
Works for 4.7 :
`import sqlite3
import os
import zlib
import lzma
import gzip
import io
DB_PATH = "C:/ProgramData/Cold Turkey/data-app.db"
def try_decompress(data):
# Essais de décompression connus
try:
print("\nTest zlib...")
out = zlib.decompress(data)
print("ZLIB OK, taille :", len(out))
print("Début texte :", out[:200])
return
except Exception as e:
print("ZLIB fail:", e)
try:
print("\nTest LZMA...")
out = lzma.decompress(data)
print("LZMA OK, taille :", len(out))
print("Début texte :", out[:200])
return
except Exception as e:
print("LZMA fail:", e)
try:
print("\nTest GZIP...")
out = gzip.GzipFile(fileobj=io.BytesIO(data)).read()
print("GZIP OK, taille :", len(out))
print("Début texte :", out[:200])
return
except Exception as e:
print("GZIP fail:", e)
print("\nAucune méthode standard n’a marché → sûrement un chiffrement propriétaire.")
def analyze_binary():
conn = sqlite3.connect(DB_PATH)
c = conn.cursor()
row = c.execute("SELECT value FROM settings WHERE key = 'settings'").fetchone()
conn.close()
if not row or not row[0]:
print("Pas de valeur trouvée.")
return
data = row[0]
raw_bytes = bytes.fromhex(data[3:]) # enlever le CTB
print("Taille binaire :", len(raw_bytes))
print("Premiers octets :", raw_bytes[:20])
try_decompress(raw_bytes)
def main():
if os.path.exists(DB_PATH):
print("Base trouvée.\nAnalyse binaire...")
analyze_binary()
else:
print("Base introuvable.")
if name == 'main':
main()
`
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!)
- Download version 4.5 of Cold Turkey Blocker from this link: https://cold-turkey.en.uptodown.com/windows/download/1030193999
- Run the .exe and install it. Open the program at least once.
- 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
- Install Python for Windows and all its necessary dependencies. https://www.python.org/downloads/windows/
- 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.
- Now type in the terminal "py main.py" but without the quotation marks.
- Your Cold Turkey Blocker will now become Pro.
- 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.
- Profit.
For people who are unable to use it on version 4.6 and up, just apply it on 4.5 first. Then update it from the official website. It works fine
Well, I get this error: The database where your settings are stored is locked and can't be
read. Try opening Cold Turkey Blocker in a few seconds.
When I try to install 4.5
For people who are unable to use it on version 4.6 and up, just apply it on 4.5 first. Then update it from the official website. It works fine
Well, I get this error: The database where your settings are stored is locked and can't be read. Try opening Cold Turkey Blocker in a few seconds. When I try to install 4.5
✅ Solution: I had this similar problem, but my solution was to use "HiBit Uninstaller" after uninstalling it normally. After the normal uninstallation, there's a popup window that appears and a checkbox that says "Advanced". If you check that it looks into more related files to ColdTurkey and actually deletes them, while having the option to "back" those files up. The uninstaller someone mentioned above may not be the most effective. Give HiBit Uninstaller a try.
https://www.hibitsoft.ir/Uninstaller.html
Now I was able to install 4.5 no problem.
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!)
- Download version 4.5 of Cold Turkey Blocker from this link: https://cold-turkey.en.uptodown.com/windows/download/1030193999
- Run the .exe and install it. Open the program at least once.
- 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
- Install Python for Windows and all its necessary dependencies. https://www.python.org/downloads/windows/
- 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.
- Now type in the terminal "py main.py" but without the quotation marks.
- Your Cold Turkey Blocker will now become Pro.
- 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.
- Profit.
✅ This works for me.
So, I went to Downloads folder, copied the directory address which is: "C:\Users\ayuna\Downloads"
So the full command in Command Prompt is "cd C:\Users\kentc\Downloads" then I followed the guide this guy said which is to type "py main.py" then "win" = profit.
For people who are unable to use it on version 4.7+, just apply it on 4.5 first. Then update it from the official website. It works fine
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!)
- Download version 4.5 of Cold Turkey Blocker from this link: https://cold-turkey.en.uptodown.com/windows/download/1030193999
- Run the .exe and install it. Open the program at least once.
- 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
- Install Python for Windows and all its necessary dependencies. https://www.python.org/downloads/windows/
- 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.
- Now type in the terminal "py main.py" but without the quotation marks.
- Your Cold Turkey Blocker will now become Pro.
- 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.
- Profit.
Thanks! It worked for me!
Well, I get this error: The database where your settings are stored is locked and can't be
read. Try opening Cold Turkey Blocker in a few seconds.
If anyone gets this error about the database being locked, that is probably because CTB is using it somehow. This prob happened when you tried to install latest version first then uninstalled, then reinstalled into 4.5. Uninstall ALL remnants of CTB, including the Windows installation as well as any browser extensions, then go to the folder here:
C:/ProgramData/Cold Turkey/data-app.db
and delete the contents of that folder including data-app.db. If Windows cannot delete it it means there's still a CTB instance, either Windows or browser, using it. So make sure everything is uninstalled / restart to be sure. Once you can successfully delete the data-app.db, you can try reinstalling the CTB version you want and try again.
Well, I get this error: The database where your settings are stored is locked and can't be
read. Try opening Cold Turkey Blocker in a few seconds.If anyone gets this error about the database being locked, that is probably because CTB is using it somehow. This prob happened when you tried to install latest version first then uninstalled, then reinstalled into 4.5. Uninstall ALL remnants of CTB, including the Windows installation as well as any browser extensions, then go to the folder here:
C:/ProgramData/Cold Turkey/data-app.dband delete the contents of that folder including data-app.db. If Windows cannot delete it it means there's still a CTB instance, either Windows or browser, using it. So make sure everything is uninstalled / restart to be sure. Once you can successfully delete the data-app.db, you can try reinstalling the CTB version you want and try again.
I already answered above as well. To anyone reading, read my reply as well if you wan easier solution.
Well, I get this error: The database where your settings are stored is locked and can't be
read. Try opening Cold Turkey Blocker in a few seconds.If anyone gets this error about the database being locked, that is probably because CTB is using it somehow. This prob happened when you tried to install latest version first then uninstalled, then reinstalled into 4.5. Uninstall ALL remnants of CTB, including the Windows installation as well as any browser extensions, then go to the folder here:
C:/ProgramData/Cold Turkey/data-app.db
and delete the contents of that folder including data-app.db. If Windows cannot delete it it means there's still a CTB instance, either Windows or browser, using it. So make sure everything is uninstalled / restart to be sure. Once you can successfully delete the data-app.db, you can try reinstalling the CTB version you want and try again.I already answered above as well. To anyone reading, read my reply as well if you wan easier solution.
I'm not sure if an uninstaller will fully work. You could wipe all installation files of CTB on your machine, but the uninstaller will probably not account for CTB browser extensions which also lock the db.
can i get any code for coldturkey Micromanager ?
still working?
working
just so that it doesn't close .
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!)
- Download version 4.5 of Cold Turkey Blocker from this link: https://cold-turkey.en.uptodown.com/windows/download/1030193999
- Run the .exe and install it. Open the program at least once.
- 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
- Install Python for Windows and all its necessary dependencies. https://www.python.org/downloads/windows/
- 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.
- Now type in the terminal "py main.py" but without the quotation marks.
- Your Cold Turkey Blocker will now become Pro.
- 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.
- Profit.
for those that already had v 4.7 and wanted to uninstall it but when they do it normally it doesn't want to work (when you go to the previous version it throws these problems :
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.
) .
go to this link and then download this [ removal tool ] https://getcoldturkey.com/support/reinstall-instructions/ from cold turkey . and then follow these steps listed up and it will work .
but this is illegal, so is any legal risk if i do this ?
but this is illegal, so is any legal risk if i do this ?
bro! are you really an IITan?
If you so really care for legality then just buy the software.
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!)
- Download version 4.5 of Cold Turkey Blocker from this link: https://cold-turkey.en.uptodown.com/windows/download/1030193999
- Run the .exe and install it. Open the program at least once.
- 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
- Install Python for Windows and all its necessary dependencies. https://www.python.org/downloads/windows/
- 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.
- Now type in the terminal "py main.py" but without the quotation marks.
- Your Cold Turkey Blocker will now become Pro.
- 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.
- Profit.
this method worked for me. as i am using 4.5 version and after it worked i installed the latest version and still works ✅
this is the more updated version:
import json import sqlite3 import os DB_PATH = "C:/ProgramData/Cold Turkey/data-app.db" def activate(): conn = None # Initialize conn to None to handle exceptions during connection try: conn = sqlite3.connect(DB_PATH) c = conn.cursor() # Fetch settings result = c.execute("SELECT value FROM settings WHERE key = 'settings'").fetchone() if not result: print("No settings found in the database.") return s = result[0] dat = json.loads(s) # Check and update proStatus additional = dat.setdefault("additional", {}) # Safely get 'additional' key if additional.get("proStatus") != "pro": print("Your version of Cold Turkey Blocker is not activated.") 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.") additional["proStatus"] = "free" # Update the database c.execute("UPDATE settings SET value = ? WHERE key = 'settings'", (json.dumps(dat),)) conn.commit() except sqlite3.Error as e: print("Failed to activate:", e) except json.JSONDecodeError as e: print("Failed to parse settings JSON:", e) except KeyError as e: print("Key error in settings data:", 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, please run it at least once.") if __name__ == '__main__': main()has worked for cold turkey 4.5
Could not find platform independent libraries
Data file found.
Let's activate your copy of Cold Turkey Blocker.
Failed to parse settings JSON: Expecting value: line 1 column 1 (char 0)
help plsss


@domodigitalbusiness https://web.archive.org/web/20250000000000*/https://getcoldturkey.com/pricing/
Jan 2 one for example is v5.5, I used that