An unofficial Pinterest image downloader
Project description
Pinterest Image Downloader CLI (pinterest-dl)
This CLI (Command Line Interface) tool facilitates the scraping and downloading of images from Pinterest. Using Selenium for automation, it enables users to extract images from a specified Pinterest URL and save them to a chosen directory.
⚠️ Disclaimer:
This project is independent and not affiliated with Pinterest. It's designed solely for educational purposes. Please be aware that automating the scraping of websites might conflict with their Terms of Service. The repository owner disclaims any liability for misuse of this tool. Use it responsibly and at your own legal risk.
🗒️ Note:
This project draws inspiration from pinterest-image-scraper.
🌟 Features
- ✅ Scrape images directly from a Pinterest URL.
- ✅ Asynchronously download images from a list of URLs. (see pull request)
- ✅ Save scraped URLs to a JSON file for future access.
- ✅ Incognito mode to keep your scraping discreet.
- ✅ Access detailed output for effective debugging.
- ✅ Support for the Firefox browser.
- ✅ Insert
alt
text for images as metadatacomment
in the downloaded image for searchability.
🚩 Known Issues
- 🔲 Limited functionality with Pinterest URLs requiring login.
- 🔲 Incompatibility with Pinterest URLs that include search queries.
- 🔲 Not sorely tested on Linux and Mac. Please create an Issue to report any bugs.
📋 Requirements
- Python 3.10 or newer
- Chrome or Firefox browser
📥 Installation
Using pip (Recommended)
pip install pinterest-dl
Cloning from GitHub
git clone https://github.com/sean1832/pinterest-dl.git
cd pinterest-dl
pip install .
🛠 Usage
General Command Structure
pinterest-dl [command] [options]
Examples
Scraping Images:
Scrape images to the ./images/art
directory from the Pinterest URL https://www.pinterest.com/pin/1234567
with a limit of 30
images and a minimum resolution of 512x512
. Save scraped URLs to a JSON
file.
pinterest-dl scrape "https://www.pinterest.com/pin/1234567" "images/art" -l 30 -r 512x512 --json
Downloading Images:
Download images from the art.json
file to the ./downloaded_imgs
directory with a minimum resolution of 1024x1024
.
pinterest-dl download art.json -o downloaded_imgs -r 1024x1024
Commands
1. Scrape
Extract images from a specified Pinterest URL.
Syntax:
pinterest-dl scrape [url] [output_dir] [options]
Options:
-l
,--limit [number]
: Max number of image to download (default: 100).-r
,--resolution [width]x[height]
: Minimum image resolution for download (e.g., 512x512).--timeout [second]
: Timeout in seconds for requests (default: 3).--incognito
: Activate incognito mode for scraping.--json
: Save scraped URLs to a JSON file.--dry-run
: Execute scrape without downloading images.--firefox
: Opt for Firefox as the scraping browser.--headful
: Run in headful mode with browser window.--verbose
: Enable detailed output for debugging.
2. Download
Download images from a list of URLs provided in a file.
Syntax:
pinterest-dl download [url_list] [options]
Options:
-o
,--output [directory]
: Output directory (default: ./<json_filename>).-r
,--resolution [width]x[height]
: minimum resolution to download (e.g. 512x512).--verbose
: Enable verbose output.
📜 License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for pinterest_dl-0.0.25-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f1c4f47f7a0dab44e7a3fe166fe160ac54dd907f9a04f236d6572cd49a49c213 |
|
MD5 | 6e05a10d51b2ccf019da2a4b0c203277 |
|
BLAKE2b-256 | e1ed10566e0ba8529ae3dea07f721ea9550d1f4777f3ab4065c79b383d72bbc7 |