TikTok Streak Bot
Automates sending a daily message to maintain TikTok streaks. Built to survive silent UI updates, iframe blocks, and run reliably on cheap Low RAM VPS instances.
Core Mechanics
- Smart Verification: TikTok frequently drops messages silently. The bot doesn't just hit enter; it checks if the input box actually cleared. If not, it refreshes and retries.
- Iframe Bypass: TikTok recently started hiding the DM interface inside iframes. The bot detects this and automatically switches context.
- Low-RAM Optimized: Forces single-process mode, disables images/GPU, and uses
/dev/shmworkarounds to prevent Out-Of-Memory (OOM) crashes on Low RAM VPS environments. - Process Management: Automatically kills lingering zombie
chromedriverorchromeprocesses before and after runs. No memory leaks over time.
1. Initial Setup (All Platforms)
-
Clone the Repo:
git clone https://github.com/thetrekir/tiktok-streak-bot.git cd tiktok-streak-bot -
Get Your Cookies:
- Log in to TikTok in your browser.
- Use an extension like Cookie-Editor to export your cookies for the
tiktok.comdomain. - Save the JSON data into a file named
cookies.jsonin the bot's root directory.
-
Configure: Run the bot once or create
config.jsonmanually:{ "TEST_MODE": false, "TARGET_USERS": ["username1", "username2"], "MESSAGE_TO_SEND": "husky", "TARGET_SEND_TIME_HM": [0, 2], "COOKIES_FILE": "cookies.json", "LOG_FILENAME": "tiktok_bot.txt", "HEADLESS_MODE": true }TEST_MODE:trueignores the schedule and runs immediately. Useful for debugging.TARGET_SEND_TIME_HM:[Hour, Minute]in 24-hour format (e.g.,[0, 2]= 00:02 AM).
2. Deployment Options
Choose how you want to run the bot based on your environment.
Option A: Docker (Recommended for Linux VPS)
The cleanest way to run this on a server. It packages its own Chrome binaries and dependencies.
- Ensure your
cookies.jsonandconfig.jsonare in the project root (or inside the/datadir if you have it mounted). - Edit your timezone in
docker-compose.ymlif necessary. - Build and run in the background:
docker compose up -d --build - View logs:
docker compose logs -f
Option B: Windows Background Service (.exe)
If you use a Windows PC and want the bot to run completely hidden in the background, surviving reboots.
- Download the latest
tiktok-bot.exefrom the Releases tab. - Put the
.exe,config.json, andcookies.jsonin a folder (e.g.,C:\TikTokBot). - Download NSSM, extract
nssm.exe(win64). - Open Command Prompt as Admin and run:
nssm install TikTokStreakBot - In the NSSM GUI, set the Path to your
tiktok-bot.exe. Click Install service. - Start the service:
sc start TikTokStreakBotThe bot will now run silently every time your PC turns on. Check
tiktok_bot.txtfor logs.
Option C: Manual Python Execution (Mac/Linux/Windows)
If you just want to run the script directly.
- Install requirements:
pip install -r requirements.txt - Run it:
python main.py(For a background run on Windows without a console window, use
pythonw.exe main.py)
Logs & Debugging
The bot writes all operations, retries, and errors to tiktok_bot.txt (or whatever you named it in config.json). If a message fails, check this log. It will tell you if the element wasn't found, if it got stuck in an iframe, or if the cookie expired.