AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Using referrers in UrlDownloadToFile

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Wish List
View previous topic :: View next topic  
Author Message
DeathByNukes



Joined: 25 Mar 2007
Posts: 14
Location: Mabase

PostPosted: Mon Apr 09, 2007 12:25 am    Post subject: Using referrers in UrlDownloadToFile Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website AIM Address MSN Messenger
PhiLho



Joined: 27 Dec 2005
Posts: 6721
Location: France (near Paris)

PostPosted: Mon Apr 09, 2007 10:06 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
DeathByNukes



Joined: 25 Mar 2007
Posts: 14
Location: Mabase

PostPosted: Tue Apr 10, 2007 4:44 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website AIM Address MSN Messenger
PhiLho



Joined: 27 Dec 2005
Posts: 6721
Location: France (near Paris)

PostPosted: Tue Apr 10, 2007 6:58 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
DeathByNukes



Joined: 25 Mar 2007
Posts: 14
Location: Mabase

PostPosted: Tue Apr 10, 2007 2:16 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website AIM Address MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Wish List All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group