Add handler for python program in chrome

I have a small python program for adding magnet urls to transmission on my server when i click them.
Here is how i made chrome call my python app:

Open regedit, go to HKEY_CURRENT_USER\Software\Classes

Add the keys(if they dont already exist): magnet\shell\open\command
In the command key, put this text in the (Standard) string (Adjust paths appropriately): “E:\Program\Python27\pythonw.exe” “E:\Program\Misc\magnet_add.pyw” “%1”

Edit: for making it work in firefox, you also need to add a string value for “URL Protocol = “magnet” in the root of magnet entry. Here is the full registry entry:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Classes\magnet]
@="URL:magnet Protocol"
"URL Protocol"="magnet"

[HKEY_CURRENT_USER\Software\Classes\magnet\shell]

[HKEY_CURRENT_USER\Software\Classes\magnet\shell\open]

[HKEY_CURRENT_USER\Software\Classes\magnet\shell\open\command]
@="\"E:\\Program\\Python27\\pythonw.exe\" \"E:\\Program\\Misc\\magnet_add.pyw\" \"%1\""

Comments are closed.