Skip to content

kasimlyee/to-audio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

to-audio

A self-hosted web app that converts any video URL (YouTube, and anything yt-dlp supports) to an MP3 download — no accounts, no cloud, runs entirely on your machine.

How it works

Paste a URL, click Download mp3, and the file downloads with the video's original title as the filename.

On first run, the server automatically downloads yt-dlp and ffmpeg into a local bin/ directory. No manual installation required on Windows and macOS. Subsequent runs reuse the cached binaries instantly.

Requirements

  • Go 1.21+
  • Internet access on first run (to fetch yt-dlp and ffmpeg)
  • Linux only: install ffmpeg manually — sudo apt install ffmpeg (or equivalent for your distro)

Getting started

git clone https://github.com/kasimlyee/to-audio
cd to-audio
go run main.go

The server starts at http://localhost:8080 and opens a browser tab automatically.

On first conversion, you will see:

Downloading yt-dlp...
yt-dlp ready.
Downloading ffmpeg...
ffmpeg ready.

After that the bin/ directory is populated and no further downloads happen.

Self-hosting

To run as a persistent server (e.g. on a home server or VPS):

go build -o to-audio main.go
./to-audio

The server listens on :8080. Put it behind a reverse proxy (nginx, Caddy) if you want HTTPS or a custom domain.

Project structure

to-audio/
├── main.go                      # HTTP server, routing, request handling
├── internal/
│   └── converter/
│       └── convert.go           # yt-dlp + ffmpeg orchestration, auto-download
├── static/
│   ├── index.html
│   ├── app.js
│   └── style.css
└── bin/                         # auto-created — yt-dlp and ffmpeg live here

API

The UI talks to a single endpoint. You can call it directly:

curl -X POST http://localhost:8080/convert \
  -H "Content-Type: application/json" \
  -d '{"url": "https://www.youtube.com/watch?v=..."}' \
  --output audio.mp3

License

MIT

About

A self-hosted web app that converts video URL to an MP3 download

Topics

Resources

License

Stars

Watchers

Forks

Contributors