Download all Build 2014 videos

As you probably should know by now Build 2014 it’s over and it’s time to download the videos.

In this demo I will use MP4 high quality rss feed but it’s the same for other formats.


    class Program
    {
        public static XmlDocument getXMLDocumentFromXMLTemplate(string inURL)
        {
            HttpWebRequest myHttpWebRequest = null;     //Declare an HTTP-specific implementation of the WebRequest class.
            HttpWebResponse myHttpWebResponse = null;   //Declare an HTTP-specific implementation of the WebResponse class
            XmlDocument myXMLDocument = null;           //Declare XMLResponse document
            XmlTextReader myXMLReader = null;           //Declare XMLReader

            try
            {
                //Create Request
                myHttpWebRequest = (HttpWebRequest)HttpWebRequest.Create(inURL);
                myHttpWebRequest.Method = "GET";
                myHttpWebRequest.ContentType = "text/xml; encoding='utf-8'";

                //Get Response
                myHttpWebResponse = (HttpWebResponse)myHttpWebRequest.GetResponse();

                //Now load the XML Document
                myXMLDocument = new XmlDocument();

                //Load response stream into XMLReader
                myXMLReader = new XmlTextReader(myHttpWebResponse.GetResponseStream());
                myXMLDocument.Load(myXMLReader);
            }
            catch (Exception myException)
            {
                throw new Exception("Error Occurred in AuditAdapter.getXMLDocumentFromXMLTemplate()", myException);
            }
            finally
            {
                myHttpWebRequest = null;
                myHttpWebResponse = null;
                myXMLReader = null;
            }
            return myXMLDocument;
        }

        static void Main(string[] args)
        {
            XmlDocument doc = getXMLDocumentFromXMLTemplate("http://channel9.msdn.com/Events/Build/2014/RSS/mp4high");

            XmlNodeList list = doc.GetElementsByTagName("enclosure");
            StringBuilder sb = new StringBuilder();

            foreach(XmlNode node in list)
            {
                sb.AppendLine("wget " + node.Attributes["url"].Value);
            }

            string str = sb.ToString();
            //save the string to a file
        }
    }

The result will be a string like this:

 

wget http://media.ch9.ms/ch9/a2d5/f6d6b3fb-7b01-4bcb-96da-284d3622a2d5/C9Live9023_high.mp4
wget http://video.ch9.ms/sessions/build/2014/9-2663.mp4

….

just save that string to a cmd file and you are ready to download all the videos.

 

Digg thisBuffer this pageShare on FacebookShare on Google+Share on LinkedInPin on PinterestShare on RedditShare on StumbleUponShare on TumblrTweet about this on Twitter