-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add support for multi-connection downloads via aria2c #2312
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
lib/core.ps1
Outdated
} | ||
|
||
# global path to executable | ||
$aria2 = "$(versiondir 'aria2' 'current' $false)\aria2c.exe" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the same as line 97. Shouldn’t $false
be $true
here?
$has_downloads = $false | ||
|
||
# aria2 options | ||
$options = @( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Users may want to tweak these defaults. Let’s add a config setting eventually.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we use Scoops config settings or use a custom aria2.conf
? Should we allow aria2 to load the config file from HOME
or disable it with --no-conf
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good questions. I would say allow aria2 to use its default config file ($HOME/.aria2/aria2.conf
or $XDG_CONFIG_HOME/aria2/aria2.conf
if not found, $XDG_CONFIG_HOME
defaults to $HOME/.config
, see https://github.com/aria2/aria2/blob/e0a827ff98e665a118e2001dfe29b14847a33070/src/util.cc#L1808 )
In addition, perhaps we have a config setting, say aria2_options
, to define scoop specific options?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The desire behaviour must be scoop config taking precedence over aria2.conf. Maybe via script merge aria2.conf with scoop config and create new config file to get this behaviour. Things like number of pieces of downloads should be exposed on root of scoop config.
Thx
lib/install.ps1
Outdated
return | ||
} | ||
Write-Host $prefix -NoNewline | ||
if($_.EndsWith('download completed.')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will fail if aria2’s language isn’t English.
Error report:
|
@Jas99 that is actually a problem with dbeaver. dbeaver.jkiss.org redirects to dbeaver.io and causes a 400 Bad Request with aria2. Changing the URL to dbeaver.io works. (fixed in ScoopInstaller/Extras@b227cd2) |
It sure doesn’t jump out in the error message it’s a 400 error, does it? |
New scoop settings (prepend
|
@r15ch13 Looks great! We may want to eventually add an
|
@rasa like this? 😄 |
@r15ch13 Lgtm! |
@r15ch13 Good job. Thanks. Can a user specify a proxy for each app? For example,
A global proxy is not suitable for each situation. Some apps need not proxy. |
@yqu212 this is not even supported by the current installation process. This is something for another feature i guess. 😄 |
@r15ch13 Ok. I see. By the way, when will this pull request be merged into the master branch? |
This is great, I do miss the wget-style |
Did this end up going in? Just noticed some of the appveyor tests failed Sent with GitHawk |
Is this going in soon ? |
Currently, I don't have the time and information I need to implement the Proxy part of this. It would be great If someone could test this with different proxy settings. 😄 |
@r15ch13 I have tested with nginx (no Connect support, so all tls connections fail), and with squid (with connect support), and it's working great!
squid logs:
nginx logs:
|
sourceforge is broken though, both with and without proxy defined:
Manually downloading it with aria2 works, and gives the correct checksum. I have tested with multiple sourceforge projects, they all get checksum errors with aria2 when running |
lib/install.ps1
Outdated
$has_downloads = $true | ||
# create aria2 input file content | ||
$urlstxt_content += "$url`n" | ||
$urlstxt_content += " referer=$(strip_filename $url)`n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To fix sourceforge checksum errors:
if(!(test-path $data.$url.source)) {
$has_downloads = $true
# create aria2 input file content
$urlstxt_content += "$url`n"
if (-not ($url -imatch "//downloads.sourceforge.net/")) {
$urlstxt_content += " referer=$(strip_filename $url)`n"
}
$urlstxt_content += " dir=$cachedir`n"
$urlstxt_content += " out=$($data.$url.cachename)`n"
} else {
@se35710 can you provide your proxy settings for nginx/squid so I can test this? Or should I merge this and fix the proxy stuff later? 😁 |
@r15ch13 Here they are: 😃 nginx:
and squid.conf:
|
This change adds support for multi-connection downloads via aria2c. (requested in #2306)
Scoop will use aria2 by default if it's installed locally or globally to speed all downloads.
scoop config enable_aria2 false
)The output changes from the previous progress bar to simply writing the aria2 output.
still image
Use the following command for constant tests:
.\bin\scoop.ps1 uninstall godot; .\bin\scoop.ps1 cache rm godot; .\bin\scoop.ps1 install godot