|
'
GetGoogleVideoURL.vbs
' 11 December
2005
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.src, "/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
|