-
-
Save TonyAbell/89a71332ca0417561acd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Insert code here to change to directory where you wish to download videos if you so desire | |
[Environment]::CurrentDirectory=(Get-Location -PSProvider FileSystem).ProviderPath | |
$a = ([xml](new-object net.webclient).downloadstring("http://s.ch9.ms/Events/dotnetConf/2015/RSS/mp4high")) | |
$a.rss.channel.item | foreach{ | |
$url = New-Object System.Uri($_.enclosure.url) | |
$file = "- " + $_.creator + " - " + $_.title.Replace(":", "-").Replace("?", "").Replace("/", "-").Replace("<", "").Replace("|", "").Replace('"',"").Replace("*","") | |
$file = $file.substring(0, [System.Math]::Min(120, $file.Length)) | |
$file = $file.trim() | |
$OutFile = New-Item -type file "$file.txt" -Force | |
$Content = "" | |
$Content = $_.title.trim() + "`r`n" + $_.summary.trim() | |
add-content $OutFile $Content | |
$file = $file+".mp4" | |
"Downloading: " + $file | |
if (!(test-path $file)) | |
{ | |
$wc = (New-Object System.Net.WebClient) | |
$wc.DownloadFile($url, $file) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment