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.

Tuesday, December 09, 2008

SSRS - Unable to load client print control

One of the customer sites I work at was suddenly unable to print SSRS reports any more. This issue was occurring for only a few of their client boxes, so this rules out the possibility that it might have been a server issue.

It turns out that SSRS uses an activex control to provide some enhanced printing options. Here's some more information on it (taken from the MSDN site):

The Microsoft ActiveX control, RSPrintClient, provides client-side printing for reports viewed in a browser. The control displays a custom print dialog box that supports features common to other print dialog boxes, including print preview, page selections for specifying specific pages and ranges, page margins, and orientation.

After some investigating it looks like a conflict with KB956391. More information on it here:

http://support.microsoft.com/kb/956391

I'm guessing that this hot fix may have been pushed out by windows update, which explains it's sudden manifestation.

This is the proper way of fixing the issue; as explained in Brian Hartman's blog:

http://blogs.msdn.com/brianhartman/archive/2008/11/05/client-print-fails-to-load-after-microsoft-update-956391.aspx

Or alternatively just uninstall KB956391.

More useful discussions on the "Unable to load client print control" issue:

http://forums.microsoft.com/msdn/ShowPost.aspx?PostID=332145&SiteID=1

http://forums.microsoft.com/TechNet/ShowPost.aspx?PostID=4006280&SiteID=17

http://wills-blog.com/?p=220

http://forums.microsoft.com/msdn/showpost.aspx?postid=4006172&siteid=1&sb=0&d=1&at=7&ft=11&tf=0&pageid=4