diff options
author | Keuin <[email protected]> | 2023-07-01 22:06:01 +0800 |
---|---|---|
committer | Keuin <[email protected]> | 2023-07-01 22:06:01 +0800 |
commit | 8f07f6f4d7e91a9e4b7164a39759907fac5fb8a1 (patch) | |
tree | 512d18cd6b2c1b442c6c03945bd1328d2866bcbc /recording | |
parent | 5aba05d7237c2250e647a717f8abef658f30a9e9 (diff) |
Refactor: encapsulate custom url manipulation function into object method.
Diffstat (limited to 'recording')
-rw-r--r-- | recording/runner.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/recording/runner.go b/recording/runner.go index 8f892fa..fe7aa21 100644 --- a/recording/runner.go +++ b/recording/runner.go @@ -12,6 +12,7 @@ import ( "fmt" "github.com/keuin/slbr/bilibili" "github.com/keuin/slbr/common" + "github.com/keuin/slbr/common/myurl" "github.com/keuin/slbr/logging" "github.com/samber/mo" "io" @@ -277,7 +278,7 @@ func record( var extName string // the real extension name (without renaming) - originalExtName := mo.TupleToResult(common.GetFileExtensionFromUrl(streamSource.URL)).OrElse("flv") + originalExtName := mo.TupleToResult(myurl.Url(streamSource.URL).FileExtension()).OrElse("flv") if task.Download.UseSpecialExtNameBeforeFinishing { extName = kSpecialExtName |