discord-exploits/modules/transcode.go
Schmenn cee058edea small fixes
[^] /exploits | removed ioutil as it is deprecated
[^] /modules/transcode.go | removed annoying ffmpeg output
[^] go.mod | changed to go 1.16
[^] exploits.go | removed comment
2021-03-23 12:45:20 +01:00

31 lines
690 B
Go

package modules
import (
"fmt"
"os/exec"
"strings"
)
//Transcode transcodes videos and images
func Transcode(input string, to string) string {
path := CheckForFFmpeg()
output := CreateName(to)
if strings.HasSuffix(input, ".ogg") || strings.HasSuffix(input, ".mp3") || strings.HasSuffix(input, ".m4a") {
_, err := exec.Command(path, "-i", input, "-ar", "44100", "-y", "-c:a", "libvorbis", output).CombinedOutput()
Check(err)
fmt.Println("temporarily saving transcoded file to " + output)
return output
}
_, err := exec.Command(path, "-i", input, output).CombinedOutput()
Check(err)
fmt.Println("temporarily saving transcoded file to " + output)
return output
}