feat: direct call download api by cgo

This commit is contained in:
liwei committed 2024-11-26 23:32:54 +08:00
1 parent 85fe92a378
commit 467ada5500
22 files changed
+1040 -709

No files matched your search

+1 -1
View File
@@ -332,7 +332,7 @@ func (f *Fetcher) doUpload(fromUpload bool) {
}
}
// Get torrent stats maybe panic, see https://github.com/anacrolix/torrent/issues/972
// get torrent stats maybe panic, see https://github.com/anacrolix/torrent/issues/972
func (f *Fetcher) torrentStats() torrent.TorrentStats {
defer func() {
if r := recover(); r != nil {
+2 -2
View File
@@ -146,7 +146,7 @@ func (f *Fetcher) Resolve(req *base.Request) error {
file.Name = filename
}
}
// Get file filePath by URL
// get file filePath by URL
if file.Name == "" {
file.Name = path.Base(httpReq.URL.Path)
}
@@ -496,7 +496,7 @@ func (fm *FetcherManager) ParseName(u string) string {
if err != nil {
return ""
}
// Get filePath by URL
// get filePath by URL
name = path.Base(url.Path)
// If file name is empty, use host name
if name == "" || name == "/" || name == "." {