Skip to content

Instantly share code, notes, and snippets.

@pynappo
Last active April 17, 2022 10:58
Show Gist options
  • Save pynappo/cacc17922b16a6a93ab5d5b12c441daa to your computer and use it in GitHub Desktop.
Save pynappo/cacc17922b16a6a93ab5d5b12c441daa to your computer and use it in GitHub Desktop.
WIP (not functional) PowerShell script for syncing a youtube playlist to the containing folder with youtube-dl.
Param (
[Parameter(Mandatory, HelpMessage = "Please provide a youtube-dl compatible link")]
[string]$URL
)
Param (
[Parameter(Mandatory, HelpMessage = "Please provide a youtube-dl compatible link")]
[string]$URL
)
Param (
[Parameter(Mandatory, HelpMessage = "Please provide a youtube-dl compatible link")]
[string]$URL
)
function Download {
if(Get-Command yt-dlp) { yt-dlp $URL --download-archive "archive.txt"
elseif (Get-Command youtube-dl) {
"yt-dlp not found, using youtube-dl instead"
youtube-dl
}
else{
Write-Error "Neither yt-dlp nor youtube-dl"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment