✨ Get video title from file name

This commit is contained in:
chaoqun committed 2024-06-30 22:51:54 +08:00
1 parent 44b2c5ebf3
commit fc1769e8f7
3 files changed
+11 -1

No files matched your search

+7
View File
@@ -6,6 +6,7 @@ import (
"encoding/json"
"fmt"
"os/exec"
"path/filepath"
"runtime"
"gopkg.in/yaml.v3"
@@ -43,3 +44,9 @@ func RandomStage() string {
state := base64.URLEncoding.EncodeToString(b)
return state
}
func GetFileName(file string) string {
base := filepath.Base(file)
fileName := base[:len(base)-len(filepath.Ext(base))]
return fileName
}