Page 1 of 1
Help with torrent end script
Posted: Mon Oct 22, 2012 12:22 pm
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
Re: Help with torrent end script
Posted: Mon Apr 08, 2013 12:05 am
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.