Homebrew / legacy-homebrew

💀 The former home of Homebrew/homebrew (deprecated)
https://brew.sh
26.99k stars 11.36k forks source link

aria2 can't load cookies #35933

Closed yurikoles closed 9 years ago

yurikoles commented 9 years ago

aria2 from upstream can load cookies, but brewed one can't. Please fix it.

MikeMcQuaid commented 9 years ago

Please provide a step-by-step reproducible test case with what you expect to happen and what actually happens. Please also assume (correctly) we have never used this software before.

MikeMcQuaid commented 9 years ago

Please provide a step-by-step reproducible test case with what you expect to happen and what actually happens. Please also assume (correctly) we have never used this software before.

yurikoles commented 9 years ago

aria2c --help=#cookie

Options:
 --load-cookies=FILE          Load Cookies from FILE using the Firefox3 format
                              and Mozilla/Firefox(1.x/2.x)/Netscape format.
                              Possible Values: /path/to/file
                              Tags: #basic, #http, #cookie

Note from official site:

If aria2 is built without libsqlite3, then it doesn't support Firefox3 and Chromium/Google Chrome cookie format.

So, for example, one may want to download latest Xcode beta from Apple, but speed is very slow, so we log-in into Apple Developer portal with Apple ID in Firefox, and rung the following command in teminal:

aria2c http://adcdownload.apple.com//Developer_Tools/Xcode_6.2_beta_4/Xcode_6.2_beta_4.dmg --load-cookies=/Users/<usename>/Library/Application\ Support/Firefox/Profiles/<profileID>.default/cookies.sqlite -s16 -x16

Expected behavior: download of Xcode_6.2_beta_4.dmg in 16 threads (last 2 parameters) with session saved in Firefox cookie. Actual behavior: it fails with error. Reason: aria2 is built without sqlite3.

jacknagel commented 9 years ago

Actual behavior: it fails with error.

Can you post the actual error output?

Reason: aria2 is built without sqlite3.

I see:

$ otool -L $(which aria2c)
/usr/local/bin/aria2c:
    /usr/lib/libsqlite3.dylib (compatibility version 9.0.0, current version 168.0.0)
    /usr/lib/libxml2.2.dylib (compatibility version 10.0.0, current version 10.9.0)
    /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5)
    /System/Library/Frameworks/Security.framework/Versions/A/Security (compatibility version 1.0.0, current version 57031.1.35)
    /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1151.16.0)
    /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0)
yurikoles commented 9 years ago
aria2c http://adcdownload.apple.com//Mac_OS_X_Server/os_x_server_4.0.3/os_x_server_4.0.3.dmg --load-cookies=~/Library/Application\ Support/Firefox/Profiles/yp64xn87.default/cookies.sqlite

01/16 17:41:47 [ERROR] Failed to load cookies from ~/Library/Application Support/Firefox/Profiles/yp64xn87.default/cookies.sqlite

01/16 17:41:48 [ERROR] CUID#6 - Download aborted. URI=http://adcdownload.apple.com//Mac_OS_X_Server/os_x_server_4.0.3/os_x_server_4.0.3.dmg
Exception: [AbstractCommand.cc:350] errorCode=22 URI=http://adcdownload.apple.com//Mac_OS_X_Server/os_x_server_4.0.3/os_x_server_4.0.3.dmg
  -> [HttpSkipResponseCommand.cc:228] errorCode=22 The response status is not successful. status=403

01/16 17:41:48 [NOTICE] Download GID#1022597bf5217c17 not complete: 

Download Results:
gid   |stat|avg speed  |path/URI
======+====+===========+=======================================================
102259|ERR |       0B/s|http://adcdownload.apple.com//Mac_OS_X_Server/os_x_server_4.0.3/os_x_server_4.0.3.dmg

Status Legend:
(ERR):error occurred.

aria2 will resume download if the transfer is restarted.
If there are any errors, then see the log file. See '-l' option in help/man page for details.
yurikoles commented 9 years ago

Sorry, I double checked, the problem was in "~" vs "/Users/yurikoles".

jacknagel commented 9 years ago

Sorry, do you mean there isn't an issue here?

yurikoles commented 9 years ago

I mean this is an upstream issue, we have nothing to do here. Upstream version also can't deal with "~" in path.