Skip to content

Instantly share code, notes, and snippets.

@Kop3sh
Last active May 13, 2020 20:00
Show Gist options
  • Save Kop3sh/737ae9e0c908c25b810ba8e8d6d263aa to your computer and use it in GitHub Desktop.
Save Kop3sh/737ae9e0c908c25b810ba8e8d6d263aa to your computer and use it in GitHub Desktop.
match subtitle filenames to video filenames within the same dir to automatically add subs to mpv media player
#!/bin/bash
for videofile in ./*; do
for filename in ./*; do
if "${videofile}"(E|e)[\d]{2} == "${filename}"(E|e)[\d]{2}
# if both files have same Episode number
then
mv "${filename}" ("${videofile}"^[\w\d]+\. + "srt")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment