Skip to content

Commit 4bf073c

Browse files
authored
Update Download-Channl9VideosFromRSS.ps1
1 parent d53cd50 commit 4bf073c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Download/Download-Channl9VideosFromRSS.ps1

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,15 @@ Param (
88
$DownloadFolder = '.\'
99
)
1010

11+
# Open the specified download folder
1112
Push-Location $DownloadFolder
1213

14+
# Initialize the downloader
1315
$WebClient = New-Object System.Net.WebClient
1416

17+
# Download the RSS
18+
# If the download failed, throw the error into the user's face and stop the script.
19+
# That's not an awfully polite thing to say, but that's what "throw" implies.
1520
Write-Output 'Downloading RSS feed...'
1621
try {
1722
$RSSWebObject = ([xml]($WebClient).downloadstring($RssUrl))
@@ -25,6 +30,7 @@ $counter=0;
2530
foreach ($item in $RSSWebObject.rss.channel.item) {
2631
$counter++
2732

33+
# Channel 9 isn't perfect. Some RSS feeds are missing an enclosure or a URL.
2834
if ($null -eq $item.enclosure.url) {
2935
Write-Output $('{0:D2}: No URL found)' -f $counter)
3036
continue

0 commit comments

Comments
 (0)