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

+2 -2
View File
@@ -256,7 +256,7 @@ func (d *Downloader) setupFetcher(fm fetcher.FetcherManager, fetcher fetcher.Fet
ctl.GetConfig = func(v any) {
d.getProtocolConfig(fm.Name(), v)
}
// Get proxy config, task request proxy config has higher priority, then use global proxy config
// get proxy config, task request proxy config has higher priority, then use global proxy config
ctl.GetProxy = func(requestProxy *base.RequestProxy) func(*gohttp.Request) (*url.URL, error) {
if requestProxy == nil {
return d.cfg.Proxy.ToHandler()
@@ -576,7 +576,7 @@ func (d *Downloader) deleteAll() (err error) {
return
}
func (d *Downloader) Stats(id string) (sr any, err error) {
func (d *Downloader) GetTaskStats(id string) (sr any, err error) {
task := d.GetTask(id)
if task == nil {
return sr, ErrTaskNotFound
+1 -1
View File
@@ -75,7 +75,7 @@ func (t *Task) Name() string {
return t.Meta.Res.Name
}
// Get the name of the first file
// get the name of the first file
return t.Meta.Res.Files[0].Name
}