To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit 7baf0e63 authored by Christof Gerber's avatar Christof Gerber
Browse files

Fix bug that caused that in every case the .vtt format of the subtitle is downloaded

parent e3ae2832
......@@ -54,7 +54,7 @@ func (e ErrYoutubeDL) Error() string {
func runYoutubeDL(args []string) (output []byte, err error) {
cmd := exec.Command("youtube-dl", args...)
log.Trace(args)
log.Info(args)
output, err = cmd.CombinedOutput()
log.Trace(string(output))
if err != nil {
......@@ -250,9 +250,9 @@ func GetSubtitle(auto bool, id string, language string) (sub *astisub.Subtitles,
continue
}
filename := filepath.Join("/tmp", "sub-"+id)
file := filename + "." + language + "." + SubVTT.String()
file := filename + "." + language + "." + format
err := downloadSubtitle(auto, id, language, SubVTT.String(), filename)
err := downloadSubtitle(auto, id, language, format, filename)
defer os.Remove(file)
if err != nil {
log.Warn(err)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment