Can you not just use a download manager?
There's better ones, but FlashGet has browser-integration, and supports authentication. You can login, click a bunch of links and queue them up and schedule the download.
You could write something that, say, acts as a proxy which catches specific links and queues them for later download, or a Javascript bookmarklet that modifies links to go to "http://localhost:1234/download_queuer?url=" + $link.href and have that queue the downloads - but you'd be reinventing the download-manager-wheel, and with authentication it can be more complicated..
Or, if you want the "login, click links" bit to be automated also - look into screen-scraping.. Basically you load the page via a HTTP library, find the download links and download them..
Slightly simplified example, using Python:
import urllib
from BeautifulSoup import BeautifulSoup
src = urllib.urlopen("http://%s:%s@example.com" % ("username", "password"))
soup = BeautifulSoup(src)
for link_tag in soup.findAll("a"):
link = link_tag["href"]
filename = link.split("/")[-1] # get everything after last /
urllib.urlretrieve(link, filename)
That would download every link on example.com, after authenticating with the username/password of "username" and "password". You could, of course, find more specific links using BeautifulSoup's HTML selector's (for example, you could find all links with the class "download", or URL's that start with http://cdn.example.com).
You could do the same in pretty much any language..