ConsultingJoe Posted March 17, 2006 Posted March 17, 2006 It may need error checking but It downloads the first occourence of ".swf" to FLASH.swftry it on the site http://www.albinoblacksheep.com/flash/hampsterand anywhere else you can think oflet me know what you think and tweak awayYou 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
ConsultingJoe Posted March 17, 2006 Author Posted March 17, 2006 Sorry guys for the multi post (Dial-up) Just use this one and let that one fall down Check out ConsultingJoe.com
BigDaddyO Posted March 17, 2006 Posted March 17, 2006 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.557I have the latest Beta and I just downloaded the latest IE.au3The Site I tested with. http://www.macromedia.com/shockwave/welcome/Mike
ConsultingJoe Posted March 17, 2006 Author Posted March 17, 2006 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
BigDaddyO Posted March 17, 2006 Posted March 17, 2006 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
jefhal Posted March 17, 2006 Posted March 17, 2006 but besides all that, what do you think... 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
ConsultingJoe Posted March 17, 2006 Author Posted March 17, 2006 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
ConsultingJoe Posted March 17, 2006 Author Posted March 17, 2006 (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.swfnext I'll have it check to see if there are: single quotes, pluses, and commasbut if it doesn't find anything it will tell you nowexpandcollapse popup#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 March 17, 2006 by zerocool60544 Check out ConsultingJoe.com
julmae Posted June 1, 2006 Posted June 1, 2006 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)
ConsultingJoe Posted June 2, 2006 Author Posted June 2, 2006 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now