Gfy

srr.sh

Gfy
Jan 22nd, 2012
87
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2.  
  3. #$srr and $srs have to be set
  4.  
  5. cwd="$(pwd)"
  6. #cleanup
  7. find . -regextype posix-extended -iregex '.*\.(srs|srr)' -exec rm {} \;
  8. nfo=$(ls *.nfo 2> /dev/null)
  9. #removing shitty thumbnails added by some sites
  10. rm -f ${nfo%.nfo}.jpg
  11.  
  12. cd "$(find -L . -regextype posix-extended -iregex '.*\.(mkv|avi)' -exec dirname {} \; | tail -n 1)"
  13. $srs "$(find . -iname  '*.avi' -or -iname '*.mkv' | tail -n 1)"
  14. cd "$cwd"
  15. $srr $(find . -iname '*.sfv' -and -not -iname '*subs.sfv' | paste -s -d' ') -d -p \
  16. -s $(find -L . -iname '*.srs' -or -iname '*.nfo' -or -iname '*.jpg' -or -iname '*.png' -or -iname '*subs.sfv' | paste -s -d' ') || exit 1
RAW Paste Data