AutoHotkey Community

It is currently May 27th, 2012, 11:59 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: WGET for Windows
PostPosted: November 6th, 2010, 10:56 am 
Offline

Joined: December 20th, 2005, 4:15 am
Posts: 165
Location: Malaysia
This is a well known utility in Unix, and it's now available for Windows. I've been testing it since yesterday and can confirm that it works well with AHK. It has more options, and is more robust than UrlDownloadToFile.

WGET for Windows
http://users.ugent.be/~bpuype/wget/

From the man page:

GNU Wget is a free utility for non-interactive download of files from the Web. It supports http, https, and ftp protocols, as well as retrieval through http proxies.

Some example code with AHK:

Code:
Url2Download=http://www.example.com/getfile.proc.php?getfile_type=tenant_download_file_id=233

SaveFile=Important Document.pdf

RunWait, wget.exe --tries=15 --waitretry=3 --read-timeout=45 --no-proxy -O "%SaveFile%" %Url2Download%,  , ,



Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 8th, 2010, 12:13 pm 
Offline

Joined: April 19th, 2005, 10:26 am
Posts: 2250
Location: switzerland
thank you Lemming for wget example and link
( if you like Poon Sow Keng http://www.youtube.com/watch?v=qlEnmt8Vntg )
also an example, ahk script in A_scriptdir, put wget.exe in subfolder wget
Code:
R3M=c:\_TEST
ifnotexist,%R3M%
FileCreateDir,%R3M%

C1=http://www.autohotkey.com/download/CurrentVersion.txt
C2=http://blog.fefe.de/
;C3=http://www.beakauffmann.com/mpb_0-9/som/24-horas-de-amor.mid

WGET ="%A_SCRIPTDIR%\wget\wget.exe"

SplitPath,C1, name1, dir, ext, name_no_ext, drive
SplitPath,C2, name2, dir, ext, name_no_ext, drive
SplitPath,C3, name3, dir, ext, name_no_ext, drive

if name1=
   name1=index.html
if name2=
   name2=index.html
if name3=
   name3=index.html

;runwait,%COMSPEC% /k %wget% %C1% --tries=1 --directory-prefix=%R3M%,,
runwait,%COMSPEC% /c %wget% %C1% --tries=15 --waitretry=3 --read-timeout=45 --no-proxy --directory-prefix=%R3M%,,
runwait,%COMSPEC% /c %wget% %C2% --tries=15 --waitretry=3 --read-timeout=45 --no-proxy --directory-prefix=%R3M%,,
;runwait,%COMSPEC% /k %wget% %C3% --tries=15 --waitretry=3 --read-timeout=45 --no-proxy --directory-prefix=%R3M%,,        ;-- forbidden

run,%r3m%\%name1%
sleep,3000
run,%r3m%\%name2%
;sleep,3000
;run,%r3m%\%name3%
exitapp


;------- example 2 Lemming ----
A2:
C3=http://www.autohotkey.com/download/CurrentVersion.txt
SplitPath,C3, name, dir, ext, name_no_ext, drive
SaveFile=%A_scriptdir%\%name%
RunWait, %wget% --tries=15 --waitretry=3 --read-timeout=45 --no-proxy -O "%SaveFile%" %C3%,  , ,
return


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 3 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group