Skip to content
This repository has been archived by the owner on Oct 6, 2024. It is now read-only.

Commit

Permalink
api: Fixed apiconv to save mp3 file.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nyah Check committed Sep 27, 2017
1 parent d8c0fe1 commit 0ddafea
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions api/apiconv.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ import (
//flv if otherwise specified and downloads to system
func ApiConvertVideo(file, id, format string, bitrate uint, decVideo []string) error {
cmd := exec.Command("ffmpeg", "-i", "-", "-ab", fmt.Sprintf("%dk", bitrate), file)
/* if err := os.MkdirAll(filepath.Dir(file), 666); err != nil {
if err := os.MkdirAll(filepath.Dir(file), 666); err != nil {
return err
}
out, err := os.Create(file)
if err != nil {
return err
} */
}

stdin, err := cmd.StdinPipe()
if err != nil {
Expand All @@ -46,7 +46,7 @@ func ApiConvertVideo(file, id, format string, bitrate uint, decVideo []string) e
cmd.Start()
//logrus.Infof("Downloading mp3 file to disk %s", file)
stdin.Write(buf.Bytes()) //download file.

out.Write(buf.Bytes())
return nil
}

Expand Down

0 comments on commit 0ddafea

Please sign in to comment.