Jump to content

Run Program not triggering on state change


mrmena

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]

Helper 2.0.18.1499

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
name=sys.argv[1]
filename=sys.argv[2]
state=int(sys.argv[3])
kind=sys.argv[4]

states={
	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]
else:
	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

Archived

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

×
×
  • Create New...