You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
858 B
Bash

ROOTPATH="/var/www/nextcloud/data/grayhook/files/"
INDIR="Torrents"
OUTDIR="Archive/Anime"
#ORIGNAME="[Beatrice-Raws] Re.Zero - 2nd Season [BDRip 1080p HEVC TrueHD]"
ORIGNAME="[Beatrice-Raws] Re.Zero - 2nd Season - Part 2 [BDRip 1080p x265 Dolby TrueHD]"
NAME="Re ZERO Starting Life in Another World"
OUTPUTPATH="${ROOTPATH}/${OUTDIR}/${NAME}"
INPUTPATH="${ROOTPATH}/${INDIR}/${ORIGNAME}"
[ -e "${ROOTPATH}/${OUTDIR}/${NAME}" ] || exit -1;
paste -d '\n' \
<(find "$INPUTPATH" -maxdepth 1 -name '*.mkv' | sort) \
<(find "$INPUTPATH/Sounds/Crunchyroll" -name '*.mka' | sort) \
<(find "$INPUTPATH" -maxdepth 1 -name '*.mkv' | sort | \
sed -e "s/.* \([0-9]\{2\}\) .*/${OUTPUTPATH//\//\\\/}\/${NAME} s02e\1.mkv/g") | \
xargs -d '\n' printf '"%s" "%s" "%s"\n' | \
xargs -n 3 \
ffmpeg_add_audio_into_video \
;