How To Save A Google Video To Your Hard Disk

Please visit http://www.paulsadowski.com/WSH/GetGoogleVideoURL.htm for the latest and complete versions of this script.

If you use Google Video to view videos and want to save the video to your own machine, here’s one way to do it.
 
The VBScript below should be saved to a file on your machine with the extension .vbs What you name it is up to you but it must use the .vbs extension.
 
Here’s how you use it. Find a video on Google Videos and copy the URL to your clipboard. Start the script by clicking on it in explorer or from a shortcut on your desktop.
 
You will be prompted for the URL of the video you just copied.
 
Paste the copied URL into the input box and click OK.
Wait a minute while the page is loaded and the video location determined.
 
A popup box will appear next that contains the decoded URL of the video’s location. Press Control-C to copy this information to your clipboard. Paste it into Notepad or another text editor.
 
It will look something like this:
—————————
Google Video URL Decoder Result – Control-C to copy; Paste to notepad
—————————
The decoded video URL is
Copy the line beginning with http:// to your clipboard and paste it into IE’s addressbar.
 
When prompted by IE, save the file to disk using an extension of .FLV
 
That’s all there is to it.
 
These are Flash files. You will need a player such as this free player at http://www.snapfiles.com/get/flvplayer.html
 
Please note: I threw this script together just now. While I have tested it, it does not contain much error checking.
 
When time permits I will post another version that actually downloads the file for you rather than giving you the URL. Stay tuned for that.
  
‘ Script Starts Here
‘ GetGoogleVidoURL.vbs
‘ 11 December 2005
‘ Paul R. Sadowski scripting(at)paulsadowski.com
 
Const READYSTATE_COMPLETE = 4
 
URL = InputBox("Enter the URL for the Google video…")
if URL = "" then
  WScript.Echo "No URL entered."
  WScript.Quit
end if
 
Set IE = CreateObject("INTERNETEXPLORER.APPLICATION")
IE.Navigate URL
IE.Visible = true
WaitForIt(60)
 
Set TheVideo = IE.document.getelementbyid("VideoPlayback")
VideoURL = Replace(TheVideo.data, "/googleplayer.swf?videoUrl=", "")
WScript.Sleep 100
IE.Quit
 
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Popup "The decoded video URL is " & vbCRLF _
& Unescape(VideoURL), 360, _
"Google Video URL Decoder Result – Control-C to copy; Paste to notepad", 0
 
Set WshShell = Nothing
set IE = Nothing
 
Function WaitForIt(SleepCount)
Dim idx
WaitForIt = False
Do While IE.Busy Or IE.readyState <> READYSTATE_COMPLETE
‘Sanity check
    wscript.sleep 1000
    idx = idx + 1
    if idx > SleepCount then
     WaitForIt = True
        exit do
   end if
Loop
idx = 0
End Function
Advertisements
This entry was posted in Computers and Internet. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s