-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDownloadVideosFromChannel9-RSS.ps1
More file actions
31 lines (27 loc) · 980 Bytes
/
DownloadVideosFromChannel9-RSS.ps1
File metadata and controls
31 lines (27 loc) · 980 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# #CHECK THE PATH ON LINE 2 and the FEED on LINE 3
# cd "$env:USERPROFILE\Downloads"
# $a = ([xml](new-object net.webclient).downloadstring("https://channel9.msdn.com/Series/CSharp-101/feed/mp4"))
# $a.rss.channel.item | foreach{
# $url = New-Object System.Uri($_.enclosure.url)
# $file = $url.Segments[-1]
# $file
# if (!(test-path $file)) {
# (New-Object System.Net.WebClient).DownloadFile($url, $file)
# }
# }
Param (
$DownloadFolder = "$env:USERPROFILE\Downloads\",
$DownloadURL = 'https://channel9.msdn.com/Series/CSharp-101/feed/mp4'
)
#CHECK THE PATH ON LINE 2 and the FEED on LINE 3
Push-Location $DownloadFolder
$a = ([xml](New-Object net.webclient).downloadstring($DownloadURL))
$a.rss.channel.item | ForEach-Object {
$url = New-Object System.Uri($_.enclosure.url)
$file = $url.Segments[-1]
$file
if (!(Test-Path $file)) {
(New-Object System.Net.WebClient).DownloadFile($url, $file)
}
}
Pop-Location