I figured the least I could do would be to share my script. I thought I would post my bash amc.groovy startup script. It includes a couple of other features not included in the FileBot amc.groovy script. I really can't take credit for any of the scripting additions as I am a complete Linux newbie. i simply modified bash code I found at other sites online. So, i am really not competent to answer any detailed scripting questions. i just figured I would share, in the hope it might benefit someone looking for these added features.
#Line 2 - renames original nfo file to .info, so that the source information can be retained (not over-written) when .nfo file is scraped.
#Lines 3-16 This script joins all multipart avi files that are named cd1, cd2, CD1, CD2. Many avi movies downloaded from the newsgroups are slpit into 700MB sizes. It uses avimerge from the transcode package included in many Linux distros to automagically merge split avi files.
#Line 17 FileBot amc.groovy script paramaters to rename and download all movie and tv pics,nfo's, and subs. Scaped media is moved to respective Movie & TV folders when completed.
I run this script as my default post proccessing script with Sabnzbd for movies and TV series dowloaded from Newsgroups. I simply start the script manually for post processing torrents that i have downloaded. i prefer to use the Tixati bittorent client. Tixati does not include an option to automatically launch a post process script after torrent completion.
Any comments, or suggestions for script improvement appreciated:
Code: Select all
#!/bin/bash
find "/home/big_guy/Downloads/Media/" . -name "*.nfo" -exec bash -c 'mv "$1" "$(sed "s/\.nfo$/.info/" <<< "$1")"' - '{}' \; ;
for FIRST in ./*.cd1.avi; do
NAME=$(basename "$FIRST" .cd1.avi)
REST=("./$NAME".cd[^1].avi)
avimerge -o "$NAME.avi" -i "$FIRST" "${REST[@]/#}"
rm "$FIRST"
rm "${REST[@]/#}"
done ;
for FIRST in ./*.CD1.avi; do
NAME=$(basename "$FIRST" .CD1.avi)
REST=("./$NAME".CD[^1].avi)
avimerge -o "$NAME.avi" -i "$FIRST" "${REST[@]/#}"
rm "$FIRST"
rm "${REST[@]/#}"
done ;
java -jar /home/big_guy/FileBot/FileBot.jar -script fn:amc --output "/home/big_guy/Downloads/Scraped/" --action move -non-strict "/home/big_guy/Downloads/Media/" --def music=y subtitles=en artwork=y extras=y unsorted=y minFileSize=0 minLengthMS=0 root=y clean=y --def root=y --def "ignore=[.](info)$"--def "exts=txt|jpg|jpeg|png|gif|xml|htm|html|log|md5|sfv|rtf|url|srv|srs|srr|nzb|par1|par2|sfv" "terms=sample|trailer"excludeList=amc.txt --def "movieFormat=Movies/{n} ({y})/{n} ({y}){'.cd'+pi}" --def "seriesFormat=TV/{n}/{n} - Season {s}/{n} - {S00E00} - {t}"
#Line 1 - Bash Shebang - do not alter
#Line 2 - renames original nfo file to .info, so that the source information can be retained (not over-written). This line cane be removed if this feature is unwanted.
#Lines 3-16 This script joins all multipart avi files that are named cd1, cd2, CD1, CD2. It uses avimerge from the transcode package included in many Linux distros to merge split avi files.
#Line 17 FileBot amc.groovy script paramaters to rename and download all movie and tv pics,nfo's, and subs. Scaped media is moved to respective Movie & TV folders when completed.
#Renames all movie subtitles that have "eng" suffix appended.
#java -jar /home/big_guy/FileBot/FileBot.jar -script fn:replace --def "e=.eng.srt" "r=.srt" /home/big_guy/Downloads/Scraped/Movies/
#Save script as amc.sh - make script executable with chmod +x in terminal