Эх сурвалжийг харах

fix:移除音频市场获取命令

Roc 3 сар өмнө
parent
commit
19138dce41
1 өөрчлөгдсөн 0 нэмэгдсэн , 34 устгасан
  1. 0 34
      utils/common.go

+ 0 - 34
utils/common.go

@@ -18,7 +18,6 @@ import (
 	"net"
 	"net/http"
 	"os"
-	"os/exec"
 	"path"
 	"regexp"
 	"runtime"
@@ -509,39 +508,6 @@ func Sha1(data string) string {
 	return hex.EncodeToString(sha1.Sum([]byte("")))
 }
 
-func GetVideoPlaySeconds(videoPath string) (playSeconds float64, err error) {
-	cmd := `ffmpeg -i ` + videoPath + `  2>&1 | grep 'Duration' | cut -d ' ' -f 4 | sed s/,//`
-	out, err := exec.Command("bash", "-c", cmd).Output()
-	if err != nil {
-		return
-	}
-	outTimes := string(out)
-	fmt.Println("outTimes:", outTimes)
-	if outTimes != "" {
-		timeArr := strings.Split(outTimes, ":")
-		h := timeArr[0]
-		m := timeArr[1]
-		s := timeArr[2]
-		hInt, err := strconv.Atoi(h)
-		if err != nil {
-			return playSeconds, err
-		}
-
-		mInt, err := strconv.Atoi(m)
-		if err != nil {
-			return playSeconds, err
-		}
-		s = strings.Trim(s, " ")
-		s = strings.Trim(s, "\n")
-		sInt, err := strconv.ParseFloat(s, 64)
-		if err != nil {
-			return playSeconds, err
-		}
-		playSeconds = float64(hInt)*3600 + float64(mInt)*60 + float64(sInt)
-	}
-	return
-}
-
 func GetMaxTradeCode(tradeCode string) (maxTradeCode string, err error) {
 	tradeCode = strings.Replace(tradeCode, "W", "", -1)
 	tradeCode = strings.Trim(tradeCode, " ")