Self-hosted media utility
YouTube Buffer App
A local web app that searches YouTube, starts yt-dlp in the background, buffers the video to disk, plays it from the local cache and can delete it after playback.
What it does
- Search YouTube or paste a YouTube URL.
- Click a result to start a server-side
yt-dlpbuffer job. - Play the video from the local cache while the download continues.
- Optionally delete cached video files automatically after playback.
- Use local YouTube cookies for private areas such as Watch Later and Liked Videos.
Important: This app cannot run as a pure static Cloudflare Pages app because browsers cannot execute yt-dlp or write a video cache on the server. It is intended for local use, a home server, NAS, VPS or Docker host.
Setup
Download and extract the source archive, then run:
cd youtube-buffer-webapp
npm install
python3 -m venv .venv
. .venv/bin/activate
pip install -U yt-dlp
npm start
Open http://localhost:3787 in your browser.
Optional environment variables:
PORT=8080 YTDLP=/usr/local/bin/yt-dlp COOKIE_FILE=/path/cookies.txt AUTO_DELETE_DEFAULT=true npm start
YouTube login / Watch Later
The app does not ask for your Google password. Instead, it can use a local Netscape-format cookies.txt file exported from your already logged-in browser. The cookies stay on the server where you run the app.
- Log in to YouTube in your normal browser.
- Export YouTube cookies as
cookies.txt, for example with a local cookies export extension. - Paste them into the app under “YouTube Login”.
- Use “Watch Later” or “Liked Videos” inside the local app.
Legal and privacy notes
This utility is provided as source code for personal, self-hosted use. Respect YouTube’s terms, creator rights and applicable law. Do not share private cookies, cached files or downloaded media publicly.