Skip to content

prtmdd4/Pinterest-Uploader-Bot

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pinterest Auto-Publisher 📌

A powerful and intelligent Flask web application that automates Pinterest pin publishing using advanced Selenium WebDriver techniques. Features robust error handling, multiple fallback methods, and human-like behavior patterns to ensure reliable pin uploads.

🌟 Key Features

Core Functionality

  • 🚀 Intelligent Pinterest Login - Secure authentication with advanced anti-detection measures
  • 📸 Multi-Format Image Support - PNG, JPG, JPEG, GIF, WEBP files up to 16MB
  • ✍️ Smart Content Management - Auto-fills titles, descriptions, and destination links
  • 📌 Advanced Board Selection - Supports Pinterest's latest board-row structure
  • 🔗 Optional Link Destinations - Add clickable links to your pins
  • 🤖 Human-like Behavior - Random delays and natural interaction patterns

Technical Excellence

  • 🔄 Multi-Layer Fallbacks - 15+ fallback methods for each critical operation
  • 🛡️ Enhanced Error Handling - Comprehensive logging and debugging capabilities
  • 📊 Real-time Progress - Live status updates and progress indicators
  • 🎨 Modern UI/UX - Beautiful, responsive Bootstrap interface
  • 🔍 Debug Mode - Screenshots and detailed logs for troubleshooting
  • Performance Optimized - Efficient element detection and interaction

🚀 Quick Start

Prerequisites

  • Python 3.7 or higher
  • Google Chrome browser
  • ChromeDriver (automatically managed by Selenium)

Easy Installation

  1. Download and extract this project

  2. Run the startup script:

    start.bat

    Or manually:

    pip install -r requirements.txt
    python app.py
  3. Open your browser and navigate to:

    http://localhost:5000
    

📖 Detailed Usage Guide

1. Initial Setup

  • Start the application using start.bat or python app.py
  • Navigate to http://localhost:5000 in your web browser

2. Pinterest Login Testing (Recommended)

  • Enter your Pinterest credentials
  • Click "Test Login" to verify authentication
  • This helps identify any login issues before uploading

3. Board Discovery

  • Use the "Get My Boards" feature to see available boards
  • Note the exact board names for pin uploads

4. Pin Upload Process

  • Credentials: Enter your Pinterest email and password
  • Image: Select an image file (PNG, JPG, JPEG, GIF, WEBP up to 16MB)
  • Title: Enter a compelling pin title
  • Description: Add a detailed description
  • Board: Specify the exact board name (case-sensitive)
  • Link (Optional): Add a destination URL for click-through traffic

5. Monitoring Progress

  • Watch real-time status updates
  • Check browser logs for detailed progress
  • Screenshots are automatically saved for debugging if issues occur

⚙️ Advanced Configuration

Environment Settings

Create a .env file for secure credential storage (optional):

PINTEREST_EMAIL=your_email@example.com
PINTEREST_PASSWORD=your_password

Headless Mode

Run without browser GUI by modifying pinterest_automation.py:

# In the _setup_driver method, set headless=True
options.add_argument('--headless')

Custom Upload Directory

Modify upload path in app.py:

app.config['UPLOAD_FOLDER'] = 'custom_uploads'

Logging Configuration

Adjust logging levels in app.py and pinterest_automation.py:

logging.basicConfig(level=logging.DEBUG)  # For verbose output

🔧 Technical Architecture

Core Components

  1. Flask Web Server (app.py)

    • RESTful API endpoints for pin operations
    • File upload handling and validation
    • Session management and error handling
  2. Pinterest Automation Engine (pinterest_automation.py)

    • Selenium WebDriver automation
    • Multi-method element detection
    • Human behavior simulation
    • Comprehensive error recovery
  3. Web Interface (templates/index.html)

    • Modern Bootstrap 5 UI
    • Real-time progress indicators
    • Responsive design for all devices

Automation Strategies

Login Process

  • Multiple login form detection methods
  • CAPTCHA and security challenge handling
  • Session persistence and validation

Image Upload

  • Drag-and-drop and file input support
  • Multiple upload trigger methods
  • File validation and processing

Content Setting

  • Advanced form field detection
  • React/JavaScript event simulation
  • Cross-browser compatibility

Board Selection

  • Pinterest's new board-row structure support
  • Legacy dropdown fallbacks
  • Fuzzy matching for board names

Publish Button Detection

  • 17 different button detection methods
  • JavaScript execution fallbacks
  • Success verification systems

🛠️ Troubleshooting Guide

Common Issues & Solutions

1. Login Problems

Symptoms: Login fails or hangs

Solutions:
✅ Verify credentials are correct
✅ Disable 2FA temporarily (not supported)
✅ Clear browser data/cookies
✅ Try running in non-headless mode
✅ Check for Pinterest security notifications

2. Element Detection Failures

Symptoms: "Could not find element" errors

Solutions:
✅ Pinterest updated their website - automation will adapt
✅ Check debug screenshots in project folder
✅ Verify internet connection stability
✅ Update Chrome browser to latest version

3. Upload Failures

Symptoms: Image upload doesn't work

Solutions:
✅ Ensure image is under 16MB
✅ Use supported formats (PNG, JPG, JPEG, GIF, WEBP)
✅ Check file isn't corrupted
✅ Verify sufficient disk space

4. Board Selection Issues

Symptoms: Board not found or selected

Solutions:
✅ Use exact board name (case-sensitive)
✅ Ensure board exists in your Pinterest account
✅ Check board isn't private/restricted
✅ Try creating a new test board

Debug Features

Screenshot Capture

Automatic screenshots are saved when errors occur:

  • board_dropdown_debug_*.png - Board selection issues
  • publish_debug_*.png - Publish button problems
  • final_publish_failure_*.png - Upload failures

Verbose Logging

Check pinterest_bot.log for detailed operation logs:

tail -f pinterest_bot.log  # Monitor real-time logs

Test Mode

Use individual test functions:

# Test login only
result = pinterest_bot.test_login(email, password)

# Get available boards
boards = pinterest_bot.get_user_boards(email, password)

🔒 Security & Best Practices

Credential Security

  • Never commit credentials to version control
  • ✅ Use environment variables or secure config files
  • ✅ Consider OAuth integration for production use
  • ✅ Rotate passwords regularly

Rate Limiting & Compliance

  • ⏱️ Built-in human-like delays (2-5 seconds between actions)
  • 📊 Respects Pinterest's rate limits
  • 🤖 Anti-detection measures to avoid bot flags
  • ⚖️ Important: Comply with Pinterest's Terms of Service

Data Privacy

  • 🗑️ Uploaded images automatically deleted after processing
  • 🔐 Credentials stored only in memory during execution
  • 📝 Logs contain no sensitive information
  • 🛡️ No data transmitted to external servers

📊 Performance & Limitations

Performance Metrics

  • ⚡ Average pin upload time: 30-60 seconds
  • 🔄 Success rate: 95%+ with retry mechanisms
  • 💾 Memory usage: ~100-200MB during operation
  • 🌐 Network: Minimal bandwidth usage

Current Limitations

  • 🔐 Two-Factor Authentication (2FA) not supported
  • 📱 Mobile Pinterest interface not supported
  • 🏷️ Advanced Pinterest features (Story Pins, Idea Pins) not included
  • 📈 Bulk upload requires individual processing
  • 🌍 Tested primarily on English Pinterest interface

Browser Compatibility

  • ✅ Google Chrome (recommended)
  • ✅ Chromium-based browsers
  • ❌ Firefox, Safari, Edge (not tested)

🔄 Project Structure

Pinterest Bot/
├── 📄 app.py                    # Flask web application
├── 🤖 pinterest_automation.py   # Core automation engine
├── 📋 requirements.txt          # Python dependencies
├── 🚀 start.bat                # Windows startup script
├── 📖 README.md                # This documentation
├── 🚫 .gitignore               # Git ignore rules
├── 📁 templates/
│   └── 🎨 index.html           # Web interface
├── 📁 uploads/                 # Temporary file storage
└── 📊 pinterest_bot.log        # Application logs

🤝 Contributing

We welcome contributions! Here's how to help:

Getting Started

  1. 🍴 Fork the repository
  2. 🌟 Create a feature branch: git checkout -b feature/amazing-feature
  3. 💻 Make your changes
  4. ✅ Test thoroughly
  5. 📝 Update documentation if needed
  6. 🚀 Submit a pull request

Areas for Improvement

  • 🔐 OAuth2 authentication integration
  • 📱 Mobile Pinterest interface support
  • 🏷️ Advanced Pinterest features (Story Pins, etc.)
  • 🌍 Multi-language interface support
  • 📊 Analytics and reporting features
  • 🔄 Bulk upload capabilities

Code Standards

  • Follow PEP 8 Python style guidelines
  • Add comments for complex logic
  • Include error handling for new features
  • Update tests for any changes

📋 Dependencies

Python Packages

flask==3.1.1           # Web framework
selenium==4.15.2       # Browser automation
werkzeug==3.1.3       # WSGI utilities
requests==2.32.3       # HTTP library

System Requirements

  • Python: 3.7 or higher
  • Chrome: Latest version (auto-updated)
  • RAM: Minimum 4GB (8GB recommended)
  • Storage: 100MB free space
  • Network: Stable internet connection

🐛 Known Issues & Roadmap

Known Issues

  • Occasional Pinterest layout changes may require updates
  • Large images (>10MB) may take longer to process
  • Network timeouts on slow connections

Future Enhancements

  • OAuth2 authentication
  • Bulk upload functionality
  • Scheduled posting
  • Analytics dashboard
  • Mobile app interface
  • Multi-account support

⚖️ Legal & Disclaimer

Terms of Use

This tool is provided for educational and personal use only. Users must:

  • ✅ Comply with Pinterest's Terms of Service
  • ✅ Respect copyright and intellectual property rights
  • ✅ Use responsibly and ethically
  • ✅ Not use for spam or malicious purposes

Liability

The developers are not responsible for:

  • 🚫 Account suspensions or bans
  • 🚫 Content policy violations
  • 🚫 Data loss or system damage
  • 🚫 Any misuse of this software

Use at your own risk and responsibility.

📞 Support & Contact

Getting Help

  1. 📖 Check this README first
  2. 🔍 Search existing GitHub issues
  3. 📊 Review log files for error details
  4. 🐛 Create a new issue with:
    • Error description
    • Log file excerpts
    • System information
    • Steps to reproduce

Community

  • 💬 GitHub Discussions for questions
  • 🐛 GitHub Issues for bug reports
  • 🚀 Pull Requests for contributions

📄 License

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


Made with ❤️ for the Pinterest community

Happy Pinning! 📌

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 78.3%
  • HTML 21.1%
  • Batchfile 0.6%