Hi!
I have a request for a simple plug-in that will give me a new option when I right-click on a torrent. This button (call it "Send to Filebot") would trigger a shell script with three arguments (torrent path, torrent name, torrent label).
The purpose is to load my rtorrent-postprocess.sh script (just like when it is triggered by the rtorrent.rc when a download is completed) shown below:
rtorrent.rc
Code:
system.method.set_key=event.download.finished,filebot_amc,"execute={/*****/rtorrent-postprocess.sh,$d.get_base_path=,$d.get_name=,$d.get_custom1=}"
rtorrent-postprocess.sh
Code:
#!/bin/bash
log_file="log_file.log"
echo "---------------------------------------------------" >> $log_file
echo "ProcessID: $$" >> $log_file
echo "Starting script at: $(date)" >> $log_file
echo "TORRENT_PATH: $1" >> $log_file
echo "TORRENT_NAME: $2" >> $log_file
echo "TORRENT_LABEL:$3" >> $log_file
TORRENT_PATH=$1
TORRENT_NAME=$2
TORRENT_LABEL=$3
{
if [ $TORRENT_LABEL = TV ] || [ $TORRENT_LABEL = Movies ] || [ $TORRENT_LABEL = New ] ;
then
echo "Label is TV, Movies or New"
bash ~/filebot/filebot.sh -script fn:amc --output "/*****/private/rtorrent/complete/" --log-file amc.log --action hardlink --conflict override --def "movieFormat=/*****/rtorrent/complete/Movies/{n.upperInitial().space('.')}.{y}.{source}.{vf}.{vc}{'-'+group}/{fn}" --def unsorted=y -non-strict --def music=n artwork=y "ut_dir=$TORRENT_PATH" "ut_kind=multi" "ut_title=$TORRENT_NAME" "ut_label=$TORRENT_LABEL" &
elif [ $TORRENT_LABEL = Games ]
then
echo "Label is Games"
else
echo "Label is NOT TV, Movies, Games or New"
fi
}
Bounty: £10 via PayPal!
Thanks for your help! Let me know if you have any questions or need any more info.
I have a request for a simple plug-in that will give me a new option when I right-click on a torrent. This button (call it "Send to Filebot") would trigger a shell script with three arguments (torrent path, torrent name, torrent label).
The purpose is to load my rtorrent-postprocess.sh script (just like when it is triggered by the rtorrent.rc when a download is completed) shown below:
rtorrent.rc
Code:
system.method.set_key=event.download.finished,filebot_amc,"execute={/*****/rtorrent-postprocess.sh,$d.get_base_path=,$d.get_name=,$d.get_custom1=}"
rtorrent-postprocess.sh
Code:
#!/bin/bash
log_file="log_file.log"
echo "---------------------------------------------------" >> $log_file
echo "ProcessID: $$" >> $log_file
echo "Starting script at: $(date)" >> $log_file
echo "TORRENT_PATH: $1" >> $log_file
echo "TORRENT_NAME: $2" >> $log_file
echo "TORRENT_LABEL:$3" >> $log_file
TORRENT_PATH=$1
TORRENT_NAME=$2
TORRENT_LABEL=$3
{
if [ $TORRENT_LABEL = TV ] || [ $TORRENT_LABEL = Movies ] || [ $TORRENT_LABEL = New ] ;
then
echo "Label is TV, Movies or New"
bash ~/filebot/filebot.sh -script fn:amc --output "/*****/private/rtorrent/complete/" --log-file amc.log --action hardlink --conflict override --def "movieFormat=/*****/rtorrent/complete/Movies/{n.upperInitial().space('.')}.{y}.{source}.{vf}.{vc}{'-'+group}/{fn}" --def unsorted=y -non-strict --def music=n artwork=y "ut_dir=$TORRENT_PATH" "ut_kind=multi" "ut_title=$TORRENT_NAME" "ut_label=$TORRENT_LABEL" &
elif [ $TORRENT_LABEL = Games ]
then
echo "Label is Games"
else
echo "Label is NOT TV, Movies, Games or New"
fi
}
Bounty: £10 via PayPal!
Thanks for your help! Let me know if you have any questions or need any more info.