Jump to content

Recommended Posts

Posted

It may need error checking but It downloads the first occourence of ".swf" to FLASH.swf

try it on the site

http://www.albinoblacksheep.com/flash/hampster

and anywhere else you can think of

let me know what you think and tweak away

You must have beta and ie.au3

#include <ie.au3>
AutoItSetOption( "WinTextMatchMode", 2)
TrayTip("Flash Downloader", "select the browser to search in", 3)
while 1
    $title = WinGetTitle ( "" )
    if StringInStr( $title, " - Microsoft Internet Explorer") Then ExitLoop
    WEnd
$title = StringReplace($title, " - Microsoft Internet Explorer", "")
$oIE1 = _IEAttach ($title)
$source = _IEBodyReadHTML ($oIE1)
$end = StringInStr ( $source, ".swf" )
$begin = 1
$i = 0
while $begin > 0 and $begin < $end
$i = $i + 1
$begin = StringInStr ($source, "http://", 0, $i)
WEnd
$i = $i - 1
$begin = StringInStr ($source, "http://", 0, $i)
$address = StringMid ( $source, $begin, $end - $begin + 4 )
$size = InetGetSize ( $address )
InetGet ( $address,"FLASH.swf", 1, 1)
TrayTip( "Flash Address:", $address, 2)
sleep(2000)
While @InetGetActive
  TrayTip("Downloading", @InetGetBytesRead & "/" & $size, 10, 16)
  Sleep(250)
Wend
TrayTip("Download Complete", "100%", 10, 16)
sleep(1500)
Check out ConsultingJoe.com
Posted

I just tried it on the Shockwave test site and I recieved the following error from SciTE

>Running:(3.1.1.113):C:\Program Files\AutoIt3\beta\autoit3.exe "D:\AutoIT-3\Testing Stuff\Testing.au3"

C:\Program Files\AutoIt3\beta\Include\ie.au3 (1135) : ==> Variable must be of type "Object".:

If IsObj($o_object.document) Then

If IsObj($o_object^ ERROR

+>AutoIT3.exe ended.rc:0

>Exit code: 0 Time: 2.557

I have the latest Beta and I just downloaded the latest IE.au3

The Site I tested with. http://www.macromedia.com/shockwave/welcome/

Mike

Posted

I tried it at the site and it didn't give me that error, but it did give me the error if I don't have a IE already opened, then I open one. that's when I get the error. I need to add error checking and check to see if IE is opened or not.

And I notice the code grabs crazy things sometimes, so maybe I need to add something that checks if the url is correct.

but besides all that, what do you think... :)

Check out ConsultingJoe.com
Posted

I tried it at the site and it didn't give me that error, but it did give me the error if I don't have a IE already opened, then I open one. that's when I get the error. I need to add error checking and check to see if IE is opened or not.

And I notice the code grabs crazy things sometimes, so maybe I need to add something that checks if the url is correct.

but besides all that, what do you think... :)

I think it's a very cool idea.

I'm actually building an Install CD that is going to installing the flash player (among many other things). It would be cool to include the test swf file so I can launch a test after the player has been installed.

Mike

Posted

but besides all that, what do you think... :mellow:

I'm not sure I understand what this does. Does it actually download the shockwave movie for me? That is, instead of just seeing the movie as a streaming movie, I can save the whole file to my hard drive? :)
...by the way, it's pronounced: "JIF"... Bob Berry --- inventor of the GIF format
Posted

I'm not sure I understand what this does. Does it actually download the shockwave movie for me? That is, instead of just seeing the movie as a streaming movie, I can save the whole file to my hard drive? :)

yeah pritty much. it's not perfect yet. I tested it at albinoblacksheep
Check out ConsultingJoe.com
Posted (edited)

Ok try this:

now it will do wma, swf, and mpg just by adding some code.

I also found that it grabs variables like in www.yahoo.com it grabbed:

http://us.i1.yimg.com/us.yimg.com/i/mntl/w...r+'spl1.swf

next I'll have it check to see if there are: single quotes, pluses, and commas

but if it doesn't find anything it will tell you now

#include <ie.au3>
AutoItSetOption( "WinTextMatchMode", 2)
TrayTip("Flash Downloader", "select the browser to search in", 3)
while 1
    $title = WinGetTitle ( "" )
    if StringInStr( $title, " - Microsoft Internet Explorer") Then ExitLoop
    WEnd
$title = StringReplace($title, " - Microsoft Internet Explorer", "")
$oIE1 = _IEAttach ($title)
$source = _IEBodyReadHTML ($oIE1)
$end = StringInStr ( $source, ".swf" )
if $end = 0 then $end = StringInStr ( $source, ".wma" )
if $end = 0 then $end = StringInStr ( $source, ".mpg" )
if $end = 0 then 
msgbox(0,"", "could not find: swf, wma, or mpg")
exit
endif
$begin = 1
$i = 0
while $begin > 0 and $begin < $end
$i = $i + 1
$begin = StringInStr ($source, "http://", 0, $i)
WEnd
$i = $i - 1
$begin = StringInStr ($source, "http://", 0, $i)
$address = StringMid ( $source, $begin, $end - $begin + 4 )
ClipPut ( $address )
$size = InetGetSize ( $address )
InetGet ( $address,"FLASH.swf", 1, 1)
TrayTip( "Flash Address:", $address, 2)
sleep(2000)
While @InetGetActive
  TrayTip("Downloading", @InetGetBytesRead & "/" & $size, 10, 16)
  Sleep(250)
Wend
TrayTip("Download Complete", "100%", 10, 16)
sleep(1500)
Edited by zerocool60544
Check out ConsultingJoe.com
  • 2 months later...
Posted

Nice script, comes handy for sure. heres one thing i modified tho :

$Num = ""
If FileExists("FLASH" & $Num & ".swf") Then
    Do
        $Num += 1
    Until Not FileExists("FLASH" & $Num & ".swf")
EndIf
InetGet($Address, "FLASH" & $Num & ".swf", 1, 1)

So i can save multiple flashs 8)

Posted

Nice script, comes handy for sure. heres one thing i modified tho :

$Num = ""
If FileExists("FLASH" & $Num & ".swf") Then
    Do
        $Num += 1
    Until Not FileExists("FLASH" & $Num & ".swf")
EndIf
InetGet($Address, "FLASH" & $Num & ".swf", 1, 1)

So i can save multiple flashs 8)

cool, it should also do mpg, avi, or any extention
Check out ConsultingJoe.com

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...