diff --git a/downloader/downloader.go b/downloader/downloader.go index 90bb75eca..4c6cd2560 100644 --- a/downloader/downloader.go +++ b/downloader/downloader.go @@ -211,6 +211,7 @@ func Download(v Data, refer string) error { urls = append(urls, p.URL) } var inputs Aria2Input + inputs.Out = title + "." + data.URLs[0].Ext inputs.Header = append(inputs.Header, "Referer: "+refer) rpcData.Params[2] = &inputs for i := range urls { diff --git a/downloader/types.go b/downloader/types.go index d57e7ebe1..f39c7625f 100644 --- a/downloader/types.go +++ b/downloader/types.go @@ -136,6 +136,8 @@ type Aria2RPCData struct { // Aria2Input options for `aria2.addUri` // https://aria2.github.io/manual/en/html/aria2c.html#id3 type Aria2Input struct { + // The file name of the downloaded file + Out string `json:"out"` // For a simple download, only add headers Header []string `json:"header"` }