15 49.0138 8.38624 1 0 4000 1 https://vladtalkstech.com 300 1
theme-sticky-logo-alt

The Ultimate Script to download SharePoint Conference 2014 Videos AND slides!

40 Comments

After everyone posted about 10 script versions to download the SharePoint Conference 2014 videos I decided to add some extra value before releasing mine! This is what my script does:

  • Downloads all the SPC14 Sessions and Slides
  • Groups them by folders
  • Makes sure no errors come up due to Illegal File names.
  • If you stop the script and restart in the middle, it will start where it left off and not from beginning.

The Total size will be a bit under 70GB.

SharePoint Conference 2014 Videos

At the end, it will look something like this:

And inside every folder (provided slides have been added by Channel9) you will have both the .mp4 and the .pptx!

Here is a preview of the script, but DO NOT COPY PASTE IT FROM UNDER HERE, the WordPress plugin messed up some syntax. Instead OPEN IT HERE:   http://gallery.technet.microsoft.com/PowerShell-Script-to-all-04e92a63 

Make sure to share with your twitter followers:

 

UPDATE: 17 March 2014

– Added a TRIM on the file/folder name (Thanks Dan Holme!)

– Added the Download of the text file that contains the description of the session (Thanks VyperWare)

– Added Quotes to test if file already exists (Thanks Marat Bakirov)

 

Tweet: The Ultimate Script to download all #SharePoint Conference 2014 videos AND slides  http://ctt.ec/168h2+ by @vladcatrinescu #spc14

Update1 (12 March):  Also added (“) and (*) as illegal characters so they don’t break SPC3991!  Thanks > @maxmelcher

</pre>
# Originally published at https://gist.github.com/nzthiago/5736907
# I Customized it for SPC14 with slides
# If you like it, leave me a comment
# If you don't like it, complain to Github. :)

[Environment]::CurrentDirectory=(Get-Location -PSProvider FileSystem).ProviderPath
$rss = (new-object net.webclient)

# Grab the RSS feed for the MP4 downloads

# SharePoint Conference 2014 Videos
$a = ($rss.downloadstring("http://channel9.msdn.com/Events/SharePoint-Conference/2014/RSS/mp4high"))
$b = ($rss.downloadstring("http://channel9.msdn.com/Events/SharePoint-Conference/2014/RSS/slides"))

#other qualities for the videos only. Choose the one you want!
# $a = ($rss.downloadstring("http://channel9.msdn.com/Events/SharePoint-Conference/2014/RSS/mp4"))
#$a = ($rss.downloadstring("http://channel9.msdn.com/Events/SharePoint-Conference/2014/RSS/mp3"))

&nbsp;

#Preferably enter something not too long to not have filename problems! cut and paste them afterwards
$downloadlocation = "C:\spc14"

if (-not (Test-Path $downloadlocation)) {
Write-Host "Folder $fpath dosen't exist. Creating it..."
New-Item $downloadlocation -type directory
}
set-location $downloadlocation

#Download all the slides
$b.rss.channel.item | foreach{
$code = $_.comments.split("/") | select -last 1

# Grab the URL for the PPTX file
$urlpptx = New-Object System.Uri($_.enclosure.url)
$filepptx = $code + "-" + $_.creator + " - " + $_.title.Replace(":", "-").Replace("?", "").Replace("/", "-").Replace("<", "").Replace("|", "").Replace('"',"").Replace("*","")
$filepptx = $filepptx.substring(0, [System.Math]::Min(120, $filepptx.Length))
$filepptx = $filepptx.trim()
$filepptx = $filepptx + ".pptx"
if ($code -ne "")
{
$folder = $code + " - " + $_.title.Replace(":", "-").Replace("?", "").Replace("/", "-").Replace("<", "").Replace("|", "").Replace('"',"").Replace("*","")
$folder = $folder.substring(0, [System.Math]::Min(100, $folder.Length))
$folder = $folder.trim()
}
else
{
$folder = "NoCodeSessions"
}

if (-not (Test-Path $folder)) {
Write-Host "Folder $folder dosen't exist. Creating it..."
New-Item $folder -type directory
}

#text description from session . Thank you VaperWare
$OutFile = New-Item -type file "$($downloadlocation)\$($Folder)\$($Code.trim()).txt" -Force
$Category = "" ; $Content = ""
$_.category | foreach {$Category += $_ + ","}
$Content = $_.title.trim() + "`r`n" + $_.creator + "`r`n" + $_.summary.trim() + "`r`n" + "`r`n" + $Category.Substring(0,$Category.Length -1)
add-content $OutFile $Content

# Make sure the PowerPoint file doesn't already exist
if (!(test-path "$downloadlocation\$folder\$filepptx"))
{
# Echo out the file that's being downloaded
$filepptx
$wc = (New-Object System.Net.WebClient)

# Download the MP4 file
$wc.DownloadFile($urlpptx, "$downloadlocation\$filepptx")
mv $filepptx $folder

}
}

#download all the mp4

# Walk through each item in the feed
$a.rss.channel.item | foreach{
$code = $_.comments.split("/") | select -last 1

# Grab the URL for the MP4 file
$url = New-Object System.Uri($_.enclosure.url)

# Create the local file name for the MP4 download
$file = $code + "-" + $_.creator + "-" + $_.title.Replace(":", "-").Replace("?", "").Replace("/", "-").Replace("<", "").Replace("|", "").Replace('"',"").Replace("*","")
$file = $file.substring(0, [System.Math]::Min(120, $file.Length))
$file = $file.trim()
$file = $file + ".mp4"

if ($code -ne "")
{
$folder = $code + " - " + $_.title.Replace(":", "-").Replace("?", "").Replace("/", "-").Replace("<", "").Replace("|", "").Replace('"',"").Replace("*","")
$folder = $folder.substring(0, [System.Math]::Min(100, $folder.Length))
$folder = $folder.trim()
}
else
{
$folder = "NoCodeSessions"
}

if (-not (Test-Path $folder)) {
Write-Host "Folder $folder) dosen't exist. Creating it..."
New-Item $folder -type directory
}

&nbsp;

# Make sure the MP4 file doesn't already exist

if (!(test-path "$folder\$file"))
{
# Echo out the file that's being downloaded
$file
$wc = (New-Object System.Net.WebClient)

# Download the MP4 file
$wc.DownloadFile($url, "$downloadlocation\$file")
mv $file $folder
}
}
<pre>
Previous Post
SharePoint Conference 2014 Sessions are now posted online for free!
Next Post
Change the PowerShell MachinePolicy Execution Policy in Windows Server 2012R2

40 Comments

  • March 12, 2014 at 3:05 pm
    Jose Normandin

    In my case with a proxy limitation I need to had those lines of code :
    $proxy = [System.Net.WebRequest]::GetSystemWebProxy()
    $proxy.Credentials = [System.Net.CredentialCache]::DefaultCredentials
    $wc = (New-Object System.Net.WebClient)
    $wc.proxy = $proxy

    Reply
  • March 13, 2014 at 10:38 am

    Thanks for the script.
    Nice work.

    Reply
  • March 13, 2014 at 1:23 pm
    MariAnne

    Anyway to do this for the Microsoft Convergence conference pulling from the schedule builder?

    Reply
  • March 14, 2014 at 3:31 am

    If you are behind a proxy, you need to add these code at 2 places(after creating webclient and before downloadfile) on both pptx and mp4 files section.

    # specify your proxy address and port
    $proxy = new-object System.Net.WebProxy “www-proxy.yourcompany.com:8080”
    # replace your credential by your domain, username, and pasword
    $proxy.Credentials = New-Object System.Net.NetworkCredential (“domain\your username”, “your passowrd”)
    $wc.proxy=$proxy
    # specify an header if you want to check info in your logs on your proxy
    $wc.Headers.Add(“user-agent”, “Windows Powershell WebClient Header”)

    Reply
  • March 14, 2014 at 9:05 am
    Tony

    Thanks for the script, it was a time saver. I had to make one change on line 26 from cd $downloadLocation to set-location $downloadlocation. Otherwise it would download the the dir where the script was executed from. thx again.

    Reply
  • March 14, 2014 at 2:32 pm
    Rosco

    I get this error:

    Exception calling “DownloadString” with “1” argument(s): “The remote server ret
    urned an error: (500) Internal Server Error.”
    At C:\temp\DownloadSPC14Videoandslides.ps1:12 char:31
    + $a = ($rss.downloadstring <<<< ("http://channel9.msdn.com/Events/SharePo
    int-Conference/2014/RSS/mp4high"))
    + CategoryInfo : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : DotNetMethodException

    Reply
    • March 14, 2014 at 2:36 pm

      Hey, it’s because Channel 9 is down 🙁 Try again later!

      Reply
  • March 14, 2014 at 4:34 pm
    Mandy

    It’s working now?

    Reply
  • March 14, 2014 at 5:15 pm

    This is great Vlad!!
    But what am I missing? I am getting .pptx but no videos? (I know lots of folks have asked this already but I was hoping to get the most current answer).

    Reply
  • March 15, 2014 at 12:18 am
    Marat Bakirov

    when my download crashed diue to space limitation, i have noticed the scripts is eomtimes redownloading the files. This is because of spaces in some file names

    the fix is

    1) $folder = $folder.Trim()

    2) change if (!(Test-Path $folder\$filepptx)) to
    if (!(Test-Path “$folder\$filepptx”))
    notice the quotes.

    the same should be done on the second RSS processing.

    Reply
  • March 15, 2014 at 2:17 pm

    N1 Vlad. Just a note for anyone trying to re-upload this content into OneDrive – the file/folder name lengths & Illegal characters will blow it. To clean up the files/folders locally before uploading to OneDrive try Hans Brenders script here: http://hansbrender.wordpress.com/2013/08/26/skydrive-pro-powershell-script-checks-and-moves-folders-and-files/

    Reply
  • March 16, 2014 at 10:35 pm

    What’s the total size of all the downloaded .mp4 and powerpoint slide decks?

    Reply
  • March 17, 2014 at 8:08 am

    Great, thanks for Sharing. I will give it a go.

    Reply
  • March 18, 2014 at 10:01 am
    Mandy

    Didn’t download the mp4 file.

    Reply
  • March 18, 2014 at 5:17 pm
    Amar

    How do I ge tthe videos too? Only seems to be grabbing the pptx and a 1K visual studio file.

    Reply
  • March 20, 2014 at 3:41 pm
    Amar

    This script was absolutely stellar. Thank you for sharing. Over the previous 2 confrences I downloaded a combined 230 sessions which took an insane amount of time. This script took care of it all in one fell swoop. Greatly appreciated this!

    Reply
  • March 20, 2014 at 5:19 pm
    Mark

    Nice script, but still no videos. 🙁

    Reply
  • March 21, 2014 at 3:09 am
    Amir Butt

    Amazing work and good to know there are people out there doing things just to help others.
    Thanks

    Reply
  • March 21, 2014 at 12:56 pm

    Good stuff! I worked perfectly! Thanks.

    Reply
  • March 26, 2014 at 4:27 pm
    Kristi

    mine didn’t download the mp4 either :/

    Reply
  • March 31, 2014 at 9:51 pm

    Great share. Thanks for sharing

    Reply
  • April 14, 2014 at 12:47 pm

    Thanks for sharing. Any possibility to get the code snippets for the dev orientged presentations? Those were the hard ones to get to.

    Reply
  • April 24, 2014 at 5:26 pm

    Thanks great script.
    Borrow it, tweaked it for MEC2014 and posted on my blog. Gave you credit for the original script.

    Reply
  • May 3, 2014 at 8:45 am

    Still great script. reused again for Lync Conf 2014. Credits to you.
    http://www.msdigest.net/2014/05/script-to-download-all-lync-conference-2014-videos-and-slides/

    Reply
  • May 4, 2014 at 4:49 pm

    Hi Vlad, great script, thanks so much for sharing it.

    Suggest you make it clear in your blog post that not all sessions have both a video and a slide deck posted on Channel 9, or at least in the RRS feeds, so if you only run the part of the script to download the slides for example you won’t get folders created for those sessions that don’t have slides.

    Does anyone have a script to create a spreadsheet with all the sessions’s titles, descriptions, presenters, that kind of metadata? I’d like to be able to scroll quickly through that to decide what sessions I’m most interested in. There is such a script based on the pre-conference website but it doesn’t work when repointed at the Channel 9 site and I haven’t had time to tweak it.

    Reply
  • May 16, 2014 at 7:49 am

    Hi Vlad, if I could make a couple more suggestions, these are things that I ended up doing manually for those presentations that I wanted to dig into:
    * put the presenter name at the end, in a limited view port I don’t need to see that, session title is more important
    * batch up all the descriptions into a single text file
    * don’t put each presentation into a separate folder, as with folders I spend too many clicks navigation up and down

    Reply
  • January 28, 2015 at 7:35 pm
    Arun

    Video files were skipped, thanks and appreciate the efforts

    Reply

Leave a Reply