How can I use cookie string (Not file) for a single file download?
For example something like this:
aria2c --cookie='session=3f543ac31fc092bd' http://example.com/1.zip
@sky93
You could use header for this purpose:
aria2c --header="Cookie:session=3f543ac31fc092bd" http://example.com/1.zip
I think it would be nicer to have an option for it. Instead of manually crafting the header.
First You are missing a single-space character after Cookie:, it's very important.
aria2c --header="Cookie: session=3f543ac31fc092bd" http://example.com/1.zip
Also, a key (cookie name) and value should be safely-escaped before putting it into a cookie header (usually just the value is really required),
you can use JavaScript's escapeencodeURIComponent("your text here") method (for example open a browser, then the developer-panel, then go to console and type there, or use nodejs from your command-line).
Finally, you can not use the value of document.cookie from the browser (for example) as is in aria2,
You only use the key=value part, and you need to split each key=value into its own --header="Cookie: ..." argument.
For example "_ga=GA1126152; _octo=GH15463; tz=New%20York",
will be: aria2c --header="Cookie: _ga=GA1126152" --header="Cookie: _octo=GH15463" --header="Cookie: tz=New%20York" http://example.com/1.zip.
Most helpful comment
@sky93
You could use header for this purpose:
aria2c --header="Cookie:session=3f543ac31fc092bd" http://example.com/1.zip