Skip to main content

An unofficial Pinterest image downloader

Project description

Pinterest Image Downloader CLI (pinterest-dl)

PyPI - Version PyPI - Python Version PyPI - License Downloads

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 metadata comment 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

Apache License 2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pinterest_dl-0.0.25.tar.gz (17.3 kB view hashes)

Uploaded Source

Built Distribution

pinterest_dl-0.0.25-py3-none-any.whl (18.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page