From 26a2898ccd6a77e6172c9857595fe331fced6c9a Mon Sep 17 00:00:00 2001 From: SXYAZI Date: Sat, 16 Feb 2019 20:12:56 +0800 Subject: [PATCH] fix download file name of aria2 rpc (#383) [ci skip] --- downloader/downloader.go | 1 + downloader/types.go | 2 ++ 2 files changed, 3 insertions(+) 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"` }