Building a Twitter Video Downloader Is Harder Than It Looks

URL normalization, media variants, and the backend boundaries that kept the integration maintainable I recently built a backend workflow that accepts public Twitter/X status links and turns them into predictable media records. The first prototype appeared to need only three steps: accept a URL, resolve the post, and return a video. Real inputs quickly made that design inadequate. Users paste both x.com and twitter.com links. Some URLs include /video/1, tracking parameters, whitespace, or the i/status form. A video post can expose several MP4 variants with different bitrates and dimensions. Image posts can contain multiple original images. Delivery URLs can expire, and a client can repeat the
…