fire upload script right after download finishes

Discussion of Transmission that doesn't fit in the other categories
Post Reply
Ortix
Posts: 28
Joined: Wed Nov 18, 2009 2:03 am

fire upload script right after download finishes

Post 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.
gunzip
Posts: 272
Joined: Wed May 05, 2010 2:12 am

Re: fire upload script right after download finishes

Post 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.
Ortix
Posts: 28
Joined: Wed Nov 18, 2009 2:03 am

Re: fire upload script right after download finishes

Post 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 :)
Ortix
Posts: 28
Joined: Wed Nov 18, 2009 2:03 am

Re: fire upload script right after download finishes

Post 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?
Moe
Posts: 16
Joined: Fri Dec 17, 2010 4:38 am

Re: fire upload script right after download finishes

Post by Moe »

the freeze is fixed in the nightly builds. https://trac.transmissionbt.com/ticket/3764
gunzip
Posts: 272
Joined: Wed May 05, 2010 2:12 am

Re: fire upload script right after download finishes

Post 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.
Ortix
Posts: 28
Joined: Wed Nov 18, 2009 2:03 am

Re: fire upload script right after download finishes

Post by Ortix »

yes i did! and it worked great :D
Post Reply