A fully automated TikTok carousel bot that generates and posts 7-slide carousels multiple times per day across multiple accounts.
- Automated Content Generation: Creates 7-slide carousels (1 hook + 5 screenshots + 1 CTA)
- Google Drive Integration: Pulls images from organized Drive folders
- Multi-Account Support: Manages multiple accounts with custom posting schedules
- Zero-Cost Hosting: Deploys on GitHub Actions
- Smart Logging: Discord webhook notifications for success/failure
-
Setup Environment
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate pip install -r requirements.txt
-
Configure Environment
cp .env.example .env # Edit .env with your API keys and credentials -
Test Locally
python src/main.py --once
-
Google Drive API
- Create a Google Cloud Project
- Enable the Google Drive API
- Create a Service Account and download the JSON key
- Share your Drive folders with the service account email
-
Upload-Post API
- Get an API key from https://upload-post.com/
-
Discord Webhook
- Create a webhook in your Discord server
GOOGLE_SERVICE_ACCOUNT_JSON=service-account.json
UPLOAD_POST_API_KEY=up_...-
Create three folders in your Google Drive:
hook-photos- Images for hook slidesproduct-screenshots- Product screenshot imagescta-photos- Images for CTA slides
-
Set Folder Permissions:
- Right-click each folder → Share
- Set to "Anyone with the link can view"
- OR share directly with your service account email
-
Get Folder IDs:
- Open each folder in browser
- Copy the folder ID from the URL:
https://drive.google.com/drive/folders/FOLDER_D_HERE - Update the folder IDs in
src/config.py
-
Fork this repository
-
Add Repository Secrets: Go to Settings → Secrets and variables → Actions, add:
GOOGLE_SERVICE_ACCOUNT_JSON(entire JSON content)UPLOAD_POST_API_KEY
-
Enable Actions:
- Go to Actions tab
- Enable workflows
- The bot will automatically run at the specified times
Edit src/config.py to configure your accounts:
ACCOUNTS = [
{
"name": "@account1", # What you want to call the account
"tiktok_username": "account1", # Tiktok username must match the username specified in upload-post
"post_times": ["07:00", "11:00", "15:00", "19:00"], # When to fire the GitHub Action
"webhook_url": "" # The Discord webhook to send notifications to
},
# Add more accounts...
]Customize your call-to-action texts in src/config.py:
CTA_TEXTS = [
"Follow for more tips! 💫",
"Save this post for later! ✨",
"Which will you try first? 🤔",
# Add more CTAs...
]Configure your Google Drive folder IDs in src/config.py:
DRIVE_FOLDERS = {
"HOOK": "YOUR_HOOK_FOLDER_ID",
"SCREEN": "YOUR_PRODUCT_SCREENSHOTS_FOLDER_ID",
"CTA": "YOUR_CTA_PHOTOS_FOLDER_ID"
}Adjust the number of hashtags to be randomly selected and the predefined list in src/config.py:
HASHTAG_COUNT = 12
ALL_HASHTAGS = [
"#fyp", "#viral", "#trending", # ... more hashtags
]Modify or add to the list of pre-generated hooks in src/config.py:
PREGENERATED_HOOKS = [
"Products that completely changed my skin texture 😭",
# ... more hooks
]Set the timezone for scheduling posts in src/config.py:
TIMEZONE = "America/Toronto"Customize text appearance on slides in src/config.py. Separate settings for general text, hooks, and CTAs:
TEXT_SETTINGS = {
"font_size": 56,
"font_color": (255, 255, 255),
"stroke_color": (0, 0, 0),
"stroke_width": 2,
"y_position_percent": 70,
"max_width_percent": 85,
}
HOOK_TEXT_SETTINGS = {
"font_size": 48,
"font_color": (255, 255, 255),
"stroke_color": (0, 0, 0),
"stroke_width": 2,
"y_position_percent": 70,
"max_width_percent": 85,
}
CTA_TEXT_SETTINGS = {
"font_size": 64,
"font_color": (255, 255, 255),
"stroke_color": (0, 0, 0),
"stroke_width": 2,
"y_position_percent": 50,
"max_width_percent": 85,
}Adjust image quality and retry parameters for API calls in src/config.py:
IMAGE_QUALITY = 90
MAX_RETRIES = 3
RETRY_DELAY = 5 # seconds- Discord Notifications: Success/failure alerts sent to configured webhook
- GitHub Actions Logs: View execution logs in the Actions tab
-
Drive Access Denied
- Verify service account has access to folders
- Check folder sharing settings
-
Upload-Post Failures
- Check API key validity
- Verify image formats and sizes
Run with debug mode:
python src/main.py --once --debugThis repository is a clone of github.com/Julez14/igpt-carousel-content-generator (private) and has been adapted for public use.