Engineering notes

What broke, and what we changed

Short write-ups of real problems on the site. Numbers are from our own logs.
Performance

Cutting time-to-first-frame at kick-off

Problem
At 20:00 on match nights the player took eight seconds or more to show a picture. Everyone opened the same beIN channel at once and the upstream master playlist was fetched separately for every viewer.
What we changed
We now build the master playlist on our own server and cache it for twenty seconds, and the player starts on the 720p rung instead of probing 1080p first.
Result
Median time to first frame dropped from 8.1 s to 2.4 s on a 4G connection, and the number of "stream not responding" reports on Telegram fell by roughly two thirds.
Coverage

From 40 hand-maintained links to a live directory

Problem
Channels were kept in a spreadsheet and pasted into a database by hand. Links broke weekly and whole categories such as the French channels were missing.
What we changed
The guide now reads a live channel directory from the upstream API, decrypts it server-side and maps categories automatically. The old list is kept only as a fallback.
Result
Coverage went from about 40 channels to more than 600 across 30 categories, with no manual link maintenance.
Security

Closing an open proxy

Problem
The stream relay accepted any URL and any request headers from the address bar. Anyone could use our bandwidth to relay their own files, and the admin password was stored in the client bundle.
What we changed
Relay URLs are now signed by the server and expire; requests to private networks are refused; the admin area uses a server-issued session token and every write goes through a service-role key that never leaves the server.
Result
Unknown-origin relay traffic went to zero within a day and the hosting bill for egress dropped accordingly.