Created
July 8, 2017 10:19
-
-
Save chrisfcarroll/a0acb594caf41ae7a28b605475dcf30e to your computer and use it in GitHub Desktop.
Youtube Downloader Prompting Wrapper : wraps youtube-dl.exe for a start-menu icon that prompts for the url to download.
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
param( [Parameter(Mandatory=$true)][string]$UrlToDownload ) | |
$downloadDirectory="C:\Users\Services\Downloads" | |
cd $downloadDirectory | |
write-host "" | |
write-host "" | |
write-host "Downloading $urlToDownload to $downloadDirectory ..." | |
write-host "" | |
write-host "" | |
$Error.Clear() | |
youtube-dl.exe $urlToDownload | |
if($Error){ | |
start youtube-dl -verb Runas -ArgumentList "-U" | |
Write-Warning "=======================================================" | |
Write-Warning "The youtube downloader has to update first." | |
Write-Warning "Please try again after the update has run." | |
Write-Warning "=======================================================" | |
pause | |
} else { | |
write-host "" | |
write-host "" | |
ls | where {$_.LastWriteTime -gt [DateTime]::Today} | |
write-host "" | |
start-process $downloadDirectory | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As in, https://github.com/rg3/youtube-dl/