Last active
February 12, 2018 09:36
-
-
Save kyawkyawsoezhu/89aabbbe17f38368ee19a0990380a450 to your computer and use it in GitHub Desktop.
an example of soft code subtitle and rename video using `mkvmerge` and `filebot`
This file contains 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 | |
outputPath="/home/kyawkyawsoezhu/Desktop/Outputs" | |
basePath="/home/kyawkyawsoezhu/Desktop/Downloads" | |
videoPath=(${basePath}/*/*.mkv) | |
mmSubtitlePath=(${basePath}/*/mmsub/*.srt) | |
engSubtitlePath=(${basePath}/*/engsub/*.srt) | |
index=0 | |
for episode in ${videoPath[*]} | |
do | |
destination="${outputPath}/${episode##*/}" | |
mmsub=${mmSubtitlePath[${index}]} | |
engsub=${engSubtitlePath[${index}]} | |
mkvmerge -o "$destination" "$episode" --language 0:eng "$engsub" --language 0:bur "$mmsub" | |
let index=${index}+1 | |
done | |
format="{n}/{'Season '+s}/{n} - {s00e00} - {t}" | |
query="Game Of Thrones" | |
filebot -rename ${outputPath[*]} --q "$query" --format "$format" --db TheTVDB |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment