Created
March 14, 2021 04:02
-
-
Save mmdriley/370b1ee5419172d388912076913bd203 to your computer and use it in GitHub Desktop.
youtube-dl a folder of URL shortcuts
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
$wscript = New-Object -ComObject WScript.Shell | |
# Push script parent folder | |
$MyInvocation.MyCommand.Path | Split-Path -Parent | Push-Location | |
# Create directories for videos and already-downloaded links | |
"Videos", "DownloadedLinks" | | |
% { New-Item $_ -ItemType Directory -ErrorAction SilentlyContinue } | |
# Download videos | |
Push-Location Videos | |
Get-ChildItem "..\*.url" | | |
% { $wscript.CreateShortcut($_).TargetPath } | | |
% { youtube-dl $_ } | |
Pop-Location | |
# Archive links | |
Move-Item "*.url" DownloadedLinks/ | |
Pop-Location |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment