Feature request: Instagram Posts (feed/carousel) as a source + WhisperX local transcription fallback for Reels + deep comment sentiment analysis

Author: usmanovbfCreated Aug 13, 2026Updated Sep 28, 2026

Feature Request: Instagram Posts as a Source + WhisperX Local Transcription + Deep Comment Sentiment Analysis

TL;DR

Expand the Instagram source beyond Reels to include Instagram Posts (feed posts, carousels, photo posts) via keyword search, add WhisperX as a local transcription fallback when cloud-based transcript APIs fail or are unavailable, and add deep comment sentiment analysis to surface what people actually think (not just what's most liked).


Problem

Currently, the Instagram source (scripts/lib/instagram.py) only searches Reels via two ScrapeCreators endpoints:

  • /v2/instagram/reels/search (keyword search)
  • /v1/instagram/user/reels (profile-based, --ig-creators)

This misses a massive chunk of Instagram's conversation:

  1. Feed posts and carousels — where brands, creators, and communities share detailed opinions, product reviews, tutorials, and announcements. These often have more thoughtful comments than Reels.
  2. Transcription reliability — the current pipeline relies on ScrapeCreators' /v2/instagram/media/transcript endpoint (#983 reports it frequently fails with Cloudflare 403s). There's no local fallback, so when the cloud transcript API is down, all spoken-word content from Reels is lost.
  3. Comment sentiment — Instagram comments are fetched (PR #751 wired /v2/instagram/post/comments) but only used for ranking/engagement scoring. Comments are a goldmine of unfiltered opinion — people share detailed product experiences, political takes, emotional reactions — and this signal isn't being analyzed for sentiment or summarized into themes.

Proposed Changes

1. Instagram Posts as a Searchable Source

Add support for searching Instagram Posts (not just Reels) via ScrapeCreators or a complementary endpoint.

What's needed:

  • A new search_instagram_posts() function (or extending search_instagram()) that hits a posts-specific ScrapeCreators endpoint (e.g., /v2/instagram/posts/search if available, or /v1/instagram/user/posts for profile-based fetching)
  • _parse_items() already handles generic engagement fields (like_count, comment_count, caption) — may need minor adjustments for post-specific fields (carousel slide count, image URLs, multiple caption segments)
  • A --ig-posts flag or automatic inclusion when INCLUDE_SOURCES=instagram covers both Reels and Posts
  • Date filtering and deduplication (already handled by the merge logic in search_and_enrich())

Why this matters: Instagram Posts are where the detailed conversation happens. A product review carousel from a beauty creator can have 500+ comments with specific product feedback that never appears in a 15-second Reel. Brand announcements, long-form photo captions, and multi-slide tutorials live here — not in Reels.

Open question: Does ScrapeCreators expose a posts search endpoint? If not, the --ig-creators profile fetch could be extended to pull user posts alongside reels (similar to _user_reels() but for /v1/instagram/user/posts).

2. WhisperX as a Local Transcription Fallback

WhisperX is an open-source, locally-runnable speech recognition tool with:

  • 70x realtime batched inference (large-v2 model)
  • Word-level timestamps via wav2vec2 alignment
  • Speaker diarization (multi-speaker identification via pyannote-audio)
  • VAD preprocessing to reduce hallucinations
  • Works on CPU (with --compute_type int8) or GPU

Integration approach:

Current flow:
  fetch_captions() → ScrapeCreators /v2/instagram/media/transcript → transcript text
  
Proposed flow:
  fetch_captions() → ScrapeCreators /v2/instagram/media/transcript → transcript text
                    ↓ (on failure/timeout/missing)
                    → Download audio from Reel URL (yt-dlp)
                    → Run WhisperX locally (whisperx audio.wav --model large-v2)
                    → Parse transcript segments + speaker labels
                    → Return transcript text + optional speaker-attributed segments

What's needed:

  • A TranscriptionBackend abstraction in instagram.py (or a new transcription.py module):
    • CloudTranscriptionBackend — current ScrapeCreators /v2/instagram/media/transcript path
    • WhisperXBackend — local fallback using the whisperx Python package
  • Config flag: TRANSCRIPTION_BACKEND=cloud|local|auto (default: auto = try cloud, fall back to local)
  • Audio download via yt-dlp (already a dependency for YouTube)
  • WhisperX model caching (first run downloads the model, subsequent runs reuse it)
  • GPU detection with CPU fallback (--compute_type int8 --device cpu)
  • Timeout handling (WhisperX on CPU can be slow for long videos — cap at 3 minutes of audio or configurable limit)

Why this matters:

  • Issue #983 shows cloud transcription is unreliable (Cloudflare 403s, no User-Agent header)
  • Issue #829 showed a single transcript 400 error discarding the entire result batch
  • Local transcription is free after initial setup and works regardless of API availability
  • WhisperX's speaker diarization is a unique value-add: knowing who said what in a multi-person Reel or interview clip would dramatically improve synthesis quality

Related: This would benefit YouTube and TikTok transcription too, not just Instagram. The TranscriptionBackend abstraction should be source-agnostic.

3. Deep Comment Sentiment Analysis

Currently, Instagram comments are fetched via /v2/instagram/post/comments and used for:

  • Engagement scoring (comment_like_count → ranking signal)
  • Display in "Top Community Comments" section (PR #751, rank-based diversity)

What's missing: actual analysis of what commenters are saying.

Proposed addition:

For each enriched post (top N by engagement):
  1. Cluster comments by theme/topic (e.g., "price complaints", "love the design", "shipping issues")
  2. Compute per-cluster sentiment (positive/negative/neutral) with confidence
  3. Surface representative quotes per cluster
  4. Generate a "Comment Sentiment Summary" per post:
     - Overall sentiment distribution (72% positive, 18% neutral, 10% negative)
     - Top 3 themes with representative comments
     - Controversial/nuanced takes (mixed-signal comments)
  5. Feed sentiment data into the synthesis: "Commenters on @creator's review post were 
     overwhelmingly positive about the build quality (82% of 340 comments) but 
     frustrated with the $299 price point"

Implementation approach:

  • Use the existing LLM pass (the synthesis step) to cluster and analyze comments — no new model needed
  • Add a sentiment_summary field to each enriched item
  • Include comment sentiment in the brief's output format (new section or inline in item cards)
  • For high-comment posts (>100 comments), sample representative comments across the sentiment distribution rather than just top-liked

Why this matters: Instagram comments are uniquely valuable because:

  • People share detailed, unfiltered opinions (product reviews, emotional reactions, political hot takes)
  • Comment volume is high (posts regularly get 200-2000+ comments)
  • The audience is different from Reddit/X — more diverse demographics, more visual/brand-oriented
  • Comment sentiment patterns (e.g., a product hyped in Reels but panned in post comments) can reveal gaps between marketing and reality

Scope & Phasing

Phase What Effort
P0 WhisperX local transcription fallback (benefits all video sources) Medium
P1 Instagram Posts search endpoint integration Medium (depends on SC API availability)
P1 Comment sentiment analysis (LLM-based, no new model) Low-Medium
P2 WhisperX speaker diarization integration (speaker-attributed transcripts) Low (once WhisperX is wired)
P2 Cross-source comment sentiment comparison (IG vs TikTok vs YouTube for same topic) Medium

Configuration Sketch

bash
# .env or config
TRANSCRIPTION_BACKEND=auto          # cloud | local | auto
WHISPERX_MODEL=large-v2            # base, small, medium, large-v2
WHISPERX_DEVICE=auto               # auto (GPU if available) | cpu | cuda
WHISPERX_MAX_AUDIO_SECONDS=180     # Skip transcription for videos > 3 min

INCLUDE_SOURCES=tiktok,instagram,instagram_posts,youtube_comments,tiktok_comments,instagram_comments

References

  • Current Instagram source: scripts/lib/instagram.py (636 lines)
  • Instagram comments PR: #751 (enrich_with_comments → /v2/instagram/post/comments)
  • Cloud transcription failures: #983 (Groq/Cloudflare 403), #829 (single 400 discards batch)
  • Instagram Reels-only search issue: #957 (profile lane parsing), #986 (404 on keyword search)
  • WhisperX: m-bain/whisperx — 70x realtime, word-level timestamps, speaker diarization

Source: mvanhorn/last30days-skill