

Next, we remove items with a title with less than three characters, to remove duplicate entries, then we move on down the pipeline to set up a calculated property to perform some adjustment to the URL property. Next, we select only the playlist items that contain a direct video reference (contains “/watch”), then further filter to remove those without a playtime in the innerText field, which indicates direct links to times within videos. We begin by Invoking a WebRequest for our URL and selecting all of the links. Links | ? | ? innerText - notlike "\*Play all\*" $Playlisturl = " " #Next, the real magic happens in this ungainly one-liner $VideoUrls = ( invoke-WebRequest -uri $Playlisturl ). Once you have your URL, provide it in the $PlayListURL in the top line of the code: If it doesn’t contain a playlist, this method won’t work for you. You can get your playlist by selecting the URL from a page that will generally look like this. You should make sure your link loads in Playlist form. Get the tool here if you don’t already have it: I placed it in my %PATH% directory, but you can also run this code directly from wherever you placed the binary. This tool depends on you already having the wonderfully useful youtube-dl.exe downloaded on your system.

I’d used previously, to download videos one at a time, but never found a good tool to use to download a full playlist. Recently, a colleague approached me requesting pointers on the quickest possible way to download a YouTube playlist.
