| Crates.io | ecomdev-download-magento-images |
| lib.rs | ecomdev-download-magento-images |
| version | 0.1.0 |
| created_at | 2025-01-15 10:14:33.733437+00 |
| updated_at | 2025-01-15 10:14:33.733437+00 |
| description | CLI tool to download images from a store based on its database table |
| homepage | |
| repository | https://github.com/EcomDev/download-magento-images-rs |
| max_upload_size | |
| id | 1517337 |
| size | 88,960 |
The Media Downloader Tool is a Rust-based application for downloading media files from a remote source while utilizing batched processing and high concurrency. This tool supports downloading large volumes of media efficiently and includes progress tracking.
Before starting, ensure you have the following installed on your machine:
1.83.0 or later is recommended)catalog_product_entity_media_gallery)Clone this repository:
git clone <repository-url>
cd <repository-directory>
Build the project:
cargo build --release
Set up your MySQL database connection and ensure the catalog_product_entity_media_gallery table is populated with entries.
Run the tool with the following command:
Usage: ecomdev-download-magento-images [OPTIONS] <BASE_URL>
Arguments:
<BASE_URL> Base URL for media download
Options:
-p, --base-path <BASE_PATH> Directory path [default: pub/media]
-u, --user-agent <USER_AGENT> User agent [default: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36 Edg/125.0.0.0"]
-c, --max-clients <MAX_CLIENTS> Max number of clients to create for downloading [default: 100]
-b, --batch-size <BATCH_SIZE> Max number of items to fetch per batch [default: 10000]
-d, --database-url <DATABASE_URL> Database URL to use of connection [default: mysql://magento:magento@localhost/magento]
-h, --help Print help
To develop or test this tool, follow these steps:
Ensure sqlx knows about your database schema by running:
export DATABASE_URL=mysql://user:password@localhost/db
cargo sqlx prepare -- --lib
Run in development mode:
cargo run -- [OPTIONS]
Test the application with mock data or a test database.
Contributions are welcome! Please follow these steps:
git checkout -b feature/my-feature
git push origin feature/my-feature
This project is licensed under the MIT License. See the LICENSE file for details.