Aria2c to download and extract. tar.bz2

I am using aria2c to download a .tar.bz2 and trying to extract it in the same command. I can download the file but not extract it. I can also manually extract the tar.bz2 ., but not in the same command. Thank you :).

aria2c -x8 -l log.txt -c -d /xx/xx/xxx --use-head=true --http-user "<user>"  --http-passwd >password> http://xxx.xx/xxx/xx/xxx/xxxx/xx/xxx.tar.bz2 | tar xj
bzip2: (stdin) is not a bzip2 file.

---------- Post updated at 05:12 PM ---------- Previous update was at 05:12 PM ----------

aria2c

It's not outputting to stdout at all since it wasn't asked to. bzip is complaining because it gets whatever text aria2c prints fed into it instead of the file.

Looks like the closest it can manage is --stderr=true -o /dev/stdout The --stderr=true prevents it from dumping informational text into stdout.

So try:

aria2c -x8 -l log.txt -c -d /xx/xx/xxx --use-head=true --stderr=true -o /dev/stdout --http-user "<user>" --http-passwd >password> http://xxx.xx/xxx/xx/xxx/xxxx/xx/xxx.tar.bz2 | tar xj

or did I misunderstand? Thank you :).

Try that, yes.

1 Like

I get: though the man says --stderr=true is an option.

aria2c --version
aria2 version 1.18.1

though looking at the documentation the option is from 1.27.1 .

What is the best way to upgrade to the newest version of aria2c , use apt get or am I better off with the actual tar.gz . I am using ubuntu 14.04 . Thank you :).

aria2c -x8 -l log.txt -c -d /home/cmccabe/Desktop/NGS/API --use-head=true --stderr=true -o /dev/stdout --http-user "<user>"  --http-passwd <password> http://xxx.xxx/xx/xx/xxx/xxx/xxx.tar.bz2 | tar xj
aria2c: unrecognized option '--stderr=true'

To be honest, I'm not sure if the option will even work as I intended it to. aria2c does not seem designed with stdout use in mind.

1 Like

I will look into curl or wget alternatives. Can you recommend one that would download and ext6ract a tar.gz . The site is password protected as well. Thank you :).

5 seconds of reading man wget tells me:

wget --user=user --passoword=password -O - "http://whatever" | tar xj
1 Like

Thank you :).