Last active
May 13, 2020 20:00
-
-
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
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
#!/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