Skip to content

Commit

Permalink
fix download file name of aria2 rpc (#383) [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
sxyazi authored and Xinzhao Xu committed Feb 16, 2019
1 parent 705ee1a commit 26a2898
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions downloader/downloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 2 additions & 0 deletions downloader/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}

0 comments on commit 26a2898

Please sign in to comment.