Last active
August 12, 2020 20:54
-
-
Save ddimick/d165c090e458b035e0f0eb89f775c073 to your computer and use it in GitHub Desktop.
One-liner to run ffsubsync against all media files in directory.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# assumes .mkv media format and existing subtitles end in .en.srt | |
for f in ./*.mkv; do media=$(basename -s .mkv ${f}); $(ffs ${media}.mkv -i ${media}.en.srt --overwrite-input); done | |
# improved version that handles directory recursion | |
find . -type f -name '*.mkv' -print0 | while IFS= read -r -d '' file; do episode=$(echo -en ${file} | sed 's/\.[^.]*$//'); echo -en ${episode}; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment