0

How can I download multiple links in to a single file using aria2c? This works but it will still download all the links as seperate files.

aria2c -i links.txt --o result.txt
  • 3
    Please ask your sysadmin or ask at [Super User](http://superuser.com/tour). Stack Overflow is a question and answer site for professional and enthusiast programmers. – Cyrus Nov 23 '16 at 17:28
  • 2
    Provide a minimal verifiable input and expected output. – Inian Nov 23 '16 at 17:33

1 Answers1

1

You can use the following custom command:

aria2c2 links.txt results.txt

By defining this function:

function aria2c2() {                                                             
    mkdir output && \                                                            
    aria2c -i $1 --dir output && \                                               
    cat output/* > $2 && \                                                       
    rm -r output                                                                 
}

This will download the contents the links point to and combine them into one text file called "results.txt". This assumes you're working only with text.

To define the function for each new terminal, place it in your ~/.bashrc file. Load it in the current terminal by entering source ~/.bashrc.


This doesn't answer your question (i.e. how to do this with aria2c alone), but it's the best I've got and I don't have enough reputation to comment.

Matt Kleinsmith
  • 1,017
  • 3
  • 13
  • 24