The Ultimate Script to download Project Conference 2014 Videos, slides and descriptions!

The Ultimate Script to download Project Conference 2014 Videos, slides and descriptions!

After posting the highly popular SharePoint Conference 2014 script to download the videos and slides,  I decided to do the same thing for Project Server for people interested!

  • This is what the script does:
  • Downloads all the Project Conference 2014 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.
  • Downloads the description of the session.

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!

And the total size:

Here is a preview of the script (if you wanna look trough it real fast) , but DO NOT COPY PASTE IT FROM UNDER HERE (Added a couple of colors so I am sure you read it J), the WordPress plugin messed up some syntax. Instead OPEN IT HERE:  http://gallery.technet.microsoft.com/PowerShell-Script-to-all-a0b94874 

Don’t keep all this for yourself, tweet it so your followers can get all the free knowledge as well! 

Tweet: The Best Script to download all #Project Conference 2014 videos, slides & description http://wp.me/p3utgI-2qF by @vladcatrinescu #MSProject

</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/Project/2014/RSS/mp4high"))
$b = ($rss.downloadstring("http://channel9.msdn.com/Events/Project/2014/RSS/slides"))

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

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() + &quot;<code>r</code>n&quot; + $_.creator + &quot;<code>r</code>n&quot; + $_.summary.trim() + &quot;<code>r</code>n&quot; + &quot;<code>r</code>n&quot; + $Category.Substring(0,$Category.Length -1)
add-content $OutFile $Content

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

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

}
}

#download all the mp4

# Walk through each item in the feed
$a.rss.channel.item | foreach{
$code = $_.comments.split(&quot;/&quot;) | 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 + &quot;-&quot; + $_.creator + &quot;-&quot; + $_.title.Replace(&quot;:&quot;, &quot;-&quot;).Replace(&quot;?&quot;, &quot;&quot;).Replace(&quot;/&quot;, &quot;-&quot;).Replace(&quot;&lt;&quot;, &quot;&quot;).Replace(&quot;|&quot;, &quot;&quot;).Replace('&quot;',&quot;&quot;).Replace(&quot;*&quot;,&quot;&quot;)
$file = $file.substring(0, [System.Math]::Min(120, $file.Length))
$file = $file.trim()
$file = $file + &quot;.mp4&quot;

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

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

&amp;nbsp;

# Make sure the MP4 file doesn't already exist

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

# Download the MP4 file
$wc.DownloadFile($url, &quot;$downloadlocation\$file&quot;)
mv $file $folder
}

}
&lt;pre&gt;
No ratings yet.

Please rate this

 
Comments

Great! Thanks for sharing the script

Merci pour ce partage de script … Interessant

Leave a Reply