Roc 5 mesi fa
parent
commit
bfc1498ec8
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      utils/common.go

+ 1 - 1
utils/common.go

@@ -545,7 +545,7 @@ func Sha1(data string) string {
 }
 
 func GetVideoPlaySeconds(videoPath string) (playSeconds float64, err error) {
-	cmd := `ffmpeg -i ` + videoPath + `  2>&1 | grep 'Duration' | cut -d ' ' -f 4 | sed s/,//`
+	cmd := fmt.Sprintf(`ffmpeg -i %s  2>&1 | grep 'Duration' | cut -d ' ' -f 4 | sed s/,//`, videoPath)
 	out, err := exec.Command("bash", "-c", cmd).Output()
 	if err != nil {
 		return