Proxying Youtube Videos Part III

Previous post shows how to create a mpd manifest from the result of yt-dlp and play it using various players. However, there are some problems when we use the manifest with other tools such as ffmpeg and other video players rather than shaka-player and dash.js, mainly in the form of slow buffering. Determine the Cause of Slow Buffering First we determine how a browser requests YouTube assets. Open devtools: Request Query Parameters and Payload We can find the request is a POST request with query parameter range and payload x\n....

published on August 9, 2023 · 3 min · 555 words

Proxying Youtube Videos Part II

Previous post shows how to extract YouTube video assets using yt-dlp and implement a dynamic reverse proxy. This post details what the format YouTube is using. First we’ll find out what formats YouTube uses to stream high quality videos in a browser. Naive Solution There is an audio html element. We could try to synchronize an audio and a video element. However, it’s easier said than done as we have to consider not only play, pause, seek states, but also video and audio buffering, and it’s very easy to for these two elements to fall out of sync....

published on July 17, 2023 · 4 min · 752 words