Help with torrent end script

Ask for help and report issues with the GTK+ version of Transmission
Post Reply
stansted
Posts: 1
Joined: Mon Oct 22, 2012 12:07 pm

Help with torrent end script

Post by stansted »

Hi, i am really new to this whole scripting thing, but what i am wanting to do is run a script that just copies the downloaded file to another directory (not move). Sorry if this seems a little silly, but i cant seem to find a good how to for someone as new as myself.

Thanks
pyed
Posts: 14
Joined: Sat Feb 02, 2013 9:28 am

Re: Help with torrent end script

Post by pyed »

well, doing this with shell script would be better and easier, but here's python script to do that

Code: Select all

#!/usr/bin/env python

from os import system, environ
from sys import exit
from os.path import join

to_dic = "CHANGE ME TO THE DESIRED LOCATION"  # e.g /Users/me/Movies

tName = environ['TR_TORRENT_NAME']
tDir = environ['TR_TORRENT_DIR']

fullDir = join(tDir, tName)

command = "cp -r " + fullDir + ' ' + to_dic

system(command)

exit(0)

you have to change the variable on line 7 to the location that you need to move the files to, and this script won't wrok on Windows but modifying it for Windows would be easy.

and again, you can do this using one line with shell script.
Post Reply