Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix download file name of aria2 rpc #383

Merged
merged 1 commit into from
Feb 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"`
}