#!/usr/bin/env bash # Author: Travis Runyard (2023-ish) # # Renames subtitle files to match the media file name and designates English in the file suffix. # This is most common when downloading RARBG tv series/shows over Bittorrent. for f in *.mp4; do rename -v "s/2_eng/${f/.mp4/.en}/" ./Subs/"${f/.mp4/}"/2_eng.srt && mv -vn ./Subs/"${f/.mp4/}"/"${f/.mp4/.en.srt}" . ;done for f in *.mp4; do rename -v "s/3_eng/${f/.mp4/.sdh.en}/" ./Subs/"${f/.mp4/}"/3_eng.srt && mv -vn ./Subs/"${f/.mp4/}"/"${f/.mp4/.sdh.en.srt}" . ;done