Skip to content

Instantly share code, notes, and snippets.

@lukekrikorian
Last active June 3, 2021 01:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lukekrikorian/39b071f64eabfc336d6974075150352b to your computer and use it in GitHub Desktop.
Save lukekrikorian/39b071f64eabfc336d6974075150352b to your computer and use it in GitHub Desktop.
Rename yts.mx films
# requires GNU `rename`
rename 's/(.x264|.BluRay|.720p|.1080p|.2160p|.YIFY|.AAC^5|.AAC5\.1|.BrRip|.WEBRip|.VPPV|.BOKUTOX|\-\[YTS..{2}\])//g' *.mp4
rename 's/\.([^mp4])/ $1/g' *.mp4
if [ "$1" == "--remove-years" ]; then
rename 's/ \d{4}(\.mp4)/$1/' *.mp4
fi
echo "Done!"
# Example: PVT.CHAT.2020.1080p.BluRay.x264.AAC5.1-[YTS.MX].
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment