Skip to main content

A Pinterest media downloader

Project description

Pinterest-dowenloader

This Python library allows you to search for images on Pinterest and download them asynchronously. It uses asynchronous programming to efficiently search and download multiple images concurrently.

Features

  • Search Pinterest for images based on a query
  • Download images and videos from Pinterest
  • Asynchronous operations for improved performance
  • Customizable output directory and maximum number of results
  • Supports both image and video content from Pinterest

Requirements

  • Python 3.7+
  • aiohttp

Installation

You can install this package using pip:

pip install Pinterest-dowenloader

Usage

You can use this library in your Python projects by importing the necessary functions:

import asyncio
from Pinterest_dowenloader import search_and_download_pinterest

async def main():
    query = "cute cats"
    output_dir = "pinterest_downloads"
    max_results = 5

    results = await search_and_download_pinterest(query, output_dir, max_results)
    
    print(f"Downloaded {len(results)} images/videos for query: '{query}'")
    for result in results:
        print(f"Type: {result['type']}, File: {result.get('file_path', result.get('url'))}")

if __name__ == "__main__":
    asyncio.run(main())

Available Functions

  1. pinterest_search(query: str) -> List[Dict[str, str]]

    1. Searches Pinterest for images based on the given query.
    2. Returns a list of dictionaries containing image URLs and thumbnails.
  2. download_pinterest_media(url: str, output_dir: str = '.', return_url: bool = False) -> Dict[str, Any]

    1. Downloads a single image or video from Pinterest.
    2. Returns a dictionary with information about the downloaded media.
  3. search_and_download_pinterest(query: str, output_dir: str = '.', max_results: int = 5) -> List[Dict[str, Any]]

    1. Combines search and download functionality.
    2. Returns a list of dictionaries with information about the downloaded media.

Configuration

You can customize the following parameters when calling search_and_download_pinterest:

  • query: The search term for Pinterest images
  • output_dir: The directory where downloaded images will be saved
  • max_results: The maximum number of images to download

Limitations

  • The script relies on Pinterest's current HTML structure and API. Changes to Pinterest's website may require updates to the script.
  • Pinterest may rate-limit or block excessive requests. Use responsibly and consider adding delays between requests if necessary.
  • Some images or videos may not be downloadable due to privacy settings or other restrictions.

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_downloader-2.0.0.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pinterest_downloader-2.0.0-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file pinterest_downloader-2.0.0.tar.gz.

File metadata

  • Download URL: pinterest_downloader-2.0.0.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for pinterest_downloader-2.0.0.tar.gz
Algorithm Hash digest
SHA256 2405030035f93b4fc785b6db6f7022d66e5341b246dd771949e753b5ae5ccd56
MD5 c65c57f0ac05de073351aff0d576889f
BLAKE2b-256 18b95d8c7b408913bc3536f8ff06df535185991f8247a9cff7393acc39e1d7e8

See more details on using hashes here.

File details

Details for the file pinterest_downloader-2.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pinterest_downloader-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7dac1897bf4e6f7c6cb105c80e885b0fc57e2f2db651958b7a8b759a6eb48302
MD5 c184b36b25240bb0c95fbedb6dfc8ee1
BLAKE2b-256 e058e26b4facf610ca12d6e3f9fdbd7a75cd100023f72b36d153fb2fa07d4072

See more details on using hashes here.

Supported by

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