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): IfTrue, returns the direct URL of the media instead of downloading it. Defaults toFalse.
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
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
54c3df9f264e08c43cd2c1e4975d43b668b213d6c927bc84e73f778f2b77e2d3
|
|
| MD5 |
6bee44a70cf1677b31ea8fdfb461dba2
|
|
| BLAKE2b-256 |
7481cf5981a741016577e01e26312027832f613e8ae7bc8cde0c780ed8c40ade
|
File details
Details for the file pinterest_downloader-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pinterest_downloader-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5e531d6fc1b64d1a7bf44fd7cbd502f1221392b853e67e4e00d636b9c6d98a6f
|
|
| MD5 |
0509aece61a207c9985b00f371b16b67
|
|
| BLAKE2b-256 |
844347b1b5729ecfffed2ac6a3935c61f2b7230646eca6df51c5ad620297eb29
|