Jump to content

Run Program not triggering on state change


Recommended Posts

I have a python script running on torrent state change.  Not all state changes will trigger the script.

Windows 10 Home

uTorrent Version: 3.5.5 (build 46020) [32-bit]


Options -> Preferences -> Advanced -> Run Program -> Run this program when a torrent changes state:

pythonw c:\users\mrmena\scripts\torrent_state_change.py "%N" "%F" "%S" "%K"

Steps to reproduce:

1 - Add torrent using magnet link

2 - Allow torrent to download to completion (seeding)

3 - Observe only 3 state changes detected by the python script (below): Checked, Queued, Connecting To Peers

I am unable to get any further state changes.  I would ideally like to trigger a transcoding operation when the torrent reaches the seeding state but the state change is not triggered.

My python script is as follows:

import sys
from win32ui import MessageBox

	1: "Error",
	2: "Checked",
	3: "Paused",
	4: "Super seeding",
	5: "Seeding",
	6: "Downloading",
	7: "Super seed [F]",
	8: "Seeding [F]",
	9: "Downloading [F]",
	10: "Queued seed",
	11: "Finished",
	12: "Queued",
	13: "Stopped",
	17: "Preallocating",
	18: "Downloading Metadata",
	19: "Connecting to Peers",
	20: "Moving",
	21: "Flushing",
	22: "Need DHT",
	23: "Finding Peers",
	24: "Resolving",
	25: "Writing"
if state in states:
	state_name = states[state]
	state_name = f"Unknown state: {int(state)}"

MessageBox(f"Name: {name}\nFilename: {filename}\nState: {state_name}\nKind: {kind}", "Torrent Status Change")

I've had a look online for a solution but haven't found anything specific or recent.

Is there something I'm missing or are there any suggestions on what I might try next?

Thanks for your help


Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...