Web Applications / Project 11
Media Downloader
A Flask-powered media workspace with format selection and real download progress.

01 / Overview
Behind the interface.
One web app that downloads media from twenty recognised platforms as MP4 or MP3, replacing an earlier pair of separate apps. A Flask service drives yt-dlp and FFmpeg as subprocesses behind fifteen routes, and a single page front end walks a seven state machine from pasted URL through analysis, preview, quality choice, download and library.
02 / Implementation
What makes it work.
Quality options are derived from the formats an extractor actually returns for that URL rather than assumed, with storyboard entries filtered out so bogus low resolutions never appear.
Progress reflects the real shape of the job. It knows whether it is watching one stream or a video and audio pair that will be merged, weights the passes, and clamps the value monotonic so a new pass never drags the bar backwards.
Error handling separates transient extractor failures from login walls. Transient calls retry with backoff, downloads retry only before bytes reach disk, and authentication errors name the wall instead of burning attempts.
Cookie advice is checked rather than recited. The jar is read for the one cookie per site that only a signed in session sets, so across seven sites the app can tell no jar from a jar that is logged out or expired.
Binary and folder paths are discovered rather than hardcoded, so the app finds an existing yt-dlp and FFmpeg install and picks up media downloaded by its predecessors on first run.
Installable as a Progressive Web App, with a self update endpoint for the download engine because extractors decay on the sites' schedule rather than ours.