pinterest-dl


Gem Downloads License Ruby


Get direct image and video URLs from Pinterest.

Demo

Note: Users in Iran may need a VPN to access Pinterest.

Installation

gem install pinterest-dl

Usage

require 'pinterest-dl'

Get Image URL

url = PinterestDL.get_image_url('https://www.pinterest.com/pin/example/')

Get Video URL

url = PinterestDL.get_video_url('https://www.pinterest.com/pin/example/')

Search Pins

# Search for pins with a specific query
results = PinterestDL.search('nature landscape', limit: 10)

# Returns an array of pin objects with:
# id, pin_url, title, description, image_url, video_url

# Get only image URLs from search results
images = PinterestDL.search_images('sunset', limit: 5)
# => ["https://i.pinimg.com/originals/...", ...]

# Get only video URLs from search results
videos = PinterestDL.search_videos('tutorial', limit: 3)
# => ["https://v.pinimg.com/videos/...", ...]

# Get search results as JSON
json_results = PinterestDL.search_json('anime art', limit: 20)
# => Returns formatted JSON string

License

MIT © monji024