diff --git a/identify.sh b/identify.sh index ce420bd..720945d 100755 --- a/identify.sh +++ b/identify.sh @@ -26,7 +26,7 @@ if [ $ID_FS_TYPE == "udf" ]; then elif (($ID_CDROM_MEDIA_TRACK_COUNT_AUDIO > 0 )); then echo "identified audio" >> $LOG - abcde + abcde -d $DEVNAME elif [ $ID_FS_TYPE == "iso9660" ]; then echo "identified data" >> $LOG diff --git a/notify.sh b/notify.sh index e2a6450..f334f68 100755 --- a/notify.sh +++ b/notify.sh @@ -9,6 +9,7 @@ MSG=$1 if [ -z "$PB_KEY" ]; then echo "Pushbullet notifications not enabled" >> $LOG else + echo "Sending Pushbullet notification" >> $LOG curl -s -u $PB_KEY: https://api.pushbullet.com/v2/pushes -d type=note -d title="Alert" -d body="$MSG" echo "Pushbullet notification sent" >> $LOG fi @@ -18,6 +19,7 @@ fi if [ -z "$IFTTT_KEY" ]; then echo "IFTTT notifications not enabled" >> $LOG else + echo "Sending IFTTT notification" >> $LOG curl -s -X POST -H "Content-Type: application/json" -d '{"value1":"'"$MSG"'"}' https://maker.ifttt.com/trigger/${IFTTT_EVENT}/with/key/${IFTTT_KEY} printf "\nIFTTT notification sent" >> $LOG fi diff --git a/video_rip.sh b/video_rip.sh index 4fe40ea..e635bc2 100755 --- a/video_rip.sh +++ b/video_rip.sh @@ -9,16 +9,25 @@ source /opt/arm/config echo "Ripping video ${ID_FS_LABEL} from ${DEVNAME}" >> $LOG TIMESTAMP=`date '+%Y%m%d_%H%M%S'`; DEST=${RAWPATH}/${ID_FS_LABEL}_${TIMESTAMP} + RIPSTART=$(date +%s); mkdir $DEST makemkvcon mkv dev:$DEVNAME all $DEST --minlength=$MINLENGTH -r + RIPEND=$(date +%s); + RIPSEC=$(($RIPEND-$RIPSTART)); + RIPTIME="$(($RIPSEC / 3600)) hours, $((($RIPSEC / 60) % 60)) minutes and $(($RIPSEC % 60)) seconds." + eject $DEVNAME - echo /opt/arm/notify.sh "\"Ripped: ${ID_FS_LABEL} completed from ${DEVNAME}\"" |at now + echo /opt/arm/notify.sh "\"Ripped: ${ID_FS_LABEL} completed from ${DEVNAME} in ${RIPTIME}\"" |at now + echo "STAT: ${ID_FS_LABEL} ripped in ${RIPTIME}" >> $LOG echo /opt/arm/video_transcode.sh $DEST $ID_FS_LABEL $TIMESTAMP | batch + echo "${ID_FS_LABEL} sent to transcoding queue..." >> $LOG + + } >> $LOG diff --git a/video_transcode.sh b/video_transcode.sh index fb319e2..4bfbffd 100755 --- a/video_transcode.sh +++ b/video_transcode.sh @@ -2,15 +2,11 @@ # Transcodes Video files using HandBrake and removes source files when done source /opt/arm/config -#SRC=/mnt/media/ARM/raw/ + SRC=$1 LABEL=$2 TIMESTAMP=$3 -#LOG=$4 -#DEST_EXT=mkv -#HANDBRAKE_CLI=HandBrakeCLI -#HB_PRESET="Normal" -#HB_PRESET="High Profile" +TRANSSTART=$(date +%s); echo "Start video transcoding script" >> $LOG @@ -25,7 +21,7 @@ echo "Start video transcoding script" >> $LOG echo "Transcoding file $FILE" >> $LOG - $HANDBRAKE_CLI -i $SRC/$FILE -o $DEST/$filename.$DEST_EXT --preset="$HB_PRESET" --subtitle scan -F 2> $LOG + $HANDBRAKE_CLI -i $SRC/$FILE -o $DEST/$filename.$DEST_EXT --preset="$HB_PRESET" --subtitle scan -F 2>> $LOG #TIMESTAMP=`date '+%Y_%m_%d__%H_%M_%S'`; #mv $SRC/$FILE $SRC/done/$TIMESTAMP.$FILE #mv $DEST/$FILE $DEST/done/$FILE @@ -35,5 +31,11 @@ echo "Start video transcoding script" >> $LOG rmdir $SRC -echo /opt/arm/notify.sh "\"Transcode: ${ID_FS_LABEL} complete.\"" |at now +TRANSEND=$(date +%s); +TRANSSEC=$(($TRANSEND-$TRANSSTART)); +TRANSTIME="$(($TRANSSEC / 3600)) hours, $((($TRANSSEC / 60) % 60)) minutes and $(($TRANSSEC % 60)) seconds." + +echo "STAT: ${ID_FS_LABEL} transcoded in ${TRANSTIME}" >> $LOG + +echo /opt/arm/notify.sh "\"Transcode: ${ID_FS_LABEL} completed in ${TRANSTIME}\"" |at now