Call script when download complete environment variables
-
- Posts: 4
- Joined: Tue Apr 21, 2009 8:44 pm
Call script when download complete environment variables
The "Call script when download complete " new feature in 2.13 is great. I would like to write a script that copies the downloaded file to another location.
However the environment variables for the script do no supply information about the downloaded file.
How about adding TR_DOWNLOADED_PATH variable with the full path to the finished downloaded file or folder?
thanks,
However the environment variables for the script do no supply information about the downloaded file.
How about adding TR_DOWNLOADED_PATH variable with the full path to the finished downloaded file or folder?
thanks,
Re: Call script when download complete environment variables
That's not a bad idea. Could you open a trac ticket for that? List it as a libtransmission enhancement, and please milestone it for 2.20, and add a link back to this forum thread.
Re: Call script when download complete environment variables
isn't that in effect already included in the present env variables TR_TORRENT_DIR and TR_TORRENT_NAMELoveLoveMeDoYouKnow wrote:How about adding TR_DOWNLOADED_PATH variable with the full path to the finished downloaded file or folder?
Code: Select all
TR_DOWNLOADED_PATH="$TR_TORRENT_DIR/$TR_TORRENT_NAME"
-
- Posts: 4
- Joined: Tue Apr 21, 2009 8:44 pm
Re: Call script when download complete environment variables
TR_TORRENT_NAME is the name of the torrent, not the name of the file(s) downloaded using the torrent.isn't that in effect already included in the present env variables TR_TORRENT_DIR and TR_TORRENT_NAME
In order to be able to copy the file(s) that were downloaded, I would need the path to the file(s).
Re: Call script when download complete environment variables
That should always be the case now, but I'm thinking ahead to when https://trac.transmissionbt.com/ticket/1220 is added, and torrent's names won't necessarily match up with their directory names.gunzip wrote:LoveLoveMeDoYouKnow wrote:isn't that in effect already included in the present env variables TR_TORRENT_DIR and TR_TORRENT_NAMEor maybe things are different between linux and a mac?Code: Select all
TR_DOWNLOADED_PATH="$TR_TORRENT_DIR/$TR_TORRENT_NAME"
Re: Call script when download complete environment variables
I don't understand what you mean. Given the top level directory name, you sohuld be able to do a recursive copy, right?LoveLoveMeDoYouKnow wrote:TR_TORRENT_NAME is the name of the torrent, not the name of the file(s) downloaded using the torrent.isn't that in effect already included in the present env variables TR_TORRENT_DIR and TR_TORRENT_NAME
In order to be able to copy the file(s) that were downloaded, I would need the path to the file(s).
-
- Posts: 4
- Joined: Tue Apr 21, 2009 8:44 pm
Re: Call script when download complete environment variables
Two (or more) torrents might load to the same folder. Also the user might have choosen to download only some of the filen in the torrent. When a download completes I want to be able to identify the completed files and only the completed files from the specific torrent.[I don't understand what you mean. Given the top level directory name, you sohuld be able to do a recursive copy, right?
Re: Call script when download complete environment variables
I'm not so hot on this idea... this to me seems like a slippery slope. Someone else could request that we include the seed ratio in the environment variables so that they can move the files if its ratio is high enough... or the torrent's priority, to stop the torrent if its priority is low... and on and on.
I think you could use "transmission-remote --move" to do what you're suggesting. It already handles the case where two torrents are in the same folder.
I think you could use "transmission-remote --move" to do what you're suggesting. It already handles the case where two torrents are in the same folder.
-
- Posts: 4
- Joined: Tue Apr 21, 2009 8:44 pm
Re: Call script when download complete environment variables
I was waiting for the post download script feature for a long time, and once it is implemented I found that I could not write a script to copy the files, because I do not know (from within the script) what these files are.
Other users might ask for other information if it is useful to them, and each request should be judged by its usefulness. In my opinion the purpose of using Transmission is to download files and do something with those files. Handling those files should be the number one priority of the post download script. I have no use for the torrent hash or ID once the torrent has finished its download.
So to sum up: Knowing the paths to the downloaded files would make the post download script useful to me, and save me the trouble to constantly monitor Transmission and manually copy the files. In any case I appreciate the willingness to consider such features - thanks.
Other users might ask for other information if it is useful to them, and each request should be judged by its usefulness. In my opinion the purpose of using Transmission is to download files and do something with those files. Handling those files should be the number one priority of the post download script. I have no use for the torrent hash or ID once the torrent has finished its download.
So to sum up: Knowing the paths to the downloaded files would make the post download script useful to me, and save me the trouble to constantly monitor Transmission and manually copy the files. In any case I appreciate the willingness to consider such features - thanks.
Re: Call script when download complete environment variables
I understand what you're saying. What I meant was I wonder how much of this is necessary to be in environment variables. For example there are already python, java, perl, ruby, and php modules that implement transmission's RPC protocol. (Links are at http://www.transmissionbt.com/resources.php.) Scripts in these languages can use RPC to learn all kinds of complicated information about the torrent.
Re: Call script when download complete environment variables
Accessing torrent file list in the on-completion scriptLoveLoveMeDoYouKnow wrote:So to sum up: Knowing the paths to the downloaded files would make the post download script useful to me, and save me the trouble to constantly monitor Transmission and manually copy the files.