Issue 46: How to add torrent2web to config file?
Status:  Fixed
Owner:
Closed:  Jan 2012
Project Member Reported by login...@gmail.com, Jan 10, 2012
torrent2web needs to be runned ONE time for downloaded torrent.
This is command line:

./torrent2web.sh torrent2web $valid_directory_path_or_file_path $torrent_name_or_directory_name_or_file_name

This is soruce script:
http://torrent2web.googlecode.com/files/torrent2web.sh
Jan 10, 2012
Project Member #1 addicted...@gmail.com
This is what I was looking into : adding more arguments than just the torrent path
It's getting kinda tricky but I think we can make this work.

I'll add the ability to assign up to 5 variables to each one of the scripts

When this is ready, you'll need to use the processed_torrent_script variables
Keep in mind that movies_post, tv_shows_post and music_post will automatically switch from move to copy when using this routine
Jan 10, 2012
Project Member #2 addicted...@gmail.com
Can you try the attached script using the following variables :
processed_torrent_script_enabled="yes"
processed_torrent_script="/path/to/torrent2web.sh"

Then feed up to 5 variables using the following variables. If you set a value to "file_path" then the processed directory or file path will be sent
processed_torrent_script_variable_1=""
processed_torrent_script_variable_2=""
processed_torrent_script_variable_3=""
processed_torrent_script_variable_4=""
processed_torrent_script_variable_5=""

Let me know how it works for you

Jan 10, 2012
Project Member #3 addicted...@gmail.com
Use this script instead
It seems to work, but it is still experimental
torrentexpander.sh
135 KB   View   Download
Jan 12, 2012
Project Member #4 login...@gmail.com
I can not made it to work.
Jan 12, 2012
Project Member #5 addicted...@gmail.com
Turns out it didn't work as expected
Now it does

Say you want to pass this command :
ls -la /path/to/processed/directory
You'll need to use these values :
processed_torrent_script_enabled=yes
processed_torrent_script="ls" (or processed_torrent_script="/bin/ls")
processed_torrent_script_variable_1="-la"
processed_torrent_script_variable_2="file_path" (the script will replace "file_path" with the actual processed directory path)

You can use up to 5 arguments, including the /path/to/processed/directory

Keep in mind that movies_post, tv_shows_post and music_post will automatically switch from move to copy when this feature is enabled

This script won't be run in the background. So torrentexpander will only exit when your script is done.
This means that if transmission send a new torrent to torrentexpander in the meantime and if your script lasts more than one hour, this new instance of torrentexpander will quit without processing the new torrent.
Jan 18, 2012
Project Member #6 login...@gmail.com
Sorry, i could not understand Comment 5, because torrent2web.sh script path is missing.

Jan 18, 2012
Project Member #7 login...@gmail.com
Ops, sorry, it was only an example...

This would be correct:

processed_torrent_script_enabled="yes"
processed_torrent_script="/home/Gianni/torrent2web.sh"
processed_torrent_script_variable_1="file_path"

But i need one more var like "name" ($2 would be good)

Jan 18, 2012
Project Member #8 login...@gmail.com
If you have some time... 
Is it possible to have a "imdb_poster_url" var?
Jan 18, 2012
Project Member #9 addicted...@gmail.com

What do you mean by name ?
Just an equivalent to "$(basename "$file_path")" or something else ?

Please list all variables that may be required so that I can add them all in one shot (imdb title, imdb poster url, and so on.
Adding custom values is not as easy as it may seem. Unless I export them, the line looks like this with only one custom value.
"$processed_torrent_script" "$(if [ "$processed_torrent_script_variable_1" == "file_path" ]; then echo "$file_path"; else echo "$processed_torrent_script_variable_1"; fi)" "$(if [ "$processed_torrent_script_variable_2" == "file_path" ]; then echo "$file_path"; else echo "$processed_torrent_script_variable_2"; fi)" "$(if [ "$processed_torrent_script_variable_3" == "file_path" ]; then echo "$file_path"; else echo "$processed_torrent_script_variable_3"; fi)" "$(if [ "$processed_torrent_script_variable_4" == "file_path" ]; then echo "$file_path"; else echo "$processed_torrent_script_variable_4"; fi)" "$(if [ "$processed_torrent_script_variable_5" == "file_path" ]; then echo "$file_path"; else echo "$processed_torrent_script_variable_5"; fi)"

Thanks
Jan 18, 2012
Project Member #10 login...@gmail.com
'Name' could be the second argoument that transmission/rtorrent/pyload send to program, otherwise it could be the directory name or the single-file name.

Other vars that could be usefully:
imdb_id
imdb_title
imdb_poster_url
tmdb_fanart_url
poster_file_path
fanart_file_path

Jan 18, 2012
Project Member #11 addicted...@gmail.com
In SVN revision 164, you'll now have access to new variables for your script.

Just set any of the 5 script variables to one of these values :
file_path
name_with_extension
name_without_extension
imdb_title
imdb_url
imdb_id
poster_url

poster_file_path and fanart_file_path need too much work because I would need to keep track of all their movements during the script. I don't think that would be worth it.

Thanks
Jan 21, 2012
Project Member #12 login...@gmail.com
(No comment was entered for this change.)
Status: Fixed