Sign in to follow this  
Followers 0
markusss

Small download tool

39 posts in this topic

#1 ·  Posted (edited)

Here my small downloader!

My first "real" project, but turned out pretty good!

http://www.autoitscript.com/fileman/users/tdlrali/Downloader/ssofdownloader108.jpg

For script Posted Image look http://www.autoitscript.com/fileman/users/tdlrali/Downloader/

Please post comments & bugs

Thx

tdlrali (Felix)

Edited by Felix N.

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

Weird because I made like the same exact thing today ;) But I like your setup better, good work ! :mad2:

EDIT: One suggestion to make it look better. Line up the filesize label and input field with the 2 above it. It will look much neater :P

Edited by layer

FootbaG

Share this post


Link to post
Share on other sites

Weird because I made like the same exact thing today :P But I like your setup better, good work ! :dance:

EDIT: One suggestion to make it look better. Line up the filesize label and input field with the 2 above it. It will look much neater :mad2:

You should post it so that we can take a look at it.. :oops:

Cheers.. ;)

Share this post


Link to post
Share on other sites

Here my small downloader!

My first "real" project, but turned out pretty good!

Please post comments & bugs

Thx

tdlrali (Felix)

Felix, nice and simple downloader. Way to good for your first script! ;)

Cheers.. :P

Share this post


Link to post
Share on other sites

Here my small downloader!

My first "real" project, but turned out pretty good!

For script see attachment

Please post comments & bugs

Thx

tdlrali (Felix)

Not bad, might want a way to stop the download

Here's your script modified to let the user hit Esc to stop the download

Also, thought it would look better with a percent progress bar (requires beta)

Screen shots and your source modified and include file below:

downloader.au3

Progress.au3


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

Not bad, might want a way to stop the download

Here's your script modified to let the user hit Esc to stop the download

Also, thought it would look better with a percent progress bar (requires beta)

Screen shots and your source modified and include file below:

qafrost, nice additions..! I like the progress bar idea. I some other ideas to add to this script. Hopefully they are not too crazy and crash it. ;)

Cheers.. :P

Share this post


Link to post
Share on other sites

I had an idea like this only slightly different. It would monitor the clipboard for any non-webpage format, http: protocol, filenames. Then it would ask where you want to save to but I never got around to making it. Maybe a suggestion for yours?

Share this post


Link to post
Share on other sites

Not bad, might want a way to stop the download

Here's your script modified to let the user hit Esc to stop the download

Also, thought it would look better with a percent progress bar (requires beta)

Screen shots and your source modified and include file below:

qafrost, here is an updated version to what you modified. I have labeled it v1.03b.

I added a _Filesize() display routine which allows you to chose how to display filesize text. This is a nice add-on to any script. Syntax: _Filesize(value in bytes, format type, decimal places); returns a formatted string.

Also I added _FileReplace(), which test to see if a file exist and verifies if you want to overwrite it. This function has elements specific for this script so I made it part of it.

Check it out and let me know what you think. I have other ideas but that will have to wait.

Cheers.. ;)

downloader_1.03b.au3 _Filesize.au3

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

Hey!

Thanx for your replies and changes!

I downloaded the beta and installed it, but when i run the program, add the links and press the download button, the program just quits.....

Am i doing anything wrong? I installed the beta to [My AutoIt Folder]\beta, like it was suggested while installing the beta and i clicked Beta Compile in SciTE. But the program just quits like i said above

Please help

Felix N. (tdlrali)

Posted Image1

Just to make it more clear:

I put all the files in one folder, so thats not the problem. ;)

Posted Image2

Don't read the stuff above! :oops::P

It didn't work due to an error in the _FileReplace function

Func _FileReplace($sPathFrom, $sPathTo)
    Local $filename, $sFileCheck, $answer
    $filename = StringTrimLeft($sPathFrom, StringInStr($sPathFrom, "/", 0, -1))
    $localfile = $sPathTo & "\" & $filename
    $sFileCheck = FileExists($localfile)
    If $sFileCheck = 1 Then
        $answer = MsgBox(36, "File Existing - Error", "File Found: " & $localfile & @CRLF & "Do you want to replace this existing file? ")
        Select
            Case $answer = 6; YES
                Return 1
            Case $answer = 7; NO
                Return 0
            EndSelect
        Else       ;<= added by Felix N.
            Return 1;<= added by Felix N.
    EndIf
EndFunc ;==>_FileReplace

Without the stuff i added it always returned 0, thus exiting the script.... :dance:

Attached is the compiled exe (remove the au3 ending for the file "Downloader.exe.au3) and the 2 script files.

To compile the script, both files must be in the same folder and you need the beta version of AutoIt (just to make sure new people like me know how to compile^^, not for you pr0s)

Please post your compliments (just kiddin :dance: ), comments and bugs!

Thanks again to the people that helped me! :mad2:

Felix N. (tdlrali)

HF!

Posted Image3

OMG where are the files??

Now they're there^^

Edited by Felix N.

Share this post


Link to post
Share on other sites

Very good... ;)

Share this post


Link to post
Share on other sites

Hey!

Thanx for your replies and changes!

I downloaded the beta and installed it, but when i run the program, add the links and press the download button, the program just quits.....

Am i doing anything wrong? I installed the beta to [My AutoIt Folder]\beta, like it was suggested while installing the beta and i clicked Beta Compile in SciTE. But the program just quits like i said above

Please help..

Posted Image1

Just to make it more clear:

I put all the files in one folder, so thats not the problem. ;)

Posted Image2

Don't read the stuff above! :cheer::P

It didn't work due to an error in the _FileReplace function

Func _FileReplace($sPathFrom, $sPathTo)

 

Without the stuff i added it always returned 0, thus exiting the script.... ;)

Attached is the compiled exe (remove the au3 ending for the file "Downloader.exe.au3) and the 2 script files.

To compile the script, both files must be in the same folder and you need the beta version of AutoIt (just to make sure new people like me know how to compile^^, not for you pr0s)

Please post your compliments (just kiddin ;) ), comments and bugs!

Thanks again to the people that helped me! :mad2:

Felix N. (tdlrali)

HF!

@Felix, regaring the [.83] version, just uninstall the old version and install the new one! :cheer:

Regarding, _FileReplace function I did notice that it had a problem with the Return Value being "0" when it should not have. Thanks for the FIX!! :dance:

I notice you did not like my text input of the size type and changed it to numbers! I was thinking about that but left it text so it would be more noticable. But I see that yours works as well. :oops:

Also, I like the display windows do not appear till the Download button is pressed. But you might notice that the Downloaded size is not updated at the end of the download. Thus it down not match the Inetgetfile value.

Looks good so far. I have some other ideas to add and will post them as I get to it.. Keep up the good work!

Cheers.. :dance:

Share this post


Link to post
Share on other sites

Hey @ll!

BTW thanks busy your UDFs are really a good addition to my script!

I changed your _Filesize since i don't like having stuff like "GB" in functions, although it makes it more clear.

I also removed the round functions from the "Conversion Chart" and added it at the end, which gives more accurate values (i think ;) )

I added one line to the download loop so it updates the Downloaded size at the end. I think it didn't work because the script downloads some more bytes until it updates the field again, so the value is still a little bit smaller than the actual size! Was no problem to change at all^^

I was thinking about a msgbox that shows you your download speed at the end, would be nice!

Any further comments are welcome

Felix N. (tdlrali)

Share this post


Link to post
Share on other sites

Hey @ll!

BTW thanks busy your UDFs are really a good addition to my script!

I changed your _Filesize since i don't like having stuff like "GB" in functions, although it makes it more clear.

I also removed the round functions from the "Conversion Chart" and added it at the end, which gives more accurate values (i think ;) )

I added one line to the download loop so it updates the Downloaded size at the end. I think it didn't work because the script downloads some more bytes until it updates the field again, so the value is still a little bit smaller than the actual size! Was no problem to change at all^^

I was thinking about a msgbox that shows you your download speed at the end, would be nice!

Any further comments are welcome

Felix N. (tdlrali)

Nice adds. The download speed could be added to the last display box with the file location. I see you implemented the '0 Bytes' return instead of an error message.. Someone else had mentioned it on another thread where I posted the UDF.

Cheers.. :P

Share this post


Link to post
Share on other sites

I read the "0 Bytes" thread, thats why I implemented it^^.

I have the script with the download speed on my home computer, i'll submit it later today.

Was pretty easy to implement B)

Any more suggestions?

Felix N. (tdlrali)

Share this post


Link to post
Share on other sites

Any more suggestions?

Yes, please change your avatar... I don't even want to try to explain having that on my screen when my boss comes by. B)

[u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote]

Share this post


Link to post
Share on other sites

#17 ·  Posted (edited)

Ok I CHANGED MY AVATAR! B)

Here the new script that shows the downloadspeed at the end:

http://www.autoitscript.com/fileman/users/tdlrali/Downloader/ (I will always post the new version there!)

Hope you guys find bugs this time^^

HF!

Felix N. (tdlrali)

Edited by Felix N.

Share this post


Link to post
Share on other sites

how about an "Open File" or Open Folder" after download is complete

like this

1st add... $win1 =

$win1 = GUICreate("Downloader 1.06b", 380, 230)

2nd add/change

If $Download Then
                        $speed = _DownloadSpeed($rmtfile_size,$starttime)
                        _Progress_Update ($Progress_1, 100)
                        GUICtrlSetData($Input_dled,GUICtrlRead($Input_size))
                    ;MsgBox(64, "Download finished!", "Download finished!" & @CRLF & "File can be found at:" & @CRLF & $localfile & @CRLF & @CRLF & "Your downloadspeed:" & @CRLF & $speed)
                        Open_File()
                        ExitLoop
                    Else

3rd add the function

Func Open_File()
    Sleep(4000)
    GUISetState( @SW_HIDE,$win1)    
    
    $win2 = GUICreate("Downloader 1.05b", 380, 230)
    $Button_open = GUICtrlCreateButton("Open File", 20, 180, 100, 30)
    $Button_view = GUICtrlCreateButton("Open Folder", 140, 180, 100, 30)
    $Button_cancel = GUICtrlCreateButton("Exit", 260, 180, 100, 30)
    $Location = GUICtrlCreateInput($localfile, 70, 50, 230, 20)
    $Label_finished = GUICtrlCreateLabel("Download finished!", 10, 20, 250, 20)
    $Label_saved = GUICtrlCreateLabel("Saved to:", 10, 50, 50, 20)


GUISetState()
While 2
    
    $msg2 = GUIGetMsg()
    Select
        Case $msg2 = $GUI_EVENT_CLOSE
            Return
        Case $msg2 = $Button_open
            Run(@ComSpec & " /C START " & $localfile, "", @SW_MINIMIZE)
        Case $msg2 = $Button_view
            Run( "explorer.exe " & $Input_to_tmp, "")
        Case $msg2 = $Button_cancel
            Return
    EndSelect
    
WEnd

GUIDelete($win2)    
GUISetState( @SW_SHOW,$win1)
EndFunc

THIS does not seem to work if the file is placed in "Program Files'

OTHERWISE it works great

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

I read the "0 Bytes" thread, thats why I implemented it^^.

I have the script with the download speed on my home computer, i'll submit it later today.

Was pretty easy to implement :o

Any more suggestions?

Felix N. (tdlrali)

I figured as much! Great, I will check it out..

Cheers.. B)

Share this post


Link to post
Share on other sites

Ok I CHANGED MY AVATAR! :graduated:

Here the new script that shows the downloadspeed at the end:

http://www.autoitscript.com/fileman/users/tdlrali/Downloader/ (I will always post the new version there!)

Hope you guys find bugs this time^^

HF!

Felix N. (tdlrali)

@FelixN., just downloaded the v1.06 and checked out your download speed addon, very nice. ?? Do you think there is any reason to add a ByteCompare to see if the "$rmtfile_size" matchs the @InetGetBytesRead total? It might be over kill. Let me know.. B)

Cheers.. :o

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0