I'll correct, retry and let you know.
Managed to find a few different builds of mencoder - one required X11 libraries, the other needed rosetta - went for the lesser of two evils to get an intel-native one.
You rock dude.

Right, partially vindicated. (I think!)th3joker wrote: It's an error in your directory settings:
+ postproc_dest_folder='/Volumes/Downloads/Usebin/TV//Season /'
It has an extra / in it and an extra space after Season
+ postproc_dest_folder='/Volumes/Downloads/Usebin/TV/Season/'
Code: Select all
#!/bin/bash -x
# The script will post process TV and Movie files, it will join
# multiple .avi files and create ISO image from VIDEO_TS folders.
# If it's a TV Show the files are renamed using tvrenamer.pl to my chosen naming convention.
# It then transcodes the files using Handbrake's preset for iPads.
# The preset can be altered to use any of the Handbrake current presets.
# AtomicParsley then tags the file for iTunes if it's a TV Show.
# The transcoded file is then moved to a folder of your choice.
# I have a 'watched folder action' on that folder and my Mac Desktop sees the new file and adds it to itunes.
# Some locations below are hardcoded in this script
# All of the settings in this script which may vary from machine to machine are preceeded with:
# "##### The line below contains a user defined location setting"
# Search for the $ 'Dollar' signs and update the lines below them all to suit your system.
# There are 5 applications you need to install for this script to properly function
#
# 1) HandbrakeCLI (encodes the video for iPad)
# Download from: http://handbrake.fr/downloads.php
#
#
# 2) Mencoder (used for joining 2 AVI's)
# Download from: http://www.mplayerhq.hu/design7/dload.html#binaries
# Mencoder is one of the files in the MPlayer download
#
#
# 3) mkisofs (Tags Movies and TV Shows with info and cover art)
# Makes and ISO from your VIDEO_TS folders
#
#
# 4) tvrenamer.pl (Tags Movies with info and cover art)
# Written by: Robert Meerman ([email protected], ICQ# 37099562)
# Website: http://www.robmeerman.co.uk/coding/file_rename
#
#
# 5) Atomic Parsley (Tags Movies with info and cover art)
# Add TV Show tagging information for iTunes using AtomicParsley: http://atomicparsley.sourceforge.net/
# If you have the artwork for your TV Shows then this will also apply the image to the meta information for iTunes
# there's a user definable parameter for the folder where you store these.
#
# Sample option 'Ignore Samples' in Sabnzbd | Config | Switches, must be set to 'Do not download'
##### User definable locations
##### Transcoded file destination
##### The line below contains a user defined location setting, change to where you want your transcoded files to go.
movie_dest_folder="/Volumes/Downloads/Usebin/Movies/"
##### Original file destination
##### The line below contains a user defined location setting, change to where you want your processed files to go.
unwatched_dest_folder="/Volumes/Downloads/Usebin/Movies/"
##### TV Show artwork location if you have it
##### Files must be formatted to match the Show Name and have a jpg extension eg: "The West Wing.jpg"
##### The line below contains a user defined location setting, this is the folder where you store your TV Show artwork
movieartwork="/Users/james/Pictures/Artwork/"
##### Movie Preset transcoding options
##### The line below contains a user defined Handbrake preset.
##### Change the line 'movie_preset="iPad"' substitute "iPad" with another preset.
##### Preset options are:
##### 'Apple= Universal, iPod, iPhone, iPad, AppleTV, QuickTime, Legacy, AppleTV Legacy, iPhone Legacy, iPod Legacy'
##### 'Basic= Normal, Classic'
##### 'High Profile= Animation, Constant Quality Rate, Film, Television'
##### 'Gaming Consoles= PSP, PS3, Xbox 360'
movie_preset="iPad"
##### TV Show transcoded file destination
##### The line below contains a user defined location setting, change to where you want your transcoded files to go.
tv_dest_folder="/Volumes/Downloads/Usebin/TV/"
##### TV Show transcoded file destination where no TV Show information was found
##### The line below contains a user defined location setting, change to where you want your transcoded files to go.
dest_false=" - SE.m4v"
##### TV Show artwork location if you have it
##### Files must be formatted to match the Show Name and have a jpg extension eg: "The West Wing.jpg"
##### The line below contains a user defined location setting, this is the folder where you store your TV Show artwork
tvartwork="/Users/james/Pictures/Artwork/"
##### TV Show Preset transcoding options
##### Change the line 'tv_preset="iPad"' substitute "iPad" with another preset.
##### Preset options are:
##### 'Apple= Universal, iPod, iPhone, iPad, AppleTV, QuickTime, Legacy, AppleTV Legacy, iPhone Legacy, iPod Legacy'
##### 'Basic= Normal, Classic'
##### 'High Profile= Animation, Constant Quality Rate, Film, Television'
##### 'Gaming Consoles= PSP, PS3, Xbox 360'
##### The line below contains a user defined Handbrake preset.
tv_preset="iPad"
# SABnzbd output parameters
DIR=$1
NZB_FILE=$2
NAME=$3
NZB_ID=$4
CATEGORY=$5
GROUP=$6
STATUS=$7
# Fake SABnzbd parameters
# DIR="/media/Movies/0, New/Movie (2009)/"
# NZB_FILE="Movie (2009).nzb"
# NAME="Movie (2009)"
# NZB_ID=""
# CATEGORY="movies"
# GROUP="alt.binaries.teevee"
# STATUS="0"
####################
# Movie Processing #
####################
if [ $CATEGORY == "movies" ]; then
echo " - Processing as a Movie"
echo
# Stops error printing in loop if there are no video files in the folder
shopt -s nullglob
#===============================================================================
# Find Movie Artwork if in folder
cd "$DIR"
find . -type f -maxdepth 1 -name '*.jpg' -exec mv '{}' "$movieartwork$NAME.jpg" \;
#===============================================================================
# If VIDEO_TS will be converted to ISO image
cd "$DIR"
# Finding VIDEO_TS folder and files
if [[ -e $(find . \( ! -regex '.*/\..*' \) -type f -name "VIDEO_TS.IFO") ]]; then
IFO=$(find . \( ! -regex '.*/\..*' \) -type f -name "VIDEO_TS.IFO")
echo "folder/file: $IFO"
VIDEOTS=$(echo $IFO|sed 's/[vV][iI][dD][eE][oO][_][tT][sS][.][iI][fF][oO].*//g')
VIDEOTSROOT=$(echo $VIDEOTS|sed 's/[vV][iI][dD][eE][oO][_][tT][sS].*//g')
echo
echo "VIDEO_TS Found, converting to an ISO"
mkisofs -input-charset iso8859-1 -dvd-video -o "$DIR/$NAME.iso" "$VIDEOTSROOT" > /dev/null 2>&1
echo
echo " - Conversion to ISO complete"
echo
rm -R "$VIDEOTSROOT"
echo " - Deleted VIDEO_TS folder"
echo
fi
#===============================================================================
# Move all video files into the main processing folder
cd "$DIR"
# Finding files larger than 300MB for processing and delete files smaller than 30MB
find "$DIR" -size +307200k -exec mv {} "$DIR" \;
find "$DIR" -size -30720k -type f -exec rm {} \;
#===============================================================================
# if there are 2 AVI's join them
cd "$DIR"
# Finding multiple .AVI files
for i in *{CD2,cd2}.avi; do
echo " - 2 AVI files where found Joining them together:"
mencoder -forceidx -ovc copy -oac copy *{CD1,cd1}.avi *{CD2,cd2}.avi -o "$NAME.avi" > /dev/null 2>&1
echo " - Combine completed"
mkdir "Unjoined AVIs"
mv *{CD1,cd1}.avi "Unjoined AVIs/."
mv *{CD2,cd2}.avi "Unjoined AVIs/."
echo " - Old AVIs moved into 'Unjoined AVIs' folder"
echo
done
#===============================================================================
# Transcode with Handbrake to preset
cd "$DIR"
# Finding media files to convert
for i in *.mkv *.avi *.m4v *.mp4 *.wmv *.iso *.img; do
# Setting the variables for Destination File
movie_dest_file="${i%.*}"".m4v"
# Convert the source video file to a preset M4V file using HandBrake
HandBrakeCLI -i "$i" -o "$movie_dest_file" --preset="$movie_preset" > /dev/null 2>&1
echo
echo " - Conversion to m4v complete"
done
#===============================================================================
# Add Movie Show tagging information for iTunes using AtomicParsley: http://atomicparsley.sourceforge.net/
# If Artwork is available locally for the show then this tags the image
if [[ -e $(find "$movieartwork" -maxdepth 1 -name "$NAME.jpg") ]]; then
echo " - Adding Artwork for movie from Artwork folder"
AtomicParsley "$movie_dest_file" --genre "Movie" --stik "Movie" --artwork "$movieartwork$NAME.jpg" --overWrite > /dev/null 2>&1
fi
# Move converted file to Destination folder
mv "$movie_dest_file" "$movie_dest_folder"
echo
echo " - Converted m4v moved to folder for import iTunes"
# Move Unconverted files to Movie Library
mv "$i" "$unwatched_dest_folder"
echo
echo " - Original files moved to Movie Library"
# Delete extraneous files and VIDEO_TS folder
rm -R "$DIR"
echo
echo " - Original files moved to Movie Library"
# Post Processing as a Movie complete
echo
echo " - The Movie is in your iTunes library ready to sync to your iPad"
fi
#################
# TV Processing #
#################
if [ $CATEGORY == "tv" ]; then
echo
echo " - Processing as a TV Show"
echo
# Stops error printing in loop if there are no video files in the folder
shopt -s nullglob
#===============================================================================
# TV Shows Transcoding and Tagging
cd "$DIR"
# Use tvrenamer.pl to scrape the TV Episode name
tvrenamer.pl --unattended --gap=" - " --separator=" - " --pad=2 --include_series > /dev/null 2>&1
echo " - Renaming the file with tvrenamer.pl"
echo
# Regex expression parse Tag information from the filename
# This parses information from the Job Name for tagging and file naming
regex="^(.*) - ([[:digit:]]+)x([[:digit:]]+).* - (.*)$"
for i in *.mkv *.avi *.m4v *.mp4 *.wmv *.iso *.img; do
NAME=${i%.*}
if [[ $CATEGORY -eq "tv" && $NAME =~ $regex ]]; then
show_name=${BASH_REMATCH[1]}
season=${BASH_REMATCH[2]}
episode=${BASH_REMATCH[3]}
episode_name=${BASH_REMATCH[4]}
fi
# Setting the variables for Destination File and Folder
tv_dest_file=$show_name" - "$season"x"$episode" - "$episode_name".m4v"
#TV Show original file destination
#The line below contains a user defined location setting, change to where you want your processed files to go.
postproc_dest_folder="/Volumes/Downloads/Usebin/TV/$show_name/Season $season/"
# If there is already an M4V file stop
if [[ -e "$tv_dest_folder$tv_dest_file" ]]; then
echo " - An M4V with the same name already exisits,"
echo " - skipping $i"
continue
fi
# Convert the source video file to a preset M4V file using HandBrake
HandBrakeCLI -i "$i" -o "$tv_dest_file" --preset="$tv_preset" > /dev/null 2>&1
# Note the " > /dev/null 2>&1" at the end of the line directs output from HandBrakeCLI away from the script log
echo " - Transcoding the TV Show"
# If HandBrake did not exit gracefully, continue with next iteration
if [[ $? -ne 0 ]]; then
continue
fi
#===============================================================================
# TV Show Artwork
# Get artwork from epguides.com
epguidesartwork=$(echo $show_name|sed 's/ *//g')
wget http://epguides.com/$epguidesartwork/cast.jpg > /dev/null 2>&1
echo " - Retrieved Artwork from http://epguides.com"
# Add TV Show tagging information for iTunes using AtomicParsley: http://atomicparsley.sourceforge.net/
# If Artwork is available locally for the show then this tags the show info and image
if [[ -e $(find "$tvartwork" -maxdepth 1 -name "$show_name.jpg") ]]; then
echo " - Adding TV Show information and Artwork from Artwork folder"
AtomicParsley "$tv_dest_file" --genre "TV Shows" --stik "TV Show" --TVShowName "$show_name" --TVEpisode "$episode_name" --TVEpisodeNum "$episode" --TVSeason "$season" --artwork "$tvartwork$show_name.jpg" --overWrite > /dev/null 2>&1
# Add TV Show tagging information for iTunes using AtomicParsley: http://atomicparsley.sourceforge.net/
# If Artwork is available from epguides.com then this tags the show info and image
elif [[ -e $(find . -name "cast.jpg") ]]; then
echo " - Adding TV Show information and Artwork from epguides.com"
AtomicParsley "$tv_dest_file" --genre "TV Shows" --stik "TV Show" --TVShowName "$show_name" --TVEpisode "$episode_name" --TVEpisodeNum "$episode" --TVSeason "$season" --artwork "cast.jpg" --overWrite > /dev/null 2>&1
# Otherwise the tagging information minus the Artwork is added
else
echo " - Adding TV Show information to the file for iTunes"
AtomicParsley "$tv_dest_file" --genre "TV Shows" --stik "TV Show" --TVShowName "$show_name" --TVEpisode "$episode_name" --TVEpisodeNum "$episode" --TVSeason "$season" --overWrite > /dev/null 2>&1
echo " - Tag and rename completed"
fi
# Finding files and deleting any smaller than 30MB
find "$DIR" -size -30720k -type f -exec rm {} \;
echo
echo " - Deleted extraneous files"
# Move the transcoded file to a folder which has folder actions set to input the file into iTunes
mv "$tv_dest_file" "$tv_dest_folder"
echo
echo " - Moved transcoded file to folder for Applescript to add into iTunes library"
# Move the file to library for viewing in original format
#mkdir -p "$postproc_dest_folder"; mv "$i" "$postproc_dest_folder$i"
#echo
#echo " - Moved downloaded file to TV library for archive or viewing in original format"
# Post Processing for TV Show complete
echo
echo " - The TV Show is in your iTunes library ready to sync to your iPad."
done
fi
Code: Select all
+ NZB_FILE='Undercover Boss US S02E12 WS PDTV XviD 2HD.nzb'
+ NAME='Undercover Boss US S02E12 WS PDTV XviD 2HD'
+ NZB_ID=
+ CATEGORY=tv
+ GROUP=alt.binaries.multimedia
+ STATUS=0
+ '[' tv == movies ']'
+ '[' tv == tv ']'
+ echo
+ echo ' - Processing as a TV Show'
- Processing as a TV Show
+ echo
+ shopt -s nullglob
+ cd '/Volumes/Downloads/Usebin/TV/Undercover Boss Us/Season 2'
+ tvrenamer.pl --unattended '--gap= - ' '--separator= - ' --pad=2 --include_series
+ echo ' - Renaming the file with tvrenamer.pl'
- Renaming the file with tvrenamer.pl
+ echo
+ regex='^(.*) - ([[:digit:]]+)x([[:digit:]]+).* - (.*)$'
+ for i in '*.mkv' '*.avi' '*.m4v' '*.mp4' '*.wmv' '*.iso' '*.img'
+ NAME='Undercover Boss Us - 2x12 - WS PDTV XviD 2HD'
+ [[ tv -eq tv ]]
+ [[ Undercover Boss Us - 2x12 - WS PDTV XviD 2HD =~ ^(.*) - ([[:digit:]]+)x([[:digit:]]+).* - (.*)$ ]]
+ show_name='Undercover Boss Us'
+ season=2
+ episode=12
+ episode_name='WS PDTV XviD 2HD'
+ tv_dest_file='Undercover Boss Us - 2x12 - WS PDTV XviD 2HD.m4v'
Code: Select all
####################
# Processing file: Undercover Boss Us - 2x12 - WS PDTV XviD 2HD.m4v
# Detected series: Undercover Boss Us (season: 2, episode: 12)
####################
Old filename: Undercover Boss Us - 2x12 - WS PDTV XviD 2HD.m4v
New filename: Undercover Boss (US) - [02x12] - Norwegian Cruise Line.m4v
####################
# Done
Code: Select all
{
"always_rename": false,
"batch": true,
"custom_filename_character_blacklist": "",
"episode_separator": "-",
"episode_single": "%d",
"filename_patterns": [
"^\\[.+?\\][ ]? # group name\n (?P<seriesname>.*?)[ ]?[-_][ ]? # show name, padding, spaces?\n (?P<episodenumberstart>\\d+) # first episode number\n ([-_]\\d+)* # optional repeating episodes\n [-_](?P<episodenumberend>\\d+) # last episode number\n [^\\/]*$",
"^\\[.+?\\][ ]? # group name\n (?P<seriesname>.*) # show name\n [ ]?[-_][ ]?(?P<episodenumber>\\d+)\n [^\\/]*$",
"\n ^((?P<seriesname>.+?)[ \\._\\-])? # show name\n [Ss](?P<seasonnumber>[0-9]+) # s01\n [\\.\\- ]? # separator\n [Ee](?P<episodenumberstart>[0-9]+) # first e23\n ([\\.\\- ]+ # separator\n [Ss](?P=seasonnumber) # s01\n [\\.\\- ]? # separator\n [Ee][0-9]+)* # e24 etc (middle groups)\n ([\\.\\- ]+ # separator\n [Ss](?P=seasonnumber) # last s01\n [\\.\\- ]? # separator\n [Ee](?P<episodenumberend>[0-9]+)) # final episode number\n [^\\/]*$",
"\n ^((?P<seriesname>.+?)[ \\._\\-])? # show name\n [Ss](?P<seasonnumber>[0-9]+) # s01\n [\\.\\- ]? # separator\n [Ee](?P<episodenumberstart>[0-9]+) # first e23\n ([\\.\\- ]? # separator\n [Ee][0-9]+)* # e24e25 etc\n [\\.\\- ]?[Ee](?P<episodenumberend>[0-9]+) # final episode num\n [^\\/]*$",
"\n ^((?P<seriesname>.+?)[ \\._\\-])? # show name\n (?P<seasonnumber>[0-9]+) # first season number (1)\n [xX](?P<episodenumberstart>[0-9]+) # first episode (x23)\n ([ \\._\\-]+ # separator\n (?P=seasonnumber) # more season numbers (1)\n [xX][0-9]+)* # more episode numbers (x24)\n ([ \\._\\-]+ # separator\n (?P=seasonnumber) # last season number (1)\n [xX](?P<episodenumberend>[0-9]+)) # last episode number (x25)\n [^\\/]*$",
"\n ^((?P<seriesname>.+?)[ \\._\\-])? # show name\n (?P<seasonnumber>[0-9]+) # 1\n [xX](?P<episodenumberstart>[0-9]+) # first x23\n ([xX][0-9]+)* # x24x25 etc\n [xX](?P<episodenumberend>[0-9]+) # final episode num\n [^\\/]*$",
"\n ^((?P<seriesname>.+?)[ \\._\\-])? # show name\n [Ss](?P<seasonnumber>[0-9]+) # s01\n [\\.\\- ]? # separator\n [Ee](?P<episodenumberstart>[0-9]+) # first e23\n ( # -24 etc\n [\\-]\n [Ee]?[0-9]+\n )*\n [\\-] # separator\n [Ee]?(?P<episodenumberend>[0-9]+) # final episode num\n [\\.\\- ] # must have a separator (prevents s01e01-720p from being 720 episodes)\n [^\\/]*$",
"\n ^((?P<seriesname>.+?)[ \\._\\-])? # show name\n (?P<seasonnumber>[0-9]+) # 1\n [xX](?P<episodenumberstart>[0-9]+) # first x23\n ( # -24 etc\n [\\-][0-9]+\n )*\n [\\-] # separator\n (?P<episodenumberend>[0-9]+) # final episode num\n ([\\.\\- ].* # must have a separator (prevents 1x01-720p from being 720 episodes)\n |\n $)",
"^(?P<seriesname>.+?)[ \\._\\-] # show name and padding\n \\[ # [\n ?(?P<seasonnumber>[0-9]+) # season\n [xX] # x\n (?P<episodenumberstart>[0-9]+) # episode\n (- [0-9]+)*\n - # -\n (?P<episodenumberend>[0-9]+) # episode\n \\] # \\]\n [^\\/]*$",
"^(?P<seriesname>.+?)[ \\._\\-]\n [Ss](?P<seasonnumber>[0-9]{2})\n [\\.\\- ]?\n (?P<episodenumber>[0-9]{2})\n [^0-9]*$",
"^((?P<seriesname>.+?)[ \\._\\-])? # show name and padding\n \\[? # [ optional\n (?P<seasonnumber>[0-9]+) # season\n [xX] # x\n (?P<episodenumber>[0-9]+) # episode\n \\]? # ] optional\n [^\\/]*$",
"^((?P<seriesname>.+?)[ \\._\\-])?\n \\[?\n [Ss](?P<seasonnumber>[0-9]+)[\\.\\- ]?\n [Ee]?(?P<episodenumber>[0-9]+)\n \\]?\n [^\\/]*$",
"\n ^((?P<seriesname>.+?)[ \\._\\-])? # show name\n (?P<year>\\d{4}) # year\n [ \\._\\-] # separator\n (?P<month>\\d{2}) # month\n [ \\._\\-] # separator\n (?P<day>\\d{2}) # day\n [^\\/]*$",
"^(?P<seriesname>.+?)[ ]?[ \\._\\-][ ]?\n [Ss](?P<seasonnumber>[0-9]+)[\\.\\- ]?\n [Ee]?[ ]?(?P<episodenumber>[0-9]+)\n [^\\/]*$",
"\n (?P<seriesname>.+) # Showname\n [ ]-[ ] # -\n [Ee]pisode[ ]\\d+ # Episode 1234 (ignored)\n [ ]\n \\[ # [\n [sS][ ]?(?P<seasonnumber>\\d+) # s 12\n ([ ]|[ ]-[ ]|-) # space, or -\n ([eE]|[eE]p)[ ]?(?P<episodenumber>\\d+) # e or ep 12\n \\] # ]\n .*$ # rest of file\n ",
"^(?P<seriesname>.+?) # Show name\n [ \\._\\-] # Padding\n (?P<episodenumber>[0-9]+) # 2\n of # of\n [ \\._\\-]? # Padding\n \\d+ # 6\n ([\\._ -]|$|[^\\/]*$) # More padding, then anything\n ",
"^(?P<seriesname>.+)[ \\._\\-]\n (?P<seasonnumber>[0-9]{1})\n (?P<episodenumber>[0-9]{2})\n [\\._ -][^\\/]*$",
"^(?P<seriesname>.+)[ \\._\\-]\n (?P<seasonnumber>[0-9]{2})\n (?P<episodenumber>[0-9]{2,3})\n [\\._ -][^\\/]*$",
"^(?P<seriesname>.+?) # Show name\n [ \\._\\-] # Padding\n [Ee](?P<episodenumber>[0-9]+) # E123\n [\\._ -][^\\/]*$ # More padding, then anything\n "
],
"filename_with_date_and_episode": "%(seriesname)s - %(episode)s - %(episodename)s%(ext)s",
"filename_with_date_without_episode": "%(seriesname)s - %(episode)s%(ext)s",
"filename_with_episode": "%(seriesname)s - %(seasonno)dx%(episode)s - %(episodename)s%(ext)s",
"filename_with_episode_no_season": "%(seriesname)s - %(episode)s - %(episodename)s%(ext)s",
"filename_without_episode": "%(seriesname)s - %(seasonno)dx%(episode)s%(ext)s",
"filename_without_episode_no_season": "%(seriesname)s - %(episode)s%(ext)s",
"input_filename_replacements": [],
"language": "en",
"lowercase_filename": false,
"move_files_confirmation": true,
"move_files_destination": ".",
"move_files_enable": false,
"move_files_fullpath_replacements": [],
"multiep_join_name_with": ", ",
"normalize_unicode_filenames": false,
"output_filename_replacements": [],
"recursive": false,
"replace_invalid_characters_with": "_",
"search_all_languages": true,
"select_first": false,
"skip_file_on_error": true,
"valid_extensions": [],
"verbose": false,
"windows_safe_filenames": false
}
Code: Select all
+ shopt -s nullglob
+ cd '/Volumes/Downloads/Usebin/TV/Shaun the Sheep/Season 3'
+ tvnamer --config=/usr/bin/mytvnamerconfig.json '/Volumes/Downloads/Usebin/TV/Shaun the Sheep/Season 3'
Loading config: /usr/bin/mytvnamerconfig.json
####################
# Starting tvnamer
# Found 1 episode
####################
# Processing file: Shaun the Sheep - 3x8 - HDTV XviD aAF.avi
# Detected series: Shaun the Sheep (season: 3, episode: 8)
####################
Old filename: Shaun the Sheep - 3x8 - HDTV XviD aAF.avi
New filename: Shaun the Sheep - 3x8 - Bagpipe Buddy.avi
####################
# Done
+ echo ' - Renaming the file with tvrenamer.pl'
- Renaming the file with tvrenamer.pl
+ echo
+ regex='^(.*) - ([[:digit:]]+)x([[:digit:]]+).* - (.*)$'
+ for i in '*.mkv' '*.avi' '*.m4v' '*.mp4' '*.wmv' '*.iso' '*.img'
+ NAME='Shaun the Sheep - 3x8 - Bagpipe Buddy'
+ [[ tv -eq tv ]]
+ [[ Shaun the Sheep - 3x8 - Bagpipe Buddy =~ ^(.*) - ([[:digit:]]+)x([[:digit:]]+).* - (.*)$ ]]
+ show_name='Shaun the Sheep'
+ season=3
+ episode=8
+ episode_name='Bagpipe Buddy'
+ tv_dest_file='Shaun the Sheep - 3x8 - Bagpipe Buddy.m4v'
+ postproc_dest_folder='/Volumes/Downloads/Usebin/TV/Shaun the Sheep/Season 3/'
+ [[ -e /Volumes/Downloads/Usebin/TV/Shaun the Sheep - 3x8 - Bagpipe Buddy.m4v ]]
+ HandBrakeCLI -i 'Shaun the Sheep - 3x8 - Bagpipe Buddy.avi' -o 'Shaun the Sheep - 3x8 - Bagpipe Buddy.m4v' '' '-f mp4 -Y 480 -e x264 -b 2048 -a 1 -E faac -6 stereo -R 48 -B 160 -D 0.0 -x ref=2:bframes=2:subq=6:mixed-refs=0:weightb=0:8x8dct=0:trellis=0 -v 1'
Invalid output format ( mp4 -Y 480 -e x264 -b 2048 -a 1 -E faac -6 stereo -R 48 -B 160 -D 0.0 -x ref=2:bframes=2:subq=6:mixed-refs=0:weightb=0:8x8dct=0:trellis=0 -v 1). Possible choices are mp4, m4v and mkv
.+ echo ' - Transcoding the TV Show'
- Transcoding the TV Show