Skip to content
Nat Lee

Keyboard shortcuts

Turn these off if they get in the way of a screen reader or voice control. The setting is saved in this browser.

1
Home
2
Work
3
Projects
4
About
5
Experience
/
Search projects
?
Show this panel

Web Application

YouTube Redirect Player

YouTube Video Player with WebSocket

A Flask + Socket.IO player with request, default and history playlists synchronised across screens. New development continues in Streaming Player.

Role
Creator & Maintainer
Period
2022 – 2023
Status
Archived
Categories
Web apps & extensions
Stack
  • Python
  • Flask
  • Socket.IO
  • yt-dlp
  • Docker
YouTube Redirect Player, screenshot 1

Overview

The Flask player synchronises a request queue, default playlist and playback history over Socket.IO. Its final version resolves media with yt-dlp and includes Docker and regression tests. The Rust + React Streaming Player carries on the song-request workflow.

What it's good for

Today it is mostly a small, readable example of Flask-SocketIO keeping several screens in step, with 34 tests that fake yt-dlp. It still plays Wikimedia Commons videos end to end; YouTube is the part that stopped cooperating.

How it fits together

Simplified on purpose. The real thing has more arrows and at least one config file nobody understands.

History was meant to keep 200 songs. It got stuck at 201.

  1. Every open tab
    • Laptop, TV, phone
    → requests, pause
  2. This oneFlask app
    • Socket.IO broadcasts
    • playlist.py API
    • SQLite: three playlists
    → asks
  3. yt-dlp
    • get_yt_info
    • Deno runtime
    → direct link
  4. Synced playback
    • Video.js in each tab

Point at a box to see what it connects to.

Desktop and phone players paused on the same frame, with the same socket log
Desktop and phone players paused on the same frame, with the same socket log

Features

  • Request, default and history playlists
  • Playback state synchronised over Socket.IO
  • yt-dlp media resolution and Docker deployment

Results

  • Final Flask version preserved; song requests continue in Streaming Player

What I learned

  • The history meant to keep 200 videos froze at 201: trimming called limit() without a number, and the swallowed error took the new row with it.
  • With an empty database the page asked for the playlist again and again, 248 requests in six seconds; it now asks once and waits for a request.
  • Flask-SocketIO runs under gunicorn as one worker with many threads, and its development server refuses to start without a terminal attached.
  • Web apps & extensions77 stars on GitHub

    Streaming Player

    Twitch, YouTube live chat and chat bots share one song queue. A Rust backend keeps the OBS player, overlay and moderator dashboard in sync.

    2023Completed
  • Web apps & extensions11 stars on GitHub

    Gantt Studio

    Drag a schedule into place, draw dependencies and see the critical path. Switch to Mermaid text without losing the plan. Everything stays in your browser.

    2026Completed
  • Web apps & extensions33 stars on GitHub

    MorphKit

    Converts and edits images, audio, video, PDFs and documents entirely in the browser. Nothing gets uploaded, mostly because there is nowhere to upload it to.

    2026Active