Skip to main content

A Pinterest media downloader

Project description

# Pinterest Downloader

A Python library for downloading media (images and videos) from Pinterest.

## Installation

You can install the package using pip:

```bash
pip install pinterest-downloader

Usage

from pinterest_downloader import download_pinterest_media

# Download a Pinterest image or video
url = "https://pin.it/abcdefg"  # Replace with your Pinterest pin URL
result = download_pinterest_media(url, output_dir="downloads")
print(result)  # Prints a dictionary containing information about the download (success/failure, filename, etc.)

# Get the direct URL of the media
url_result = download_pinterest_media(url, return_url=True)
print(url_result)  # Prints the direct URL of the media file

# Specify filename (optional)
result = download_pinterest_media(url, output_dir="downloads", filename="my_pinterest_image")


#Handle Errors
try:
    result = download_pinterest_media(url, output_dir="downloads")
    print(result)
except Exception as e:
    print(f"An error occurred: {e}")

download_pinterest_media(url, output_dir="downloads", filename=None, return_url=False)

  • url (str): The URL of the Pinterest pin. Required.
  • output_dir (str, optional): The directory to save the downloaded media. Defaults to "downloads".
  • filename (str, optional): Specify the desired filename (without extension). If not provided, a filename will be generated automatically.
  • return_url (bool, optional): If True, returns the direct URL of the media instead of downloading it. Defaults to False.

Features

  • Downloads images and videos from Pinterest URLs.
  • Provides direct links to media files.
  • Option to get the direct URL instead of downloading.
  • Handles potential errors during download and provides informative messages.
  • Allows specifying custom filenames.

License

This project is licensed under the MIT License - see the LICENSE file for details.

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-0.1.0.tar.gz (3.0 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-0.1.0-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pinterest_downloader-0.1.0.tar.gz
Algorithm Hash digest
SHA256 54c3df9f264e08c43cd2c1e4975d43b668b213d6c927bc84e73f778f2b77e2d3
MD5 6bee44a70cf1677b31ea8fdfb461dba2
BLAKE2b-256 7481cf5981a741016577e01e26312027832f613e8ae7bc8cde0c780ed8c40ade

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pinterest_downloader-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5e531d6fc1b64d1a7bf44fd7cbd502f1221392b853e67e4e00d636b9c6d98a6f
MD5 0509aece61a207c9985b00f371b16b67
BLAKE2b-256 844347b1b5729ecfffed2ac6a3935c61f2b7230646eca6df51c5ad620297eb29

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