A flexible script for downloading images from the Rule34 API. The script supports configuration via command-line arguments or a YAML configuration file and provides options for specifying tags, download limits, and more.
- Flexible Tagging: Download images based on specified tags.
- Configurable Limits: Set limits on the number of images or pages to download.
- Multithreading: Download multiple images simultaneously with configurable thread limits.
- Configurable: Use a YAML configuration file for settings or specify them via command-line arguments.
- bash: Required for running the script
- cURL: Used for making HTTP requests.
- jq: A command-line JSON processor to parse and handle API responses.
- Clone the repository:
git clone https://github.com/Lynnux-useless-codes/rule34-Scraper.git
cd rule34-Scraper
- Ensure you have
curl
andjq
installed on your system:
# For Debian/Ubuntu
sudo apt install curl jq
# Arch Linux
sudo pacman -S curl jq
# Other Linux Distributions
sudo dnf install curl jq
# For macOS (with Homebrew)
brew install curl jq
- Make the script executable:
chmod +x downloader.sh
You can run the downloader either by specifying command-line arguments or using a configuration file.
tags
(Required): The tags to search for. Enclose in quotes if it contains spaces.--amount
(Optional): The total number of images to download.--pages
(Optional): The number of pages to fetch.--config
(Optional): Path to a YAML configuration file.
- Download images with specific tags and limit by amount:
./downloader.sh "anime girl" --amount 25
- Download images using a configuration file:
./downloader.sh --config config.yaml
You can specify a YAML configuration file with the following options:
tags
: Tags for the search (e.g., "anime girl").max_threads
: Maximum number of simultaneous downloads (default is 5).image_folder
: Directory to save the images (./default is downloaded).amount
: Total number of images to download (if not using --pages).
tags: "anime girl"
max_threads: 10
image_folder: "downloads"
amount: 25
--amount
: Total number of images to download.--pages
: Number of pages to fetch.--config
: Path to YAML configuration file.--cach-hash
: Make a text file where it saves hashes. (if command is used again it will skip files that are already cached)--only-videos
: Only downloads videos/gifs.--only-images
: Only downlaods image files.
Note: If both --amount
and --pages
are specified, --amount
takes precedence.
- Empty Response: If you encounter empty responses, ensure the tags are correctly specified and try different tags or limits.
- Invalid Config File: Verify that the YAML configuration file is correctly formatted and paths are valid.
Contributions are welcome! Please open an issue or submit a pull request for any features or bug fixes.
This project is licensed under the MIT License.