Page 1 of 1

utorrent-postprocess with action move

Posted: 18 Nov 2012, 12:08
by Pikachu320
Hello,

I have trouble setting up the utorrent-postprocess with the action move instead of copy.

Here is my command line:

Code: Select all

filebot -script "C:/Program Files (x86)/FileBot/my-utorrent-postprocess.groovy" --output "U:/" --action move --conflict override -non-strict --log all --def subtitles=y artwork=y "ut_dir=%D" "ut_file=%F" "ut_kind=%K" "ut_title=%N" "ut_label=%L" "ut_state=%S" >> "%D\filebot.log" 2>&1
My script "my-utorrent-postprocess.groovy" is a local copy of the utorrent-postprocess.groovy file found on your website (in http://filebot.sourceforge.net/scripts/).

I experience 2 problems, I don't know yet how it's selected (My guess it's based on time). Here they are:
* The download of the torrent completes, and then the filebot script triggers (which moves the file out of uTorrent bounds). Then uTorrent complains about the file (Error read from file:Missing). (A small problem)
* The filebot script can't move the file cause it's used by another process (That's written in my filebot.log file). (A bigger problem)

Is there no way to check the status of the torrent before trying to do the action "move" ? I don't get why utorrent is starting the filebot when the download is finished instead of when the seeding is finished.
We have the ut_state. Maybe it could help ?

Am I the only one with that problem ?

PS : µtorrent version 3.2.2 / FileBot 3.1 (r1296) / Java(TM) SE Runtime Environment 1.7.0_09

Re: utorrent-postprocess with action move

Posted: 18 Nov 2012, 15:52
by rednoah
As far as I know uT doesn't have a state for Finished & Seeding Goal Reached. If there was it'd be easy. Maybe you can ask around in the uT forums?

EDIT: Unless you'll find new info in the uT forums you won't get move working, but have you looked into hardlinks?
http://www.torrent-invites.com/audio-vi ... pying.html

Re: utorrent-postprocess with action move

Posted: 19 Nov 2012, 20:32
by Pikachu320
I've posted on the µT forums, I'm waiting for the reply.

I guess hardlinks or softlinks won't work, because my destination is another box on the network...

Re: utorrent-postprocess with action move

Posted: 20 Nov 2012, 19:58
by Pikachu320
Apparently the best solution is to use the filebot command when state changes instead of when completed.

Then, we need to check the status in the utorrent-postprocess. The value of the status must be 11 before a filebot run.

I'll try to adapt the script and see if it works. If I don't understand the groovy language/the script, I'll come back here ;)

Re: utorrent-postprocess with action move

Posted: 22 Nov 2012, 13:24
by rednoah
Well, that should be the "Finished" state, so what state would it be when it normally calls the "On Finished" command?

Anyway, just add something like this to the beginning of your script:

Code: Select all

if (ut_state != '11') throw new Exception("Ignore state: $ut_state")

Re: utorrent-postprocess with action move

Posted: 10 Dec 2012, 17:25
by Pikachu320
Sorry for the late reply.

I've tested it immediately after my previous post. That's basically what I did. However I return null instead of throwing an exception. I don't know what's best/exiting quickly/more clean.

Code: Select all

if (ut_state != '11' ) {
   println("State not equal to 'Finished' (Current state="+ut_state+") for file "+ut_file+", exiting.")
   return null
}
It's working as expected.
With that kind of trigger, the black popup happens a lot more often (on every state change instead of on every finished download), evn if it ends earlier due to the exit/exception added. But it may be annoying for some people.
These should definitely use the vbs script for hiding the window.

What you do think of patching the upstream with that?

Re: utorrent-postprocess with action move

Posted: 10 Dec 2012, 18:13
by rednoah
Added that and it's online now. Hopefully doesn't break anything for all the other people that do things on state 5...

This is how you'd set it up:

Code: Select all

--def ut_state=%S ut_state_allow=11
It'll break with an exception (negative exit code) if ut_state != ut_state_allow. If either is undefined it'll continue normally making it compatible with how people are using the script right now.