| View previous topic :: View next topic |
| Author |
Message |
DeathByNukes
Joined: 25 Mar 2007 Posts: 14 Location: Mabase
|
Posted: Mon Apr 09, 2007 12:25 am Post subject: Using referrers in UrlDownloadToFile |
|
|
It would be nice to be able to specify the page referrer in UrlDownloadToFile since some websites require it. Maybe also add some other things like username/password. (I think username:password@www.com is disabled by default.)
I am trying to throw a DLL together with a modified version of UrlDownloadToFile in it for a project of mine right now but this would be much better. |
|
| Back to top |
|
 |
PhiLho
Joined: 27 Dec 2005 Posts: 6721 Location: France (near Paris)
|
Posted: Mon Apr 09, 2007 10:06 am Post subject: |
|
|
Well, this is only one little point to be improved among much more. olfen shown that a lot of work can be done with DllCalls, indeed, so it might be the way to go, unless exposing all WinSock to AHK...
If you can accept external utilities, something like cURL is very flexible and mature, you can do POST requests, choose a referrer, login, user-agent, and so on. _________________
vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2") |
|
| Back to top |
|
 |
DeathByNukes
Joined: 25 Mar 2007 Posts: 14 Location: Mabase
|
Posted: Tue Apr 10, 2007 4:44 am Post subject: |
|
|
I didn't want to use an external app because the script is automating many downloads and I didn't want to hear my system app open/close sounds going constantly. I didn't search for a dll since I figured nobody would've made one.
By the way, I've found that it would be quite easy to do referrers and other stuff by adding a headers option. The AHK command could send headers but leaves the option blank. |
|
| Back to top |
|
 |
PhiLho
Joined: 27 Dec 2005 Posts: 6721 Location: France (near Paris)
|
Posted: Tue Apr 10, 2007 6:58 am Post subject: |
|
|
You hear opening and closing sounds when running a command line utility in hidden mode? Perhaps you can disable these sounds, definitively or during the downloads.
As you point out, cURL can be used in its DLL form too.
And again, search olfen in the Scripts & Functions section, you will find lot of useful network scripts.
Note I don't tell your wish isn't valid, just that it might not get the highest priority, so I give workarounds. _________________
vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2") |
|
| Back to top |
|
 |
DeathByNukes
Joined: 25 Mar 2007 Posts: 14 Location: Mabase
|
Posted: Tue Apr 10, 2007 2:16 pm Post subject: |
|
|
Hah, he's replicated the command as a function! He could add the headers option himself. I couldn't use it though, because I'm downloading binaries.
As for the system sounds, I like them since they give me a better feel of the system. They tell me when a program is actually closed and when programs open in the background. I do hear a sound when a console window opens but not when it closes for some reason. If by "hidden mode" you mean hiding the window with AHK then it probably wouldn't change anything.
Next time I need to do this I'll probably use the cURL library. |
|
| Back to top |
|
 |
|