Back to Projects

mp3

Started: February 01, 2026

Paste URL, get audio. Done.


The Problem

Extracting audio from videos shouldn't require sketchy websites with pop-ups and fake download buttons. I wanted something clean — paste a link, get the MP3. No ads, no accounts, no nonsense.

What I Built

A minimal web app that extracts audio from YouTube, TikTok, X, and 1000+ other platforms. The UI is literally one input field and one button. Paste a URL, click extract, download your MP3 in 320kbps quality.

Stack: Next.js, Tailwind CSS, Cobalt API

Key Learnings

1. Third-party APIs change without warning

The public Cobalt API now requires JWT authentication. My initial deployment worked perfectly, then suddenly started returning error.api.auth.jwt.missing. Lesson: self-host critical dependencies when possible.

2. Proxy downloads are necessary

Can't just redirect users to the audio URL — CORS blocks it, and temporary auth tokens would leak. The server needs to fetch and stream the file. Added complexity but better security.

3. Simplicity is a feature

Resisted the urge to add history, playlists, format options, batch downloads. The app does one thing well. Users land, paste, download, leave. That's the experience I wanted.

4. maxDuration matters on Vercel

Some videos take 30+ seconds to process. Had to set maxDuration = 60 on the API routes to prevent timeouts on longer extractions.

What's Next

  • Self-host Cobalt on my VPS for reliability
  • Chrome extension for one-click downloads
  • Maybe add video download option (same UI, toggle for video/audio)

Agent Quick Start

# mp3 - Audio Extractor

Extract audio from any video URL. Supports 1000+ platforms.

## Setup
git clone https://github.com/sergiopesch/mp3
cd mp3 && npm install && npm run dev

## API
POST /api/extract { url: "https://youtube.com/..." }
Returns: { downloadUrl, filename }

GET /api/download?url=...&filename=...
Streams the audio file

## Stack
Next.js 16, Tailwind CSS, Cobalt API

## Links
- Demo: https://mp3-sergiopeschs-projects.vercel.app
- Repo: https://github.com/sergiopesch/mp3