Skip to content

Latest commit

Β 

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸŽ™οΈ Instagram Reel & Post Transcriber (Instagramtranscript)

Live Web Application: https://instagramtranscript.web.app
GitHub Repository: https://github.com/Mrswami/instagramTranscript.git

An end-to-end Python Media Pipeline, REST API, Streamlit Web Application, and CLI tool that extracts high-quality 192kbps MP3 audio from any Instagram Reel or Post link and distills it into copyable text transcripts, SRT subtitles, WebVTT captions, and structured JSON data using OpenAI's Whisper AI engine.

CI Pipeline Python Streamlit Flask Whisper Firebase License


🌐 Live Web Application

Access the live, high-performance web client instantly:
πŸ‘‰ https://instagramtranscript.web.app

The web client features a dark-mode glassmorphism design built for desktop and mobile devices. It connects directly to local or cloud-hosted Python REST backend instances to extract media and process speech-to-text transcriptions in real time.


✨ Key Features

  • πŸ”— Instagram Video Audio Extraction: Seamlessly extracts audio streams from short or long (3+ minutes) Instagram Reel or Post URLs.
  • 🎧 High-Quality MP3 Encoding: Converts video tracks into standardized 192kbps 44.1kHz MP3 files using FFmpeg.
  • 🧠 AI Speech-to-Text Engine: Leverages local OpenAI Whisper AI models (tiny, base, small, medium) for speech recognition.
  • πŸ“‹ 1-Click Copy Transcript: Interactive interface to copy raw transcript text or timestamped lines with one click.
  • πŸ“‚ Multi-Format Caption Exporter: Save transcript outputs as .txt, .srt (SubRip), .vtt (WebVTT), and .json data.
  • 🌐 Dual Web Interfaces:
    • Firebase Web Dashboard: Glassmorphism web UI hosted at https://instagramtranscript.web.app.
    • Streamlit Web App: Local/cloud interactive dashboard (streamlit run app.py).
  • ⚑ Flask REST API: Production-ready HTTP API server (server.py) with cross-origin support (CORS).
  • πŸ’» Terminal CLI: Execution script (cli.py) for quick command-line processing.
  • πŸ›‘οΈ Multi-Provider Fallback Pipeline: Resilience through fallback engines (yt-dlp -> HTTP extraction APIs -> Netscape cookies.txt).

πŸ—οΈ System Architecture & Workflow

       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
       β”‚             User Submits Instagram Link                β”‚
       β”‚  (Web UI / Streamlit Dashboard / Flask API / Terminal)  β”‚
       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                   β”‚
                                   β–Ό
       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
       β”‚           InstagramTranscriber Engine                  β”‚
       β”‚   1. Validate URL & Extract Shortcode                  β”‚
       β”‚   2. Multi-Provider Audio Stream Downloader             β”‚
       β”‚      └─ Provider 1: yt-dlp (with cookies support)    β”‚
       β”‚      └─ Provider 2: Direct HTTP Extractor API          β”‚
       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                   β”‚
                                   β–Ό
       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
       β”‚             FFmpeg Audio Transcoder                    β”‚
       β”‚    Converts media binary -> 192kbps MP3 audio          β”‚
       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                   β”‚
                                   β–Ό
       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
       β”‚             OpenAI Whisper AI Engine                   β”‚
       β”‚  Speech-to-Text Inference (tiny/base/small/medium)     β”‚
       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                   β”‚
                                   β–Ό
       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
       β”‚                 Generated Outputs                      β”‚
       β”‚  β€’ Raw Text Transcript  β€’ Timestamp Breakdown          β”‚
       β”‚  β€’ SubRip (.srt)        β€’ WebVTT (.vtt) β€’ JSON Data   β”‚
       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸš€ Quick Start & Local Setup

1. Prerequisites

  • Python 3.9 - 3.11
  • FFmpeg (automatically configured via imageio_ffmpeg or system PATH)

2. Installation

git clone https://github.com/Mrswami/instagramTranscript.git
cd instagramTranscript
pip install -r requirements.txt

πŸ’» Usage Guides

Option A: Run Streamlit Web Application

Launch the interactive Streamlit dashboard:

streamlit run app.py

Open http://localhost:8501 in your browser.

Option B: Run Flask REST API Backend

Launch the backend server:

python server.py

The REST API runs on http://localhost:5000.

Option C: Run Terminal CLI Tool

Transcribe directly from your command line:

python cli.py "https://www.instagram.com/reel/Cxxxxxx/" --model base --outdir output

CLI Parameters:

  • url: Instagram Reel or Post link.
  • --model: Whisper model size (tiny, base, small, medium). Default: base.
  • --outdir: Directory to store generated MP3 and transcript files. Default: output.

πŸ“‘ REST API Documentation

1. Health Check

  • Endpoint: GET /health or GET /
  • Response:
    {
      "service": "Instagramtranscript API Engine",
      "status": "ok",
      "version": "1.0.0"
    }

2. Transcribe Link

  • Endpoint: POST /api/transcribe
  • Headers: Content-Type: application/json
  • Request Body:
    {
      "url": "https://www.instagram.com/reel/Cxxxxxx/",
      "model": "base"
    }
  • Success Response (200 OK):
    {
      "status": "success",
      "text": "Full transcribed speech text...",
      "segments": [
        {
          "start": 0.0,
          "end": 3.42,
          "text": "First spoken segment"
        }
      ],
      "srt": "1\n00:00:00,000 --> 00:00:03,420\nFirst spoken segment\n",
      "vtt": "WEBVTT\n\n00:00:00.000 --> 00:00:03.420\nFirst spoken segment\n",
      "audio_file": "output/Cxxxxxx.mp3"
    }

πŸ“‚ Repository File Structure

instagramTranscript/
β”œβ”€β”€ app.py              # Streamlit Web App interface with glassmorphism design
β”œβ”€β”€ server.py           # Flask REST API backend server with pre-loading & CORS
β”œβ”€β”€ cli.py              # Command-line interface tool
β”œβ”€β”€ transcriber.py      # Core media downloader, FFmpeg transcoder & Whisper AI pipeline
β”œβ”€β”€ ISSUES.md           # QA testing report, latency performance benchmarks & resolved issues
β”œβ”€β”€ DEPLOYMENT.md       # Cloud deployment instructions (Render, Railway, Google Cloud Run)
β”œβ”€β”€ Dockerfile          # Container specification for cloud hosting
β”œβ”€β”€ firebase.json       # Firebase Hosting configuration
β”œβ”€β”€ .firebaserc         # Firebase project target mapping
β”œβ”€β”€ render.yaml         # Render cloud service deployment configuration
β”œβ”€β”€ requirements.txt    # Python dependency manifest
β”œβ”€β”€ public/             # Static web assets for live Web App
β”‚   β”œβ”€β”€ index.html      # Responsive glassmorphism web client with health indicator
β”‚   └── logo.jpg        # Brand logo asset
└── output/             # Output folder for generated MP3s and transcripts


☁️ Deployment

  • Frontend Hosting (Firebase): Configured in firebase.json for rapid deployment to https://instagramtranscript.web.app.
  • Backend Cloud Hosting (Render / Docker): Deploy Dockerfile directly to Render, Railway, or Google Cloud Run. See DEPLOYMENT.md for step-by-step guidance.

πŸ“œ License

MIT License - Free and open-source for developers, creators, and researchers.

About

take a url and download the audio to instagram reel or post turn it into mp3 and distill transcript

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages