Page 1 of 1

fire upload script right after download finishes

Posted: Tue Dec 21, 2010 11:49 pm
by Ortix
Is there a way to fire a script which triggers another application on my centos webserver to upload the just downloaded file?

Let's say file.txt just finished download, then i want a command like this to be fired: "plowup /path/to/file.txt megaupload"

This is the command i type in the terminal to upload stuff with plowshare. other ideas are also welcome. I mainly would like to upload to megaupload and multiupload, but MU is priority.

What it basically comes down to is the question of transmission being able to "say" the path to the newly finished file and using that in a script to run the above command.

Again, i'm sorry if this post is not allowed. And if it's not, i would like to know why.

Re: fire upload script right after download finishes

Posted: Wed Dec 22, 2010 12:53 am
by gunzip
first you have to enable the script-done feature in settings.json:

"script-torrent-done-enabled": true,
"script-torrent-done-filename": "/path/to/your/uploadscript",

then make sure script is executable "chmod 755 uploadscript"

the actual uploadscript might look someting like this:

Code: Select all

#!/bin/bash
plowup "$TR_TORRENT_DIR/$TR_TORRENT_NAME" megaupload >>/tmp/script.log 2>&1
just keep in mind the torrent can either be a file or directory. also the file /tmp/script.log will contain a record of the output and can be useful for troubleshooting.

Re: fire upload script right after download finishes

Posted: Wed Dec 22, 2010 1:01 pm
by Ortix
ok that's awesome! :D now i just need to find a way to output the urls to a txt file! Will post results for other people who are interested :)

Re: fire upload script right after download finishes

Posted: Wed Dec 22, 2010 3:07 pm
by Ortix
ok i tested and this works amazingly well! I even managed to get the url and filename outputted to a txt file. However, transmission freezes up once the script starts and it stays like that until the script is done. How can i fix this?

Re: fire upload script right after download finishes

Posted: Wed Dec 22, 2010 5:44 pm
by Moe
the freeze is fixed in the nightly builds. https://trac.transmissionbt.com/ticket/3764

Re: fire upload script right after download finishes

Posted: Thu Dec 23, 2010 3:43 am
by gunzip
Ortix, if the script normally takes a long time to finish, try doing this:

Code: Select all

#!/bin/bash
{
<your script>
} &
and see if it makes a difference.

Re: fire upload script right after download finishes

Posted: Thu Dec 23, 2010 11:38 am
by Ortix
yes i did! and it worked great :D