daily pastebin goal
49%
SHARE
TWEET

Untitled

a guest Feb 13th, 2018 45 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2.  
  3. dest="/path/to/dir"
  4. trsh=256
  5. IFS='|'
  6.  
  7. while read -r author title year bitrate; do
  8.     if [[ "$((bitrate/1000))" -lt $trsh ]]; then
  9.         echo "Bitrate is below $trsh Kbps"
  10.         exit 1
  11.     fi
  12.     mv "$1" "$dest/${author}-${title}-${year}.${1##*.}"
  13.  
  14. done < <(mediainfo --Inform="General;%Performer%|%Track%|%Recorded_Date%|%BitRate%" "$1")
RAW Paste Data
Top