Destreaming online media
Over the past few days, I have decided to learn the perl scripting language by developing a few scripts to download streaming music and video. Programs that perform this function are known as stream recorders, stream rippers, or destreamers. Examples of online services that provide streaming media include: youtube, soundcloud, myspace, and vimeo. Some websites make it extremely easy to download the video by placing the direct link to the video file within the source of the web page (Yahoo! Screen and Msn Video do this) . If not, then they would most likely place it within the source of the embedded video page (which Vimeo does). Notice: that some web browsers are unable to let you view the source of the embedded video page because right clicking anywhere in the page would activate the media player control rather than bringing up the context menu of the browser. In either case, you can always use wget to the source of any page that does not require authentication first.
Sometimes, websites use alternative protocols to transfer media files from the server to the client’s media player. A popular alternative to http is rtmp. rtmp stands for real time messaging protocol; it is a partially-documented, proprietary protocol developed by Adobe. Myspace and Nickelodeon use this protocol for video and music transfer. Myspace, in particular, uses rtmpe: an encrypted version of rtmp which is fundamentally not any more secure than regular rtmp. Surprisingly, Myspace was easier to hack than Nick.com because the URL of the streaming media was in the same page as the main content. Using rtmpdump, these streams can easily be downloaded. The only work you have to do is get the correct parameters for rtmpdump, which are found scattered throughout the page source.
Nickelodeon was the hardest website for me to successfully make a destreamer for, simply because there was a lot of XML to parse through: up to four pages of redirection before getting to the download link.
Hulu seems extremely secure, I have yet to make a destreamer for that website. But if I did, I could potentially download any episode of any television show I want.
I don’t bother making destreamers for Youtube or Soundcloud because there are already other programs out there that can do that.
I have made a repository on github for this: https://github.com/Jakash3/vidiyank