Page 1 of 1

Help with utorrent script

Posted: 08 Oct 2012, 23:27
by belgarth
I recently switched to using using the utorrent-postprocessing script with deluge. I had to adjust it a bit since deluge doesn't support things like ut_kind, etc, but it basically works. I'm running into one issue that I don't believe is related to deluge vs utorrent however.

The problem relates to the extractor part of the script combined with move vs copy. I would like a way so that if a file is generated via the extractor then it gets moved, but if it was part of an archive, then instead copy it. Basically, I have no use for the file if it was extracted out of the archive (since it isn't needed to seed), so in that case the move option is what I want, but then when it isn't an rared torrent, then I want to have the copy in my download folder so I can continue seeding, which would mean the copy option. Is there any built in functionality to the script to accomplish this sort of behavior?

--
Brett

Re: Help with utorrent script

Posted: 09 Oct 2012, 04:22
by rednoah
Nope, it'll just extract things and add everything to the input set.

Seems like a weird place between move/copy so I won't put it into the standard script. Why not run some sort of detection on your own if it's archived or not, and depending on that you switch it to move or copy mode. You can do that in the script easily, or in python before you call the script with --action either move or copy.

fyi you can just set ut_kind=multi, that works for all cases, even single file torrents.

Re: Help with utorrent script

Posted: 09 Jan 2013, 23:28
by belgarth
Here is the diff of the changes to the utorrent script I came up with to deal with extracted files in case someone else needs it:
belgarth@server1:~/bin$ diff utorrent-postprocess.groovy test
3d2
< def extracted = []
82,83c81
< extracted = extract(file: input.findAll{ it.isArchive() }, output: null, conflict: 'override', filter: { it.isVideo() }, forceExtractAll: true)
< input += extracted
---
> input += extract(file: input.findAll{ it.isArchive() }, output: null, conflict: 'override', filter: { it.isVideo() }, forceExtractAll: true)
250,253d247
<
< // Print Delete list
< extracted.each{ f -> _log.finest("Delete: $f") }
< extracted.each{ f -> new File("$f").delete() }