mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-18 22:33:42 +00:00
feat: cli
This commit is contained in:
1 parent
caf9bf265b
commit
359f28bb1f
12 files changed
+209
-97
No files matched your search
@@ -16,6 +16,7 @@ import (
|
||||
"path"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -117,8 +118,8 @@ func (f *Fetcher) Resolve(req *base.Request) (*base.Resource, error) {
|
||||
}
|
||||
}
|
||||
// Get file filename by URL
|
||||
if file.Name == "" {
|
||||
file.Name = path.Base(req.URL)
|
||||
if file.Name == "" && strings.Count(req.URL, "/") > 2 {
|
||||
file.Name = filepath.Base(req.URL)
|
||||
}
|
||||
// unknown file filename
|
||||
if file.Name == "" {
|
||||
|
||||
Reference in new issue
Block a user