Advertisement
Guest User

Jellyposter + Language Tags

a guest
Feb 28th, 2023
1,130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.49 KB | Source Code | 0 0
  1. #!/bin/bash
  2. while true
  3. do
  4. cd /mnt_data/media/movies
  5. for dir in */; do
  6. cd /mnt_data/media/movies/"$dir"
  7. pwd
  8.  
  9. flink=$(readlink -f poster.jpg)
  10. creatortool=$( exiftool -f -s3 -"creatortool" "$flink" )
  11.  
  12. if [ "${creatortool}" != "99333" ]; then
  13. mlink=$(readlink -f *.mkv)
  14. langs=$( ffprobe "$mlink" -show_entries stream=index:stream_tags=language -select_streams a -v 0 -of json=c=1 | jq --raw-out>
  15. nlink=$(readlink -f *.nfo)
  16. GER='ger'
  17. DUT='dut'
  18.  
  19. case $langs in
  20.  
  21.   *"$DUT"*)
  22.     widthposter=$( exiftool -f -s3 -"ImageWidth" "$flink" )
  23.         convert /mnt_data/media/dut_overlay.png -resize "$widthposter" /mnt_data/media/dut_overlay_tmp.png
  24.         convert  "$flink"  /mnt_data/media/dut_overlay_tmp.png -flatten  "$flink"
  25.         chmod +644 "$flink"
  26.         chown nobody "$flink"
  27.         exiftool -creatortool="99333" -overwrite_original "$flink"
  28.         sed -i.bak '$ i\<tag>00_Dutch_Language</tag>' "$nlink"
  29.         echo "Dutch movie detected"
  30.     ;;
  31.  
  32.   *"$GER"*)
  33.     widthposter=$( exiftool -f -s3 -"ImageWidth" "$flink" )
  34.         convert /mnt_data/media/ger_overlay.png -resize "$widthposter" /mnt_data/media/ger_overlay_tmp.png
  35.         convert  "$flink"  /mnt_data/media/ger_overlay_tmp.png -flatten  "$flink"
  36.         chmod +644 "$flink"
  37.         chown nobody "$flink"
  38.         exiftool -creatortool="99333" -overwrite_original "$flink"
  39.         sed -i.bak '$ i\<tag>00_German_Language</tag>' "$nlink"
  40.         echo "German movie detected"
  41.     ;;
  42. esac
  43.  
  44.  
  45. fi
  46. done
  47. sleep 90000
  48. done
  49.  
  50.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement