Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

🎙️ TikTok & Instagram Transcription Bot

A Telegram bot that downloads TikTok and Instagram videos and transcribes their audio — 100% free, runs locally using OpenAI Whisper.

How it works

  1. User sends a TikTok or Instagram link to the bot
  2. Bot downloads the audio using yt-dlp (free, open source)
  3. Bot transcribes it using OpenAI Whisper (runs on your machine, no API key needed)
  4. Bot replies with the transcription text

🛠️ Setup

Prerequisites

  • Python 3.9+
  • ffmpeg installed on your system
  • A Telegram Bot Token (free, from @BotFather)

Install ffmpeg

Ubuntu/Debian:

sudo apt install ffmpeg

macOS:

brew install ffmpeg

Windows: Download from https://ffmpeg.org/download.html and add to PATH.


Step 1: Create your Telegram bot

  1. Open Telegram and search for @BotFather
  2. Send /newbot
  3. Follow the prompts to name your bot
  4. Copy the API token you receive

Step 2: Install dependencies

# Clone or download this project
cd tiktok_ig_transcriber_bot

# Create a virtual environment (recommended)
python -m venv venv
source venv/bin/activate   # Windows: venv\Scripts\activate

# Install Python packages
pip install -r requirements.txt

⚠️ First install will download PyTorch (~1GB). This is a one-time download.


Step 3: Set your bot token

# Copy the example env file
cp .env.example .env

# Edit .env and add your bot token
# TELEGRAM_BOT_TOKEN=123456789:ABCdef...

Then load it before running:

# Linux/Mac
export TELEGRAM_BOT_TOKEN="your_token_here"

# Windows (Command Prompt)
set TELEGRAM_BOT_TOKEN=8613704159:AAGxAKLobIzv6lRawRkilGc-hyUoVmrBG0M

# Windows (PowerShell)
$env:TELEGRAM_BOT_TOKEN="your_token_here"

Step 4: Run the bot

python bot.py

You should see:

INFO - Whisper model loaded.
INFO - Bot is running...

Now open Telegram, find your bot, and send it a TikTok or Instagram link!


🐳 Docker (optional, easier deployment)

# Build the image (includes ffmpeg + pre-downloaded Whisper model)
docker build -t transcriber-bot .

# Run it
docker run -e TELEGRAM_BOT_TOKEN="your_token_here" transcriber-bot

⚙️ Configuration

Environment Variable Default Description
TELEGRAM_BOT_TOKEN (required) Your bot token from BotFather
WHISPER_MODEL base Whisper model size (see below)

Whisper model sizes

Model RAM needed Speed Accuracy
tiny ~1 GB Fastest Basic
base ~1 GB Fast Good ✅
small ~2 GB Medium Better
medium ~5 GB Slow Great
large ~10 GB Slowest Best

For most use cases, base is the sweet spot.


🚀 Free hosting options

Want to run this 24/7 for free?

  • Render.com — Free tier, deploy with Docker
  • Railway.app — Free tier available
  • Fly.io — Free tier with enough resources for tiny/base model
  • Oracle Cloud Free Tier — Permanent free VMs (ARM, 4 cores, 24GB RAM)
  • Your own PC/Raspberry Pi — Run it at home

⚠️ Note: Cloud free tiers often have limited RAM. Use WHISPER_MODEL=tiny for tighter limits.


⚠️ Limitations

  • Private videos cannot be downloaded (must be public)
  • Instagram sometimes blocks downloads depending on the account's privacy settings
  • Very long videos (10+ min) may take a few minutes to transcribe
  • TikTok occasionally changes its download mechanism; update yt-dlp if issues arise:
    pip install -U yt-dlp

📦 Dependencies

Package Purpose Cost
python-telegram-bot Telegram bot framework Free
yt-dlp Download TikTok/IG video/audio Free
openai-whisper Speech-to-text transcription Free (runs locally)
ffmpeg Audio processing Free

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages