Friday, December 12, 2008

Download YouTube videos using Powershell

Now that I'm back home in Sri Lanka, I'm getting re-accustomed to the slow Internet speeds over here. Slow internet speeds was the reason for me to write the YouTube downloader back in April.

So I spent a lazy afternoon today trying to port that code into Powershell. And here's the result:

How it works

The script first figures out the direct download link and then hands it off to a download manager which performs the actual download. You should be able to plug-in any download manager that supports command line arguments but I prefer to use wget for its simplicity.

Information on how the direct link is extracted can be found in my original post.

Use $downloaderPath and $downloaderArguments to configure the path of wget and its arguments respectively. The script also supports traversal through proxies and can be configured using the $proxy and $proxyPort variables.

The script accepts one parameter; the watch url of the video.

.\psVDownloader.ps1 http://www.youtube.com/watch?v=N_c60Sp7Gtc

.

Please be aware that this script is purely for research purposes only. And I believe that you will be violating the YouTube TOS by trying to use its streams in ways other than intended.

2 comments:

Oscar said...

Hi there,

It seems like this doesn't work anymore. Do you have an update?

shane carvalho said...

I haven't used this script in ages and don't have any plans on updating it. Sorry!