Page 1 of 1
AMC Add a new --command -> mkvalidator
Posted: 20 Jun 2014, 19:01
by Untoter
Hi,
i wish to add a new --command to AMC. in about every 10th episode i have a broken file and this i want to log.
with my Script
Code: Select all
#!/bin/bash
mkvalidator --quiet "$1"
RETVAL=$?
[ $RETVAL -eq 0 ] && echo Success
[ $RETVAL -ne 0 ] && echo Failure
i can verify the mkv. With an edit Avi“s too.
but how can i add this to AMC? is -exec= what iam looking for?
sample output with a broken file
Code: Select all
root@localhost:/tank/media/incoming# mkvverify amovie.mkv
ERR042: The segment's size 9336935136 doesn't match the position where it ends 2043332978
ERR066: The SeekPoint at 87 references an unknown Cues at 9336892310
WRN800: The segment has Clusters but no Cues section (bad for seeking)
WRN0B8: Track #4 is defined but has no frame
WRN0D0: There are 5306 bytes of void data
Failure
Re: AMC Add a new --command -> mkvalidator
Posted: 20 Jun 2014, 19:24
by rednoah
Yep, exec is probably what you're looking for.
Re: AMC Add a new --command -> mkvalidator
Posted: 20 Jun 2014, 20:02
by Untoter
how can i pass the path + (renamed)filename to my script?
like
Code: Select all
Working on
ERR003: EBML head not found! Are you sure it's a matroska/webm file?
Failure
with this script
Code: Select all
#!/bin/bash
echo Working on "$1"
mkvalidator --quiet "$1"
RETVAL=$?
[ $RETVAL -eq 0 ] && echo Success
[ $RETVAL -ne 0 ] && echo Failure
if [ $RETVAL -ne 0 ]
then
mv "$1" /tank/media/incoming/failure
fi
Re: AMC Add a new --command -> mkvalidator
Posted: 21 Jun 2014, 07:29
by rednoah
Same as the format:
e.g.
echo '{file}'
And don't forget to escape arguments correctly.
Re: AMC Add a new --command -> mkvalidator
Posted: 21 Jun 2014, 07:38
by Untoter
Hey
Even when i Start filebot from commandline? Not from utorrent.
Re: AMC Add a new --command -> mkvalidator
Posted: 21 Jun 2014, 08:00
by rednoah
Last statement doesn't make sense to me. Utorrent does call cmdline filebot same as you would.
Think of exec like format. You define an expression that evaluates to a String. In the format it'll be a path. In exec it'll be a cmdline call.
Re: AMC Add a new --command -> mkvalidator
Posted: 13 Jul 2014, 09:10
by Untoter
i tried this
filebot --lang de -script /usr/bin/amc.groovy --output "/tank/media" \
--action move \
-non-strict \
"/tank/media/incoming/Serien" \
--def excludeList=amc.txt \
--conflict auto \
--def extras=y \
--def artwork=y \
--def unsorted=y \
--def xbmc=Ulla,Ulf \
--def clean=y \
--def exec='echo {file}'
and
--def exec=echo '{file}'
this does not work. i dont see the filename anyhwere.
Re: AMC Add a new --command -> mkvalidator
Posted: 13 Jul 2014, 09:42
by rednoah
The syntax is
--def name=value where
--def is 1 argument and
name=value is 1 argument. Consequently if value contains spaces you need to quote "name=value" and since {file} may contains spaces it also needs to quoted.
FileBot even shows you the command template you're passing in:
Which results in calls like:
Code: Select all
echo '/path/to/file with maybe some spaces'
Re: AMC Add a new --command -> mkvalidator
Posted: 13 Jul 2014, 09:45
by Untoter
works
thx
Code: Select all
#!/bin/bash
echo Working on "$1"
mkvalidator --quiet "$1"
RETVAL=$?
[ $RETVAL -eq 0 ] && echo Success
[ $RETVAL -ne 0 ] && echo Failure
if [ $RETVAL -ne 0 ]
then
mv "$1" /tank/media/incoming/failure
fi
this plus the commandoption above will add u a mkv validation.