You probably have already visited Channel 9, and if you have not I would recommend to definitely check it out. There are literally thousands of videos about development using Microsoft technologies (and more). You can watch the videos on the site using Silverlight player or you can use links on each video page for downloading. This usually works fine if you are interested in just one or a small number of videos, but it might become somewhat tedious if you want to download a bunch of them. I recently wanted to do the latter and this is how http://dayngo.com/channel9 was born.
Actually, it all started with this year’s MIX 11 event which I was unable to attend. I was quite interested in web-related sessions and saw that they started to pop up on the Channel 9 website. I was particularly interested in ASP.NET MVC and Silverlight topics. I realized that I will end up downloading quite a bit of videos and there is definitely an opportunity to automate the process. Since I am interested in Silverlight but do not have a chance to use it at work, I decided to use Silverlight for this little project. Also, since browsers and Silverlight (an out-of-browser implementation with elevated rights felt like an overkill in this case) have severe limitations when it comes to file system manipulations, I decided to use wget to do the actual downloading. Two nights later the initial implementation was done. As I saw that the tool has gained some popularity, I made some UI tweaks and called it done.
Fast forward several weeks and I realized that TechEd is coming, which means tons of videos of sessions I would like to watch. This time around, though, I had some time in advance before the event, so I decided to extend the MIX’11 tool so that it would allow not only to download one particular event, but become a mass download tool for the entire Channel 9 video content. I could definitely reuse some of the parsers from MIX11 tool, so I thought it is not going to take too much effort to refactor the code. And, of course, as it often happens with early estimates, I was wrong. Long story short, because of the way Channel 9 organizes content, reusable code from MIX11 tool is like 5% of the code I ended up writing for the new tool.
Nonetheless, the tool is up and running at http://dayngo.com/channel9. I extended the initial implementation so that now it can produce not only a batch file that utilizes wget, but also a PowerShell script. Those who decided to use wget (and it is my personal preference for this purpose), notice that it might be more convenient to put path to wget.exe into your system PATH variable, thus you do not have to put batch file next to wget executable.
The content of the tool is updated daily, around 4 AM CST. As I noticed during the development that Channel 9 keeps updating content for events well after the event ended (adding new sessions or uploading videos in other formats), I re-check and update event videos during those daily updates for 21 days since the event start date. Other content (shows, series, blogs) is consumed by the tool as it appears on the Channel 9 site and is not revisited afterwards.
Both scripts detect the already downloaded videos (by file name), so you can interrupt the download if you need to, just make sure to remove the last partially downloaded file (the one that has been downloaded when you interrupted).
I hope some of you will find this tool useful. Let me know if you have any questions about the tool, and any feedback is welcome.
I have noticed that some events have more that 150 sessions on Channel 9 website, but my tool tops at 150. Turned out they use paging on the event’s page, so my tool was parsing only the first page. This is fixed now and for some events there is much larger number of sessions available. Series, shows and blogs did not have this problem.