An ultra-fast image scraper built in Rust, leveraging asynchronous programming and multi-threading for unmatched performance.
Spider crawls a website and downloads all its images, with an optional recursive mode to explore multiple depth levels.
- High-performance systems language: Rust
- Asynchronous powered by Tokio to handle thousands of network requests in parallel
- Safe multi-threading with
Arc,Mutex,DashSet, and semaphores to prevent race conditions - Parallel downloads optimized with
reqwestandfutures - Duplicate handling to avoid unnecessary downloads
- Configurable recursive scraping (depth limit)
- Robust: handles network errors and various image formats
- Rust installed (2021 edition or later)
cargoavailable in your terminal
git clone https://github.com/Frqnku/spider.git
cd spider
make buildThe spider binary will be generated at the project root.
./spider <URL>| Option | Description | Default |
|---|---|---|
-r, --recursive |
Enable recursive scraping | false |
-l, --limit <N> |
Max scraping depth (requires --recursive) |
5 |
-p, --path <PATH> |
Directory to save images | ./data |
<URL> |
The URL of the page to scrape | required |
# Scrape all images from a page
./spider https://example.com
# Recursively scrape up to 3 levels deep
./spider -r -l 3 https://example.com
# Specify a destination folder
./spider -p ./images https://example.com- CLI argument parsing with
clap - Disk access checks to ensure a valid and writable directory
- Asynchronous downloads with
reqwestandfutures - Image & link extraction with a simple HTML parser
- Concurrency management using:
Arc+Mutexto share state (visited)DashSetfor fast duplicate trackingSemaphoreto limit the number of concurrent tasks
- Safe file saving: each image is saved with a unique name based on UUID and timestamp
- Language: Rust (2021 edition)
- Networking: reqwest
- Async runtime: Tokio
- Concurrency:
Arc,Mutex,Semaphore,DashSet - URL parsing: url
- Unique IDs: uuid
- Timestamps: chrono
- CLI: clap
This project is licensed under the MIT License.
See the LICENSE file for details.
💡 Spider is designed to maximize performance while remaining simple to use. Thanks to Rust and its safe async/multi-threaded architecture, it can handle a huge number of simultaneous downloads without overwhelming your system.