ruutu-dl is a tool for downloading videos from and ruutu-dl itself only parses HTML to resolve actual media URI and to generate output filename. Video payload is streamed using flvstreamer.



% ruutu-dl
% ruutu-dl output.mp4

Please do observe flvstreamer's output. Despite the effort ruutu-dl takes to work around issues with, flvstreamer sometimes exists ungracefully and leaves a broken video behind. If you see an error from flvstreamer right before ruutu-dl returns, the file is probably broken. Trying again usually helps.

For reasons unknown to the author of ruutu-dl,'s streaming servers sometimes behave badly, rendering the download nearly impossible. When this happens, the file download stops after less than a megabyte and flvstreamer keeps breaking the file continuously. Retrieving the entire file is then forbiddinly slow process - if possible at all.


ruutu-dl is written in Ruby and it uses PTY module to spawn and watch flvstreamer, which is used to download actual data.

Technical stuff

At first glimpse ruutu-dl looks unnecessary compilcated. If you're lucky, it is. Author used to download videos from and friends using rtmpdump until he realised it didn't work correctly. On author's computer, rtmpdump restarts download every few megabytes and produces a broken video that is ten times the size of a working video. flvstreamer, on the other hand, freezes every few megabytes, but when aborted and restarted manually, produces a fully working video most of the time. Interestinly enough using flvstreamer's timeout switch breaks the video. As a result, Ruby-version of ruutu-dl was born.

Current generation of ruutu-dl tries to recover from flvstreamer errors by remembering the file size and tail of the file for a few most recent attempts. When flvstreamer reports a broken file, ruutu-dl attempts to restore an older version of the file. Usually this works, but there are occasions when it doesn't.