Jump to content

Downloading Via Firefox


Marlo
 Share

Recommended Posts

Hello!

OK so i have a new idea for an autoit script that will take a number of download links and then download them via firefox.

I have already made this script:

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

Global $FireFox = "C:\Program Files\Mozilla Firefox 3 Beta 5\firefox.exe "

Opt("GUIOnEventMode", 1)
Opt("WinTitleMatchMode", 1)

$winMain = GUICreate("Firefox Multi-Link Downloader", 571, 216, 193, 125)
$txtLinks = GUICtrlCreateEdit("", 8, 8, 553, 169)
$btnDownload = GUICtrlCreateButton("Download", 488, 184, 75, 25, 0)
GUISetState(@SW_SHOW)

GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")
GUICtrlSetOnEvent($btnDownload, "_Download")

While 1
    
WEnd

Func _Download()
    Local $Text, $Links, $I
    $Text = GUICtrlRead($txtLinks)
    If $Text = "" Then 
        MsgBox(48, "Error", "You did not enter any links")
    Else
        GUISetState(@SW_HIDE)
        $Links = StringSplit($Text, @CRLF)
        For $I = 1 To Ubound($Links) -1
            If $Links[$I] = "" Then ContinueLoop
            Run($FireFox & $Links[$I])
            WinActivate("Mozilla Firefox")
            WinWaitActive("Opening")
            ControlClick("Opening", "", "MozillaWindowClass1", "left", 1, 46, 158)
            sleep(1000)
            ControlClick("Opening", "", "MozillaWindowClass1", "left", 1, 241, 237)
            Sleep(1000)
        Next
        Exit
    EndIf
EndFunc

Func _Exit()
    Exit
EndFunc

But i dont like it for the following reasons:

1) It leaves the tabs open after the the download has opened.

2) it requires firefox to be active

3) it uses a clicking method (which i hate)

Now i want to be able to just directly download the files without having the Firefox confirmation window and also nopt to have to click.

I tried looking to see whether Firefox had anyway Command Line stuff for this sort of thing but no dice.

Any ideas?

P.S it has to be firefox becuase of the cookies.

Click here for the best AutoIt help possible.Currently Working on: Autoit RAT
Link to comment
Share on other sites

You can integrate firefox as an object (see automating Mozilla/Firefox) - (for the properties and methods that might be relevant try the web or the source code for firefox / the activex control)

Hello!

OK so i have a new idea for an autoit script that will take a number of download links and then download them via firefox.

I have already made this script:

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

Global $FireFox = "C:\Program Files\Mozilla Firefox 3 Beta 5\firefox.exe "

Opt("GUIOnEventMode", 1)
Opt("WinTitleMatchMode", 1)

$winMain = GUICreate("Firefox Multi-Link Downloader", 571, 216, 193, 125)
$txtLinks = GUICtrlCreateEdit("", 8, 8, 553, 169)
$btnDownload = GUICtrlCreateButton("Download", 488, 184, 75, 25, 0)
GUISetState(@SW_SHOW)

GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")
GUICtrlSetOnEvent($btnDownload, "_Download")

While 1
    
WEnd

Func _Download()
    Local $Text, $Links, $I
    $Text = GUICtrlRead($txtLinks)
    If $Text = "" Then 
        MsgBox(48, "Error", "You did not enter any links")
    Else
        GUISetState(@SW_HIDE)
        $Links = StringSplit($Text, @CRLF)
        For $I = 1 To Ubound($Links) -1
            If $Links[$I] = "" Then ContinueLoop
            Run($FireFox & $Links[$I])
            WinActivate("Mozilla Firefox")
            WinWaitActive("Opening")
            ControlClick("Opening", "", "MozillaWindowClass1", "left", 1, 46, 158)
            sleep(1000)
            ControlClick("Opening", "", "MozillaWindowClass1", "left", 1, 241, 237)
            Sleep(1000)
        Next
        Exit
    EndIf
EndFunc

Func _Exit()
    Exit
EndFunc

But i dont like it for the following reasons:

1) It leaves the tabs open after the the download has opened.

2) it requires firefox to be active

3) it uses a clicking method (which i hate)

Now i want to be able to just directly download the files without having the Firefox confirmation window and also nopt to have to click.

I tried looking to see whether Firefox had anyway Command Line stuff for this sort of thing but no dice.

Any ideas?

P.S it has to be firefox becuase of the cookies.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...