Aria2C Example Download Script To Download Latest FFMPEG

aria2c https://aria2.github.io/ is a console-multi-part download manager, very similar to cURL or wGET. It also allow you to download a single file, using multiple-partial segments, downloading the whole thing much faster (assuming the host isn’t limiting download speed by IP, or block multipart downloads).

It also allows you to download same file from different hosts (for example a Ubuntu ISO, from few mirrors), or, simply multiple-files, from same and or different hosts with the additional of using http-pipeline to save on bandwidth, there are more stuff..

The multipart-download, may replace download-managers such as FlashGet, OrbitDownloader or (in some cases) jDownloader, mostly because it is simply script’able, you can even launch “callbacks” on several pin-points in download timeline.

I use it in plain Windows-CMD batch file, to download the latest FFMPEG from https://ffmpeg.zeranoe.com/builds/, including an unzip action at the end and moving some of the core-files.

There is an optional log.txt file creating, which may be useful for debug..
pre-locating using falloc is mostly for NTFS (not FAT32!) and newer file-OS,
You may download aria2c, and run it with --help for all of the other switches..

@echo off

::pre-cleanup
if exist ".\ffmpeg-latest-win64-static.zip" (
  del /f /q ".\ffmpeg-latest-win64-static.zip" >nul
)


::download
D:\dos\parallel_aria2\aria2c.exe   ^
--split=5                          ^
--min-split-size=1M                ^
--file-allocation=falloc           ^
--check-certificate=false          ^
--continue=true                    ^
--max-connection-per-server=16     ^
--timeout=120                      ^
--connect-timeout=120              ^
--max-tries=3                      ^
--console-log-level=notice         ^
--disable-ipv6=true                ^
--human-readable=true              ^
--retry-wait=1                     ^
--enable-http-keep-alive=true      ^
--enable-http-pipelining=true      ^
--user-agent="Mozilla/5.0 Chrome"  ^
--dir="."                          ^
--http-user=username               ^
--http-passwd=password             ^
--referer="https://zeranoe.com/"   ^
"https://ffmpeg.zeranoe.com/builds/win64/static/ffmpeg-latest-win64-static.zip"

::move executables, move entire preset as folder.
if exist ".\ffmpeg-latest-win64-static.zip" (
  unzip ".\ffmpeg-latest-win64-static.zip"
  
  move /y .\ffmpeg-latest-win64-static\bin\*.exe .\..
  move /y .\ffmpeg-latest-win64-static\presets\.  .\..
  
  rmdir /s /q  ".\ffmpeg-latest-win64-static\"    >nul
  del   /f /q  ".\ffmpeg-latest-win64-static.zip" >nul
)

pause

::  --log=log.txt                      ^
::  --log-level=info                   ^

Leave a Reply