LAB/012025-2026Active
G2tiktokWork, the video factory
A script sent on Telegram comes back as an edited, voiced, word-by-word subtitled vertical video, ready to publish.


heard = [_normalize(w["word"]) for w in words]
target = [_normalize(t) for t in ref_tokens]
matcher = difflib.SequenceMatcher(a=heard, b=target, autojunk=False)
for tag, i1, i2, j1, j2 in matcher.get_opcodes():
count = j2 - j1
if count == 0:
continue # Whisper a entendu des mots absents du script.
if tag == "equal":
for k in range(count):
aligned.append(
{
"word": ref_tokens[j1 + k],
"start": words[i1 + k]["start"],
"end": words[i1 + k]["end"],
}
)- main.pyTelegram bot: menu, niches, accounts, quick import
- modules/ai_generator.pyOpenAI script and hook, ElevenLabs voice with fallback
- modules/transcriber.pyWord-level Whisper, aligned onto the script
- modules/media_sourcing.pyRoyalty-free footage fetched by keywords
- modules/video_processor.pyCut plan timed on the voice's pauses
- modules/visual_effects.pyASS karaoke subtitles, music, FFmpeg render
- Telegram Bot APIInterface, accounts and credits
- OpenAIScript and hook generation
- ElevenLabsSynthetic voice, edge-tts fallback
- Pexels / PixabayRoyalty-free footage libraries
- FFmpegEditing and 1080×1920 render
- L0SurfaceReal capture
- L1CodeAligning the words Whisper heard onto the script
- L2Modules6 files from the repository
- L3Services5 services called
Design and development, solo
G2 reads "Go to". G2tiktokWork is the centrepiece of the family: a Telegram bot you give a niche and an idea, and which returns a finished 1080×1920 video. In between, a Python chain: generated script and hook, ElevenLabs speech with a local fallback, royalty-free background footage picked by keywords, Whisper transcription to align every subtitle word, beat-cut editing and FFmpeg rendering.
In Telegram the menu fits in four buttons: My Niches, New Niche, My Account, Quick Import. Each niche has its JSON configuration: voice, price range, its own footage. Users have accounts and credits in SQLite, backed up daily; the history of renders and used hooks avoids producing the same thing twice.
Actual state: in service, about sixty videos rendered. Publishing stays manual: that is G2TiktokAutopost's job.
Python, python-telegram-bot, OpenAI, ElevenLabs, faster-whisper, MoviePy, FFmpeg


