pinterest-cli


Namepinterest-cli JSON
Version 0.0.8 PyPI version JSON
download
home_pagehttps://github.com/sean1832/pinterest-cli
SummaryCLI tool to scrape images from Pinterest url
upload_time2024-03-31 13:04:37
maintainerNone
docs_urlNone
authorZeke Zhang
requires_pythonNone
licenseApache-2.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Pinterest Image Scraper CLI
![PyPI - Version](https://img.shields.io/pypi/v/pinterest-cli)
![Static Badge](https://img.shields.io/badge/python-3.10%2B-yellow)
![PyPI - License](https://img.shields.io/pypi/l/pinterest-cli)



This CLI (Command Line Interface) tool facilitates the scraping and downloading of images from [Pinterest](https://pinterest.com). Using [Selenium](https://selenium.dev) 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](https://developers.pinterest.com/terms/). 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](https://github.com/xjdeng/pinterest-image-scraper).

## 🌟 Features
- ✅ Scrape images directly from a Pinterest URL.
- ✅ Asynchronously download images from a list of URLs. ([see pull request](https://github.com/sean1832/pinterest-cli/pull/1))
- ✅ Configure the output directory to your liking.
- ✅ Save scraped URLs to a JSON file for easy access.
- ✅ Utilize incognito mode to keep your scraping discreet.
- ✅ Access detailed output for effective debugging.
- ✅ Perform dry-runs to receive URLs without downloading the images.
- ✅ Full support for the Firefox browser.
- ✅ Customize scroll threshold and page persistence for tailored scraping.

## 🚩 Known Issues
- 🔲 Experimental Firefox browser support might not perform as expected.
- 🔲 Limited functionality with Pinterest URLs requiring login.
- 🔲 Incompatibility with Pinterest URLs that include search queries.
- 🔲 Currently does not support MacOS and Linux platforms.

## 📋 Requirements
- Python 3.10 or newer
- Chrome or Firefox browser

## 📥 Installation

### Using pip (Recommended)
```bash
pip install pinterest-cli
```

### Cloning from GitHub
```bash
git clone https://github.com/sean1832/pinterest-cli.git
cd pinterest-cli
pip install .
```

## 🛠 Usage

### General Command Structure
```bash
pinterest-cli [command] [options]
```

### Commands

#### 1. Scrape
Extract images from a specified Pinterest URL.

**Syntax:**
```bash
pinterest-cli scrape [url] [options]
```

**Options:**
- `-o`, `--output [directory]`: Set the directory to save images (default: `imgs`).
- `-w`, `--write [file]`: Save scraped URLs to a JSON file.
- `-t`, `--threshold [number]`: Set the number of page scrolls (default: 20).
- `-p`, `--persistence [seconds]`: Wait time for page loading (default: 120 seconds).
- `-r`, `--resolution [width]x[height]`: Minimum image resolution for download (e.g., 512x512).
- `--incognito`: Activate incognito mode for scraping.
- `--dry-run`: Execute scrape without downloading images.
- `--firefox`: Opt for Firefox as the scraping browser.
- `--verbose`: Enable detailed output for debugging.

#### 2. Download
Download images from a list of URLs provided in a file.

**Syntax:**
```bash
python scraper.py download [url_list] [options]
```

**Options:**
- `-o`, `--output [directory]`: Specify the output directory for the images (default: `imgs`).
- `-r`, `--resolution [width]x[height]`: minimum resolution to download (e.g. 512x512).
- `--verbose`: Enable verbose output.

### Examples

**Scraping Images:**
```bash
python scraper.py scrape "https://www.pinterest.com/exampleBoard" -o myimages -t 30 --verbose
```

**Downloading Images:**
```bash
python scraper.py download urls.json -o downloaded_imgs --verbose
```

## 📜 License
[Apache License 2.0](LICENSE)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/sean1832/pinterest-cli",
    "name": "pinterest-cli",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": null,
    "author": "Zeke Zhang",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/43/4d/118cb05b6df249dacfc1a266c1653fb7fa423c4e6f622cbb8d3bf5b180fc/pinterest-cli-0.0.8.tar.gz",
    "platform": null,
    "description": "# Pinterest Image Scraper CLI\r\n![PyPI - Version](https://img.shields.io/pypi/v/pinterest-cli)\r\n![Static Badge](https://img.shields.io/badge/python-3.10%2B-yellow)\r\n![PyPI - License](https://img.shields.io/pypi/l/pinterest-cli)\r\n\r\n\r\n\r\nThis CLI (Command Line Interface) tool facilitates the scraping and downloading of images from [Pinterest](https://pinterest.com). Using [Selenium](https://selenium.dev) for automation, it enables users to extract images from a specified Pinterest URL and save them to a chosen directory.\r\n\r\n> **\u26a0\ufe0f Disclaimer:**  \r\n> 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](https://developers.pinterest.com/terms/). The repository owner disclaims any liability for misuse of this tool. Use it responsibly and at your own legal risk.\r\n\r\n> **\ud83d\uddd2\ufe0f Note:**  \r\n> This project draws inspiration from [pinterest-image-scraper](https://github.com/xjdeng/pinterest-image-scraper).\r\n\r\n## \ud83c\udf1f Features\r\n- \u2705 Scrape images directly from a Pinterest URL.\r\n- \u2705 Asynchronously download images from a list of URLs. ([see pull request](https://github.com/sean1832/pinterest-cli/pull/1))\r\n- \u2705 Configure the output directory to your liking.\r\n- \u2705 Save scraped URLs to a JSON file for easy access.\r\n- \u2705 Utilize incognito mode to keep your scraping discreet.\r\n- \u2705 Access detailed output for effective debugging.\r\n- \u2705 Perform dry-runs to receive URLs without downloading the images.\r\n- \u2705 Full support for the Firefox browser.\r\n- \u2705 Customize scroll threshold and page persistence for tailored scraping.\r\n\r\n## \ud83d\udea9 Known Issues\r\n- \ud83d\udd32 Experimental Firefox browser support might not perform as expected.\r\n- \ud83d\udd32 Limited functionality with Pinterest URLs requiring login.\r\n- \ud83d\udd32 Incompatibility with Pinterest URLs that include search queries.\r\n- \ud83d\udd32 Currently does not support MacOS and Linux platforms.\r\n\r\n## \ud83d\udccb Requirements\r\n- Python 3.10 or newer\r\n- Chrome or Firefox browser\r\n\r\n## \ud83d\udce5 Installation\r\n\r\n### Using pip (Recommended)\r\n```bash\r\npip install pinterest-cli\r\n```\r\n\r\n### Cloning from GitHub\r\n```bash\r\ngit clone https://github.com/sean1832/pinterest-cli.git\r\ncd pinterest-cli\r\npip install .\r\n```\r\n\r\n## \ud83d\udee0 Usage\r\n\r\n### General Command Structure\r\n```bash\r\npinterest-cli [command] [options]\r\n```\r\n\r\n### Commands\r\n\r\n#### 1. Scrape\r\nExtract images from a specified Pinterest URL.\r\n\r\n**Syntax:**\r\n```bash\r\npinterest-cli scrape [url] [options]\r\n```\r\n\r\n**Options:**\r\n- `-o`, `--output [directory]`: Set the directory to save images (default: `imgs`).\r\n- `-w`, `--write [file]`: Save scraped URLs to a JSON file.\r\n- `-t`, `--threshold [number]`: Set the number of page scrolls (default: 20).\r\n- `-p`, `--persistence [seconds]`: Wait time for page loading (default: 120 seconds).\r\n- `-r`, `--resolution [width]x[height]`: Minimum image resolution for download (e.g., 512x512).\r\n- `--incognito`: Activate incognito mode for scraping.\r\n- `--dry-run`: Execute scrape without downloading images.\r\n- `--firefox`: Opt for Firefox as the scraping browser.\r\n- `--verbose`: Enable detailed output for debugging.\r\n\r\n#### 2. Download\r\nDownload images from a list of URLs provided in a file.\r\n\r\n**Syntax:**\r\n```bash\r\npython scraper.py download [url_list] [options]\r\n```\r\n\r\n**Options:**\r\n- `-o`, `--output [directory]`: Specify the output directory for the images (default: `imgs`).\r\n- `-r`, `--resolution [width]x[height]`: minimum resolution to download (e.g. 512x512).\r\n- `--verbose`: Enable verbose output.\r\n\r\n### Examples\r\n\r\n**Scraping Images:**\r\n```bash\r\npython scraper.py scrape \"https://www.pinterest.com/exampleBoard\" -o myimages -t 30 --verbose\r\n```\r\n\r\n**Downloading Images:**\r\n```bash\r\npython scraper.py download urls.json -o downloaded_imgs --verbose\r\n```\r\n\r\n## \ud83d\udcdc License\r\n[Apache License 2.0](LICENSE)\r\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "CLI tool to scrape images from Pinterest url",
    "version": "0.0.8",
    "project_urls": {
        "Homepage": "https://github.com/sean1832/pinterest-cli"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0b998197971f6014dd40b17f373ec8e8a991ed538e3530615cd6af3a5c13a7d1",
                "md5": "6fcb5149b8b8e54d609eba971c749812",
                "sha256": "00d66aba5809fae1a7d68ca4dbea6b92412a25cda6a11faf8a0ee1443ebe4c36"
            },
            "downloads": -1,
            "filename": "pinterest_cli-0.0.8-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6fcb5149b8b8e54d609eba971c749812",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 20579,
            "upload_time": "2024-03-31T13:04:36",
            "upload_time_iso_8601": "2024-03-31T13:04:36.220988Z",
            "url": "https://files.pythonhosted.org/packages/0b/99/8197971f6014dd40b17f373ec8e8a991ed538e3530615cd6af3a5c13a7d1/pinterest_cli-0.0.8-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "434d118cb05b6df249dacfc1a266c1653fb7fa423c4e6f622cbb8d3bf5b180fc",
                "md5": "c0c648cf4f53f20d030ef6653ac756ae",
                "sha256": "66792e117ff813e75d2eb4e645ed73d9bb07513b55419c8fed9ad2e622064cf4"
            },
            "downloads": -1,
            "filename": "pinterest-cli-0.0.8.tar.gz",
            "has_sig": false,
            "md5_digest": "c0c648cf4f53f20d030ef6653ac756ae",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 13813,
            "upload_time": "2024-03-31T13:04:37",
            "upload_time_iso_8601": "2024-03-31T13:04:37.943699Z",
            "url": "https://files.pythonhosted.org/packages/43/4d/118cb05b6df249dacfc1a266c1653fb7fa423c4e6f622cbb8d3bf5b180fc/pinterest-cli-0.0.8.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-31 13:04:37",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "sean1832",
    "github_project": "pinterest-cli",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "pinterest-cli"
}
        
Elapsed time: 0.21394s