Last active
September 27, 2016 04:46
-
-
Save jasonadsit/4e0e1c9d70140950611cc0759de55697 to your computer and use it in GitHub Desktop.
Download All the DerbyCon 2016 Videos
This file contains hidden or 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
| [cmdletbinding()] | |
| Param ( | |
| [string] $DerbyConFileList = 'https://ia601502.us.archive.org/16/items/DerbyCon6/DerbyCon6_files.xml', | |
| [string] $BaseDownloadUrl = 'https://archive.org/download/DerbyCon6/', | |
| [string] $DestinationFolder = $($HOME + '\Videos\DerbyCon6') | |
| ) | |
| Process { | |
| # Make sure the destination folder exists | |
| if (!(Test-Path $DestinationFolder)) { | |
| # If it doesn't, create it | |
| New-Item $DestinationFolder -ItemType Directory ` | |
| -Force ` | |
| -ErrorAction SilentlyContinue | Out-Null | |
| } | |
| # Get the file metadata | |
| ((Invoke-WebRequest -Uri $DerbyConFileList).Content) -as [xml] | | |
| ForEach-Object { $_.files.file } | | |
| Where-Object { $_.name -match '.mp4' } | | |
| # Download the video files | |
| ForEach-Object { | |
| Invoke-WebRequest -Uri $($BaseDownloadUrl + $_.name) ` | |
| -Out $($DestinationFolder + '\' + $_.name) | |
| } | |
| } # End of Process ScriptBlock | |
| <# | |
| .SYNOPSIS | |
| Downloads DerbyCon 2016 Videos. | |
| .DESCRIPTION | |
| Downloads DerbyCon 2016 Videos. | |
| .PARAMETER DerbyConFileList | |
| Metadata about the DerbyCon 2016 video files. | |
| 'https://ia601502.us.archive.org/16/items/DerbyCon6/DerbyCon6_files.xml' | |
| .PARAMETER BaseDownloadUrl | |
| Base URL for DerbyCon 2016 videos hosted on archive.org. | |
| 'https://archive.org/download/DerbyCon6/' | |
| .PARAMETER DestinationFolder | |
| Folder where you want to save the DerbyCon 2016 video files. | |
| .EXAMPLE | |
| .\Invoke-DerbyCon2016VideoDownload.ps1 | |
| Downloads all the DerbyCon 2016 videos to the Videos folder in your home directory. | |
| .NOTES | |
| Author: Jason Adsit (@CipherScruples) | |
| Version: 1.0 | |
| Date: 2016-09-26T21:30:18 | |
| Tag: Q2lwaGVyU2NydXBsZXM= | |
| orcid: 0000-0002-0030-5301 | |
| guid: 22822ece-007b-424a-baaa-454ac4dc7296 | |
| #> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment