An r/webscraping post: browser-side video clipper hit Supabase IP-level YouTube firewall blocks. This walks the architecture-level fix.
Prerequisites
- Existing video tool on Supabase or similar host
- Decision: do you need bytes or just metadata?
- Scavio API key
Walkthrough
Step 1: Audit current architecture
Where is the YouTube fetch happening? What does the product actually need?
// Trace: client uploads URL → server fetches video bytes.
// What does the product need: bytes for transcoding? metadata + transcript for clip moments?Step 2: Reframe: most clip-tool UX needs metadata, not bytes
Iframe playback + transcript timestamps is local-first AND avoids firewall.
// User-facing UX: playback in iframe; clip moments built from transcript timestamps.Step 3: Metadata path: Scavio YouTube endpoint
Server fetches typed JSON.
import requests, os
H = {'x-api-key': os.environ['SCAVIO_API_KEY']}
def get_meta(video_url):
return requests.post('https://api.scavio.dev/api/v1/search', headers=H, json={'platform': 'youtube', 'url': video_url, 'include_transcript': True}).json()Step 4: Front-end: iframe + transcript-driven clip UX
Local-first preserved.
// React: <iframe src={`https://www.youtube.com/embed/${id}?start=${start}&end=${end}`} />Step 5: Bytes path (only if needed): edge worker + residential proxy
Cloudflare/Vercel Edge + Bright Data/Oxylabs.
// Cloudflare Worker: fetch with proxy headers.Step 6: Cache aggressively
Cache transcripts per video URL.
// Cache key: youtube:{video_id} → expire 7 days.Step 7: Verify Supabase no longer hits the firewall
Tail logs.
# Tail server logs for 7 days. Expect zero blocked errors.Python Example
# Per-month: 1K videos × Scavio metadata calls = under $30 Project tier.JavaScript Example
// Same shape in Node.Expected Output
Local-first clip tool architecture with no Supabase IP firewall fights.