Seratih/tiktok-video-editor-asisten
0
๐ฌ TikTok Video Editor Assistant
Gradio app that downloads clips from TikTok / Instagram / Threads / YouTube, edits them into a vertical (1080x1920) TikTok-ready MP4 with ffmpeg transitions, chats with a 9router LLM assistant, and ships the result to a Telegram channel.
Deployed as a Hugging Face Space (Docker SDK). Source lives in GitHub (auto-mirrored).
See `docs/PRD.md` for the full product spec.
Quick start (local)
git clone https://github.com/arkydarmalik-coder/tiktok-video-editor-asisten
cd tiktok-video-editor-asisten
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
# system deps: ffmpeg + ffprobe
cp .env.example .env
# fill in NINEROUTER_API_KEY, TELEGRAM_BOT_TOKEN, TELEGRAM_CHAT_ID
python app.pyThen open <http://localhost:7860>.
Deploy to a new HF Space
- Click New Space on <https://huggingface.co/new-space>.
- SDK: Docker ยท Hardware: CPU basic (free) is enough for short clips.
- Repo source:
arkydarmalik-coder/tiktok-video-editor-asisten(this repo). - Once created, open Settings โ Variables and secrets and add:
NINEROUTER_API_KEYTELEGRAM_BOT_TOKENTELEGRAM_CHAT_IDCLOUDFLARE_WORKER_URL(optional, for keep-alive)- The Space builds the Docker image and starts
python app.pyon port 7860.
Cloudflare Worker keep-alive (optional)
A tiny Worker that returns 200 OK on GET /ping. Schedule a cron trigger every ~5 minutes to hit the Space URL. Without this, the HF Space will cold-start after ~15 minutes of inactivity.
// workers/tvea-ping.js
export default {
async scheduled(event, env, ctx) {
await fetch("https://<your-space>.hf.space/");
},
async fetch() {
return new Response("pong", { status: 200 });
},
};Project layout
.
โโโ app.py # Gradio UI + pipeline orchestration
โโโ Dockerfile # python:3.11-slim + ffmpeg
โโโ requirements.txt
โโโ README.md
โโโ docs/PRD.md # Full product spec
โโโ .env.example # Template for local secrets
โโโ .gitignore
โโโ src/
โโโ config.py # env-driven settings
โโโ downloader.py # yt-dlp wrapper
โโโ ffmpeg_utils.py # filter graphs + concat
โโโ nine_router.py # OpenAI-compatible LLM client
โโโ telegram_sender.py # Bot API client
โโโ keepalive.py # Cloudflare ping helperLicense
MIT
