michael2t Posted November 7, 2008 Posted November 7, 2008 Hello ... I am trying to download a quick time video from Yahoo site and Every time I start the Download the get function terminates ... can Anyone Help ... here is the code I am using ... It works fine for other trailers Just Not Yahoo site ... ; get the size of the file $iSize = InetGetSize($FetchIMPtrailer) if $iSize > 0 Then GUICtrlSetData($p4downloadsize, "Trailer Size="&$iSize&"/0" ) $mflwtrailer = $filenet & $mftrailtitle & $filenamext $storetrailer = $finaltrail & "[Trailer]" & $filenamext ; get the image and store it into th resize Directory InetGet($FetchIMPtrailer,$storetrailer, 1, 1) While @InetGetActive $iPercent = Int((@InetGetBytesRead / $iSize) * 100) GUICtrlSetData($p4Progress1, $iPercent) GUICtrlSetData($p4downloadsize, "Trailer Size="&$iSize&"/"&@InetGetBytesRead ) Sleep(10) WEnd GUICtrlSetData($p4Progress1, 100) Sleep(520)Here is the Url that will not work ... Works Fine in my browser .... The above code works fine with all other sites... http://playlist.yahoo.com/makeplaylist.dll...m=web&pt=rdThanks in advance ... Michael T.
Gerifield Posted November 8, 2008 Posted November 8, 2008 (edited) Post the full code, if you want help! My downloader worked fine! expandcollapse popup#include <INet.au3> #include <GUIConstantsEx.au3> HotKeySet("^+q","Hkey_pend");Ctrl + Shift + Q $url = "http://playlist.yahoo.com/makeplaylist.dll?sid=56955426&sdm=web&pt=rd" $dlfilename = "test.mov" $size = InetGetSize($url) $perc = 0 $bread = 0 $speed = 0 $GUIM = GUICreate("Downloader",300,100) $progressb = GUICtrlCreateProgress(48,30,200,20) $datalabel = GUICtrlCreateLabel("0 % 0 KB/s",48,52,200,20) GUISetState(@SW_SHOW,$GUIM) InetGet($url, $dlfilename, 1, 1) AdlibEnable("dlit_dat",1000) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Hkey_pend() EndSelect WEnd Func dlit_dat() If @InetGetActive Then $speed = (@InetGetBytesRead - $bread)/1024 $bread = @InetGetBytesRead $perc = $bread * 100 / $size GUICtrlSetData($progressb,$perc) GUICtrlSetData($datalabel,Round($perc,2) & " % " & Round($speed,2) & " KB/s") EndIf If @InetGetBytesRead = $size Then MsgBox(0,"Download","Complete!") Hkey_pend() EndIf If @InetGetBytesRead = -1 Then MsgBox(0, "ERROR", "Invalid URL!") Hkey_pend() EndIf EndFunc Func Hkey_pend() AdlibDisable() InetGet("abort") Exit EndFunc I think this isn't the good topic... :S Edited November 8, 2008 by Gerifield Sorry, but i don't speak English very well... :SExamples:SQLite with guiMake AU3 from DLL
michael2t Posted November 17, 2008 Author Posted November 17, 2008 Hello Gerifield, Thanks for the post .. your code works great mine does not like the yahoo address ... here is my code #include <INet.au3> #include <GUIConstantsEx.au3> $GUIM = GUICreate("Downloader",300,100) $progressb = GUICtrlCreateProgress(48,30,200,20) $datalabel = GUICtrlCreateLabel("0 % 0 KB/s",48,52,200,20) GUISetState(@SW_SHOW,$GUIM) $applesite = "http://playlist.yahoo.com/makeplaylist.dll?sdm=web&pt=rd&sid=33297323" ; get the file extension $filenamext = StringMid( $applesite, StringInStr($applesite, ".", 0, -1 ) ) $FetchIMPtrailer = $applesite ; store the file name $mflwtrailer = "test.mov" $storetrailer = "test" & "[Trailer]" & $filenamext ; get the size of the file $iSize = InetGetSize($FetchIMPtrailer) if $iSize > 0 Then $storetrailer = "test" & "[Trailer]" & $filenamext ; get the image and store it into th resize Directory InetGet($FetchIMPtrailer,$storetrailer, 1, 1) While @InetGetActive $iPercent = Int((@InetGetBytesRead / $iSize) * 100) GUICtrlSetData($progressb, $iPercent) GUICtrlSetData($progressb, "Trailer Size="&$iSize&"/"&@InetGetBytesRead ) Sleep(10) WEnd GUICtrlSetData($progressb, 100) Sleep(520) EndIf MsgBox(0,"Download","Complete!") It just stops at zero and returns ... Yours works great ... My works fine all all the address except yahoo ... do you know what I am doing wrong ? Thanks in advance Michael T.
michael2t Posted November 18, 2008 Author Posted November 18, 2008 Hello Gerifield, I played with my code ... and I changed the variable names and it works now ... go figure ... thanks ... It was a great example ... Michael T.
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