Skip to content

Commit

Permalink
转换h265之前尝试翻译中文文件名
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangyiming748 committed Jul 29, 2024
1 parent df7b61e commit c88050d
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
4 changes: 4 additions & 0 deletions conv/h265.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"github.com/zhangyiming748/ConvertVideo/mediainfo"
"github.com/zhangyiming748/ConvertVideo/replace"
"github.com/zhangyiming748/ConvertVideo/util"
DeepLx "github.com/zhangyiming748/DeepLX"
"github.com/zhangyiming748/FastMediaInfo"
"log"
"os"
Expand Down Expand Up @@ -42,6 +43,9 @@ func ProcessVideo2H265(in mediainfo.BasicInfo) {
log.Println("创建输出文件夹")
}
dstPurgeName := replace.ForFileName(in.PurgeName) // 输入文件格式化后的新文件名
if dst, err := DeepLx.TranslateByDeepLX("auto", "zh", dstPurgeName, ""); err == nil {
dstPurgeName = dst
}
out := strings.Join([]string{in.PurgePath, string(os.PathSeparator), middle, string(os.PathSeparator), dstPurgeName, ".mp4"}, "")
defer func() {
if err := recover(); err != nil {
Expand Down
6 changes: 6 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,14 @@ require (
)

require (
github.com/abadojack/whatlanggo v1.0.1 // indirect
github.com/andybalholm/brotli v1.0.5 // indirect
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/tidwall/gjson v1.14.3 // indirect
github.com/tidwall/match v1.1.1 // indirect
github.com/tidwall/pretty v1.2.0 // indirect
github.com/zhangyiming748/DeepLX v0.0.1 // indirect
golang.org/x/sys v0.20.0 // indirect
golang.org/x/term v0.20.0 // indirect
)
12 changes: 12 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
github.com/abadojack/whatlanggo v1.0.1 h1:19N6YogDnf71CTHm3Mp2qhYfkRdyvbgwWdd2EPxJRG4=
github.com/abadojack/whatlanggo v1.0.1/go.mod h1:66WiQbSbJBIlOZMsvbKe5m6pzQovxCH9B/K8tQB2uoc=
github.com/andybalholm/brotli v1.0.5 h1:8uQZIdzKmjc/iuPu7O2ioW48L81FgatrcpfFmiq/cCs=
github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand All @@ -14,6 +18,14 @@ github.com/schollz/progressbar/v3 v3.14.4/go.mod h1:aT3UQ7yGm+2ZjeXPqsjTenwL3ddU
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/tidwall/gjson v1.14.3 h1:9jvXn7olKEHU1S9vwoMGliaT8jq1vJ7IH/n9zD9Dnlw=
github.com/tidwall/gjson v1.14.3/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA=
github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM=
github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs=
github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=
github.com/zhangyiming748/DeepLX v0.0.1 h1:47aylhK4XPRLn6JIu5XUwMGUKjz6n6jfZFUqaQSeyZM=
github.com/zhangyiming748/DeepLX v0.0.1/go.mod h1:zzEiUciBGmqfsMaY+hEZ8tGrV143+E4jLmWNNIZIQHE=
github.com/zhangyiming748/FastMediaInfo v0.0.2 h1:/gosvDwCcO5tIb4jWyq7nZZiN0ejzWOStnnmlUD0t/Y=
github.com/zhangyiming748/FastMediaInfo v0.0.2/go.mod h1:vO7MyXVTh/P4DRIuBdFXP14kV5J54Jqemem+xtsC3HI=
github.com/zhangyiming748/lumberjack v0.0.1 h1:/r1XMBfGVZ/ZrRU56vl0aKeVddidi3388ETLLCWxoW4=
Expand Down

0 comments on commit c88050d

Please sign in to comment.