Use new vtt to srt of needed

master v0.4
bel 2020-12-08 07:47:10 -07:00
parent eba8001ca0
commit c98a50c5ab
1 changed files with 9 additions and 1 deletions

View File

@ -48,7 +48,15 @@ func (c *Client) Download(video, local string) error {
err := fmt.Errorf("%v", errs)
return err
}
cmd := exec.Command("python3", "-m", "vtt_to_srt", path.Dir(local))
cmd := exec.Command(
"bash",
"-c",
fmt.Sprintf(
"true; python3 -m vtt_to_srt %q || python3 /usr/bin/vtt_to_srt.py %q",
path.Dir(local),
path.Dir(local),
),
)
out, err := cmd.CombinedOutput()
if err != nil {
err = fmt.Errorf("%v: %s", err, out)