Jump to content

Small download tool

Recommended Posts

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 look http://www.autoitscript.com/fileman/users/tdlrali/Downloader/

Please post comments & bugs

Thx

tdlrali (Felix)

Edited by Felix N.

Share this post

Share on other sites

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

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

Edited by layer

FootbaG

Share this post

Share on other sites

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

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

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

Cheers..

Share this 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..

Share this 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

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

Share this 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..

Share this 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

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..

Share this 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

Felix N. (tdlrali)

1

Just to make it more clear:

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

2

Don't read the stuff above!

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....

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!

Felix N. (tdlrali)

HF!

3

OMG where are the files??

Now they're there^^

Edited by Felix N.

Very good...

Share this 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..

1

Just to make it more clear:

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

2

Don't read the stuff above!

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!

Felix N. (tdlrali)

HF!

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

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!!

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.

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..

Share this 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

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..

Share this 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

Any more suggestions?

Felix N. (tdlrali)

Share this 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.

[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

Share on other sites

Ok I CHANGED MY AVATAR!

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

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)

Cheers..

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...