Metadata-Version: 2.2
Name: pinterest_downloader
Version: 0.1.0
Summary: A Pinterest media downloader
Home-page: https://github.com/x7007x/pinterest-downloader
Author: Ahmed Negm
Author-email: a7mednegm.x@gmail.com
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Requires-Dist: requests>=2.25.1
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

```markdown
# 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

```python
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.
```
