Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- while true
- do
- cd /mnt_data/media/movies
- for dir in */; do
- cd /mnt_data/media/movies/"$dir"
- pwd
- flink=$(readlink -f poster.jpg)
- creatortool=$( exiftool -f -s3 -"creatortool" "$flink" )
- if [ "${creatortool}" != "99333" ]; then
- mlink=$(readlink -f *.mkv)
- langs=$( ffprobe "$mlink" -show_entries stream=index:stream_tags=language -select_streams a -v 0 -of json=c=1 | jq --raw-out>
- nlink=$(readlink -f *.nfo)
- GER='ger'
- DUT='dut'
- case $langs in
- *"$DUT"*)
- widthposter=$( exiftool -f -s3 -"ImageWidth" "$flink" )
- convert /mnt_data/media/dut_overlay.png -resize "$widthposter" /mnt_data/media/dut_overlay_tmp.png
- convert "$flink" /mnt_data/media/dut_overlay_tmp.png -flatten "$flink"
- chmod +644 "$flink"
- chown nobody "$flink"
- exiftool -creatortool="99333" -overwrite_original "$flink"
- sed -i.bak '$ i\<tag>00_Dutch_Language</tag>' "$nlink"
- echo "Dutch movie detected"
- ;;
- *"$GER"*)
- widthposter=$( exiftool -f -s3 -"ImageWidth" "$flink" )
- convert /mnt_data/media/ger_overlay.png -resize "$widthposter" /mnt_data/media/ger_overlay_tmp.png
- convert "$flink" /mnt_data/media/ger_overlay_tmp.png -flatten "$flink"
- chmod +644 "$flink"
- chown nobody "$flink"
- exiftool -creatortool="99333" -overwrite_original "$flink"
- sed -i.bak '$ i\<tag>00_German_Language</tag>' "$nlink"
- echo "German movie detected"
- ;;
- esac
- fi
- done
- sleep 90000
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement