FTParia2 (CLI: aftp) is a high-performance FTP file crawler and downloader. It provides powerful filtering, traversal control, and parallel downloading using aria2. The tool is ideal for scripting, automation, or selectively downloading large FTP trees quickly and flexibly.

Tools like wget and lftp exist, but none are perfect for this task. Most lack recursive downloading, and those that support it don't offer multithreaded or multi-connection modes—making them slower, especially for many small files. lftp comes close but fails to set proper file permissions, which is tedious to fix on Windows. I also find its commands hard to remember. I prefer using aria2, which handles these things better and faster, aria2 is not intended to recursively crawl and here I fill that gap.
- Traverse FTP directories recursively
- Filter files and directories
- Multithreaded and Multi-connection aria2
- Clone directory structure with aria2
- Directly download matched files to flat structure
- Filter by extension, path, or file name
- Customize recursion and exclusion
- Control parallelism and directory layout
pip install git+https://github.com/devvratmiglani/FTParia2.gitA copy of Aria2 is supplied for windows, system installed overrides it.
Aria2 needs to be installed for your operating system.
sudo apt install aria2Then:
pip install git+https://github.com/devvratmiglani/FTParia2.gitIf you get break-system-packages error, use pipx
pipx install git+https://github.com/devvratmiglani/FTParia2.gitThen use it as a CLI:
aftp ftp://host/pathOnly shows directory listing in ftp_links.txt
aftp [HOST_AND_PATH] [OPTIONS]
HOST_AND_PATH is the FTP server URI:
ftp://user:pass@host:port/path
ftp://user:pass@ftp.example.com/path
All filters and commands work only when a valid FTP URI is given.
-h, --help show this help message and exit
-u USER, --user USER Username (overrides URL credentials)
-p PASSWORD, --password PASSWORD
Password (overrides URL credentials)
--port PORT Port (overrides URL port; default 21)
--ftps Use explicit TLS (overrides URL scheme)
--start START Start path on server (overrides URL path; default '/')
--out OUT Base output name (used for listing and link files)
--active Use active mode (default: passive)
--timeout TIMEOUT Socket timeout in seconds (default: 30)
--no-mlsd Disable MLSD preference and use portable listing
-e EXTENSION, --extension EXTENSION
Include only these file extensions (case-insensitive). Repeat or comma-separate.
-ie IGNORE_EXTENSION, --ignore-extension IGNORE_EXTENSION
Exclude these file extensions (case-insensitive). Repeat or comma-separate.
-r REGEX, --regex REGEX
Filter regex (applies to BOTH files & dirs; basename).
-rf REGEX_FILE, --regex-file REGEX_FILE
Filter regex for FILES only (basename).
-rd REGEX_DIR, --regex-dir REGEX_DIR
Filter regex for DIRECTORIES only (basename).
-xrd EXCLUDE_REGEX_DIR, --exclude-regex-dir EXCLUDE_REGEX_DIR
Exclude regex for DIRECTORIES only.
--link-file {aria2,wget,curl,powershell}
Generate a link file for the given tool. Can be specified multiple times.
--keep-structure Keep relative directory structure in generated link files (per-file dir).
--embed-user-pass Embed user:pass@host:port in generated links. (Clone mode implies this by default.)
--clone Clone the server subtree into a local folder using aria2c.
--clone-dir CLONE_DIR
Destination directory name for --clone (default: host name).
-d, --download Download the server files into a local folder using aria2c. Ignored if --clone is used
-ddir DOWNLOAD_DIR, --download-dir DOWNLOAD_DIR
Destination directory name for --download (default: host name).
--examples Show usage examples for all features and exit.
--debug Show tracebacks and errors-e EXT: Include files with extension [.EXT|EXT]-ie EXT: Exclude files with extension [.EXT|EXT]-rf REGEX: Include only files matching REGEX-rd REGEX: Include only directories matching REGEX-xrd REGEX: Exclude directories (omit scanning) matching REGEX
--active: Use active mode (default: passive)--ftps: Use FTPS--port: Override port number--user,--password: Override or supply credentials
aftp ftp://user:pass@host:port/ --clone
aftp ftp://user:pass@host:port/ --clone --clone-dir my_ftp_backup
aftp ftp://user:pass@host:port/ --clone -e pdf -xrd "Android" -rf "report"
aftp ftp://host/ --download -e zip -rf "dataset"
aftp ftp://host/ -d -ddir /tmp/data
aftp ftp://host/ --ftps --user admin --password secret --clone
aftp ftp://user:pass@ftp.example.com/ --link-file aria2 --link-file wget --embed-user-pass
The tool is designed with modularity and future extensibility in mind. Planned features include:
- Interactive server browsing with fuzzy-finder (
fzf) - Persistent config/profiles
To contribute:
- Fork and clone the repo
- Make changes in a feature branch
- Test
- Submit a pull request
GPL-2.0 license