129 lines
3.9 KiB
Markdown
129 lines
3.9 KiB
Markdown
# yt-mp3-ui
|
|
|
|
A self-hosted web app for downloading music as MP3 from YouTube, powered by [yt-dlp](https://github.com/yt-dlp/yt-dlp).
|
|
|
|

|
|

|
|

|
|
|
|
---
|
|
|
|
## About this fork
|
|
|
|
This is a fork of [github.com/Samive/yt-dlp-web](https://github.com/Samive/yt-dlp-web). It changes the upstream video downloader into a focused music downloader. The differences from upstream:
|
|
|
|
- **Music only** — every download is extracted to 320K MP3 with metadata and an embedded thumbnail. The format selector is gone; there is nothing to choose.
|
|
- **French interface** — the whole UI and its messages are in French.
|
|
- **Light and dark mode** — a theme toggle in the header, defaulting to your operating system preference.
|
|
- **Auto-updating yt-dlp** — the latest yt-dlp is pulled on container startup, so downloads keep working as sites change.
|
|
|
|
---
|
|
|
|
## Features
|
|
|
|
- Paste any YouTube (or supported site) URL and fetch track info instantly
|
|
- View thumbnail, title, uploader, duration, views, likes, and upload date
|
|
- One-click download to 320K MP3 with metadata and embedded cover art
|
|
- Live download progress with percentage, speed, and ETA
|
|
- Cancel a download at any time
|
|
- Light and dark themes following your OS preference, with a manual toggle
|
|
|
|
---
|
|
|
|
## Quick Start with Docker Compose
|
|
|
|
```bash
|
|
git clone https://git.riou.xyz/jriou/yt-mp3-ui.git
|
|
cd yt-mp3-ui
|
|
docker compose up -d --build
|
|
```
|
|
|
|
Then open **http://localhost:8000** in your browser.
|
|
|
|
Downloads are written to the `downloads` volume (see `docker-compose.yml`). yt-dlp is upgraded to the latest release each time the container starts.
|
|
|
|
### Stop / remove
|
|
|
|
```bash
|
|
docker compose down -v
|
|
```
|
|
|
|
---
|
|
|
|
## Build from Source
|
|
|
|
### Prerequisites
|
|
|
|
- [Docker](https://docs.docker.com/get-docker/) installed
|
|
|
|
### Build and run
|
|
|
|
```bash
|
|
docker build -t yt-mp3-ui .
|
|
docker run -d -p 8000:8000 \
|
|
--name yt-dlp-ui yt-dlp-ui
|
|
```
|
|
|
|
Open **http://localhost:8000**.
|
|
|
|
---
|
|
|
|
## Run without Docker (Development)
|
|
|
|
### Prerequisites
|
|
|
|
- Python 3.10+
|
|
- ffmpeg installed and on PATH ([download](https://ffmpeg.org/download.html))
|
|
|
|
### Setup
|
|
|
|
```bash
|
|
# Install dependencies
|
|
pip install yt-dlp fastapi "uvicorn[standard]" httpx
|
|
|
|
# Start the server
|
|
python -m uvicorn web.backend.main:app --reload --port 8000
|
|
```
|
|
|
|
Open **http://localhost:8000**.
|
|
|
|
> Auto-update at startup is handled by the container entrypoint. When running the server directly, upgrade yt-dlp yourself with `pip install -U yt-dlp`.
|
|
|
|
---
|
|
|
|
## Usage Guide
|
|
|
|
1. **Paste a URL** — paste any YouTube or supported site link into the input field and click **Rechercher**
|
|
2. **Review track info** — thumbnail, title, uploader, duration, views, likes, and upload date are shown
|
|
3. **Download** — click **Télécharger** and watch the live progress bar. The file is saved as a 320K MP3
|
|
4. **Cancel** — click **Annuler** at any time to stop the download
|
|
|
|
Use the sun/moon button in the header to switch between light and dark modes. Your choice is remembered.
|
|
|
|
### YouTube authentication (optional)
|
|
|
|
Some videos require sign-in. Export your cookies using the [Get cookies.txt LOCALLY](https://chrome.google.com/webstore/detail/get-cookiestxt-locally/cclelndahbckbenkjhflpdbgdldlbecc) browser extension and mount them:
|
|
|
|
```bash
|
|
docker run -d \
|
|
-p 8000:8000 \
|
|
-v $(pwd)/cookies.txt:/app/web/backend/cookies.txt:ro \
|
|
--name yt-mp3-ui \
|
|
yt-mp3-ui
|
|
```
|
|
|
|
> **Note:** Using cookies with Chrome on Windows may cause issues due to DPAPI encryption. Firefox or Edge cookies work more reliably.
|
|
|
|
---
|
|
|
|
## Tech Stack
|
|
|
|
- **Backend** — Python, [FastAPI](https://fastapi.tiangolo.com/), [yt-dlp](https://github.com/yt-dlp/yt-dlp)
|
|
- **Frontend** — Vanilla HTML/CSS/JS (no framework)
|
|
- **Container** — Docker with ffmpeg
|
|
|
|
---
|
|
|
|
## License
|
|
|
|
This project uses yt-dlp which is licensed under [The Unlicense](LICENSE).
|