How l-portet/tiktok-warmup-bot works
Project Type and Purpose
• Type: Open-source Node.js command-line automation tool.
• Purpose: Warm up a TikTok account by automating “swipe,” “like,” “open comments,” etc., via iOS Voice Control using pre-generated MP3 voice-action files.
File Structure
• Root files:
– index.js (main application logic)
– package.json / package-lock.json (dependencies & scripts)
• Asset folder:
– voice-actions/ (contains MP3 files for each voice command)
• Config & scripts:
– README.md for usage instructions
– LICENSE.md for license terms
Key Components
a. Configuration & CLI Layer
– index.js reads command-line flags (--duration, --sequence)
– Exposes ENV or in-code constants (VOICE_ACTIONS config)
b. Scheduler & Action-Selection Module
– Default “swipe next” loop
– Randomized intervals for other actions (likePost, openComments, etc.)
c. Asset Manager
– voice-actions folder holding MP3 files
– Mapping between action names and MP3 file paths
d. Audio Playback Engine
– Uses OS command (e.g., ffplay, afplay, or Node audio module) to play MP3
e. OS Voice Control Interface
– iOS Voice Control listens for played audio
– Translates audio to touch events in the TikTok app
f. TikTok Application (External System)
– Receives touch events and updates UI accordingly
g. External Dependencies
– ElevenLabs (used at generation time for voice clips)
– Node.js runtime
Relationships & Data Flow
1) User invokes npm start -- --duration=30 --sequence=…
2) index.js parses flags → sets duration & sequence
3) Scheduler selects next action based on intervals or explicit sequence
4) Asset Manager retrieves corresponding MP3 from voice-actions/
5) Audio Playback Engine plays MP3 through speakers
6) iOS Voice Control hears the command → injects the corresponding UI event into TikTok
7) TikTok UI transitions (swipe, like, open comments, etc.)
8) Scheduler resets intervals & repeats until duration elapses
Architectural Patterns & Principles
• Modular Separation:
– CLI/Config, Scheduler, Asset Management, Playback are distinct modules
• Event-Driven Loop:
– Each voice action is an “event” scheduled at random intervals
• Extensibility Points:
– New actions: drop a new MP3 into voice-actions/ and add mapping in index.js
– Configuration flags: easily add new flags for frequency control
Putting It All Together
• Top-left: User & CLI invocation
• Middle tier (left to right):
[Configuration & CLI Parser] → [Scheduler & Logic] → [Asset Manager] → [Audio Playback Engine]
• Bottom tier:
[iOS Voice Control] → [TikTok App on Device]