Sign in to follow this  
Followers 0
MuffettsMan

Basic IE Download Manager

3 posts in this topic

I ran into this site that had 300+ zip files I was wanting to download and even though the direct links would open / download just fine in IE seemed to be blocked by those standard download managers like getright. so... i took my rudimentary non 1337 skill and came up with this script.

basically it reads a file in of full url's that needs to be downloaded, opens the link up in IE attempts to (blindly) navigate the save button / save to windows then monitors for the downloading window to complete before attempting to download the next file (oh other detail - site would only allow one download at a time so keeping it from opening up multiple windows was critical) I guess a few things to clean up would be better interaction with those save as popup windows (it didn't seem to react well at all to any WinWaitActive attempts not sure if it was just my lack of knowledge or that each of the windows had the same class id and it wasn't picking up on the different title names) anyway and finally removing confirmed downloads from the original list file but either way figured i'd post what managed to work for me:

; *******************************************************
; Create a browser window and navigate to a website
; *******************************************************
;
#include <IE.au3>

$file = FileOpen("download_URLs.txt", 0)

; Check if file opened for reading OK
If $file = -1 Then
    MsgBox(0, "Error", "Unable to open file.")
    Exit
EndIf

; Read in lines of text until the EOF is reached
While 1
    $line = FileReadLine($file)
    If @error = -1 Then ExitLoop

    MsgBox(4096, "Line read:", $line, 1)
    $oIE = _IECreate ($line, 1, 1, 1)

; Wait for the File Download box to pop up 
; Send Alt + S
    Sleep (2000)
    Send("!s")
; Enter to start downloading
    Sleep (2000)
; WinWait("Save As", "", 1)
    Send("{ENTER}")
    
; MsgBox(0, "", "Starting download", 1)

    Sleep (2000)

; Now the download box should be up its class id: #32770
; Pausing script till this box is gone (download done)
; So that we won't have multiple downloads at once.
    WinWaitClose("[CLASS:#32770]", "")

    Sleep (2000)
Wend

FileClose($file)

Don't let that status fool you, I am no advanced memeber!

Share this post


Link to post
Share on other sites



I don't understand, Alt+S? What does that do?

Share this post


Link to post
Share on other sites

I don't understand, Alt+S? What does that do?

in IE if your link is a file to download you get a Save As download msg box (first with the option to either open | save | cancel... if you click save or simply use the hotkey Alt + S then the next popup is Save As file location box thus press enter to start the download saving it in the default location...

basicly i couldn't find a way to directly integrate with those popup windows... luckily the WinWaitClose on the download progress window didn't give much grief as it was the only critical popup <_<


Don't let that status fool you, I am no advanced memeber!

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