A powerful Flask-based social media automation tool that manages authentication cookies, generates dynamic post images, and schedules content across multiple platforms with human-like behavior to avoid detection.
- Secure cookie storage for each platform in separate
.pklfiles - Automatic cookie validation and refresh
- Platform-specific authentication handling
- PIL-based image generation with custom templates
- Dynamic text injection with website metrics
- Professional post templates with branding
- Randomized delays between actions
- Real browser headers and user agents
- WebDriver detection avoidance
- Natural behavior simulation
- LinkedIn - Professional networking posts
- Facebook - Social media engagement
- Twitter - Microblogging and updates
- Instagram - Visual content sharing
- Time-based post scheduling
- Missed schedule recovery on restart
- Multiple daily schedules support
- Automatic Google Sheets integration
- Multiple customizable post templates
- Dynamic content insertion
- Preview functionality
- Brand-consistent styling
- Python 3.8 or higher
- Google Chrome/Chromium browser
- Clone the repository
git clone https://github.com/AliMurtazaAMJ/PostPilot.git
cd PostPilot- Install dependencies
pip install -r requirements.txt- Install Playwright browsers
playwright install chromium- Create required directories
mkdir -p cookies posts/images templates- Run the application
python main.py- Open your browser
http://localhost:5000
flask==2.3.3
html2image==2.0.4.3
playwright==1.40.0
requests==2.31.0
psutil==5.9.6
Pillow>=8.0.0
- Navigate to the web interface at
http://localhost:5000 - Click "Accounts" in the top-right corner
- View all supported platforms with their login status
- Click "Login" for any platform to authenticate
- Complete the manual login process in the opened browser
- Cookies are automatically saved for future use
- Select Template: Choose from available post templates
- Choose Platforms: Select target social media platforms
- Configure Data Source: Connect your Google Sheets data source
- Click "Post Scheduler" to manage schedules
- Create new schedules with specific times
- System automatically posts at scheduled times using saved cookies
- Missed schedules are recovered on application restart
PostPilot/
βββ π main.py # Main Flask application
βββ π index.html # Web interface
βββ π requirements.txt # Python dependencies
βββ πΌοΈ template.png # Base image template
βββ πͺ cookies/ # Cookie storage
β βββ linkedin.pkl # LinkedIn authentication
β βββ facebook.pkl # Facebook authentication
β βββ twitter.pkl # Twitter authentication
β βββ instagram.pkl # Instagram authentication
βββ π posts/ # Generated content
β βββ πΌοΈ images/ # Generated post images
β βββ βοΈ config.json # Application configuration
β βββ π history.json # Post history tracking
β βββ β° schedules.json # Scheduled posts
β βββ π last_run.json # Last execution tracking
βββ π templates/ # Post templates (future expansion)
Update the SHEET_URL in main.py with your Google Apps Script URL:
SHEET_URL = 'https://script.google.com/macros/s/YOUR_SCRIPT_ID/exec'Modify template.png or add new templates in the templates/ directory. The system supports:
- Dynamic text injection
- Website metrics display (DA, DR, Traffic)
- Brand-consistent styling
Test your saved cookies for any platform:
# Test specific platform cookies
curl http://localhost:5000/test-login/linkedin
curl http://localhost:5000/test-login/facebookVerify browser automation:
curl http://localhost:5000/test-browser- Anti-Detection: Advanced techniques to avoid bot detection
- Secure Storage: Encrypted cookie storage with platform isolation
- Rate Limiting: Human-like delays between actions
- User Agent Rotation: Dynamic browser fingerprinting
- Headless Prevention: Runs in visible browser mode for authenticity
| Endpoint | Method | Description |
|---|---|---|
/ |
GET | Main web interface |
/accounts |
GET | Get platform login status |
/login/<platform> |
GET | Initiate platform login |
/test-login/<platform> |
GET | Test platform cookies |
/schedules |
GET/POST | Manage post schedules |
/schedules/<time> |
DELETE | Remove schedule |
/history |
GET | Get posting history |
/config |
POST | Save configuration |
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
This tool is for educational and legitimate business purposes only. Users are responsible for:
- Complying with platform Terms of Service
- Respecting rate limits and usage policies
- Ensuring content authenticity and quality
- Following applicable laws and regulations
Browser not opening:
# Reinstall Playwright browsers
playwright install chromium --forceCookie authentication fails:
- Clear existing cookies and re-login
- Check platform-specific login requirements
- Verify 2FA settings
Image generation errors:
- Ensure
template.pngexists in root directory - Check PIL/Pillow installation
- Verify font paths for your OS
- π Bug Reports: GitHub Issues
- π‘ Feature Requests: GitHub Discussions
- π§ Email: your.email@example.com
- Playwright for browser automation
- Flask for web framework
- Pillow for image processing
β Star this repository if you find it helpful!