trying to automate things

Support for Ubuntu and other Desktop Linux distributions
Post Reply
Dtech
Posts: 12
Joined: 18 Jan 2017, 22:27

trying to automate things

Post by Dtech »

the idea is that when they are all done they will be moving hardlinked but i can not seem to get rtorrent to register them also would like to know if there is a way to just have it process everything in the label rather than just the one after completed
anyone who could help that would be amazing!!!

Code: Select all

/home/user/bin/rtorrent-postprocess.sh
#set var
USER=$(cat /srv/rutorrent/home/db/master.txt)
CONFIG_OUTPUT="/home/$USER/torrents/rtorrent/complete"
TORRENT_LABEL=$3=$ARG_LABEL
ARG_PATH="$1"
ARG_NAME="$2"
ARG_LABEL="$3"
#filebot commands
case $TORRENT_LABEL in
  movie*)
  filebot -script fn:amc --output "$CONFIG_OUTPUT" --action hardlink --conflict skip -non-strict --log-file amc.log --def unsorted=y music=n artwork=n excludeList=".excludes" ut_dir="$ARG_PATH" ut_kind="multi" ut_title="$ARG_NAME" ut_label="$ARG_LABEL" --def subtitles=en,de,fr --def @/home/$USER/bin/formating &
  ;;
  tv*)
  filebot -script fn:amc --output "$CONFIG_OUTPUT" --action hardlink --conflict skip -non-strict --log-file amc.log --def unsorted=y music=n artwork=n excludeList=".excludes" ut_dir="$ARG_PATH" ut_kind="multi" ut_title="$ARG_NAME" ut_label="$ARG_LABEL" --def @/home/$USER/bin/formating &
  ;;
  anime*)
  filebot -script fn:amc --output "$CONFIG_OUTPUT" --action hardlink --conflict skip -non-strict --log-file amc.log --def unsorted=y music=n artwork=n excludeList=".excludes" ut_dir="$ARG_PATH" ut_kind="multi" ut_title="$ARG_NAME" ut_label="$ARG_LABEL" --def @/home/$USER/bin/formating &
  ;;
esac
@/home/$USER/bin/formating
file has

Code: Select all

movieFormat=Movies/"{n} ({y})"
seriesFormat=Shows/"{n}/{s00e00} - {t}"
animeFormat=Anime/"{n}/{s00e00} - {t}"
musicFormat=Music/{n}/{album+'/'}{pi.pad(2)+'. '}{artist} - {t}

.rtorrent.rc

Code: Select all

system.method.set_key=event.download.finished,filebot,"execute=/home/$U/bin/rtorrent-postprocess.sh"' >> /home/$U/.rtorrent.rc
User avatar
rednoah
The Source
Posts: 22974
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: trying to automate things

Post by rednoah »

1.
What do you mean by rtorrent doesn't register them? Do you mean your script is never executed? Or that it isn't pass the appropriate options?

Here's a few scripts that can help with debugging:
viewtopic.php?f=4&t=3067

Since you're using the same amc command, I'd use the case statement only to add additional parameters like --def subtitles=en,de,fr:

Code: Select all

case $TORRENT_LABEL in
  movie*)
    EXTRA_OPTS="--def subtitles=en,de,fr"
  ;;
  tv*)
    EXTRA_OPTS=""
  ;;
  anime*)
    EXTRA_OPTS=""
  ;;
esac

filebot -script fn:amc --output "$CONFIG_OUTPUT" --action hardlink --conflict skip -non-strict --log-file amc.log --def unsorted=y music=n artwork=n excludeList=".excludes" ut_dir="$ARG_PATH" ut_kind="multi" ut_title="$ARG_NAME" ut_label="$ARG_LABEL" --def @/home/$USER/bin/formating $EXTRA_OPTS &

2.
As a default I would always recommend using {plex} and then users can change that to match their preferences later if they so choose:

Code: Select all

movieFormat={plex}
seriesFormat={plex}
animeFormat={plex}
musicFormat={plex}

3.
Does rtorrent pass in a default set of arguments $1 $2 $3 if you don't specify any? I thought arguments are only passed if it's configured to:

Code: Select all

system.method.set_key=event.download.finished,filebot,"execute={/Users/reinhard/rtorrent-postprocess.sh,$d.get_base_path=,$d.get_name=,$d.get_custom1=}"
@see viewtopic.php?f=4&t=215#p5316
@see viewtopic.php?f=4&t=4765#p26575
:idea: Please read the FAQ and How to Request Help.
Post Reply