This python script can get an image from a network camera with basic http auth

Tested with a Dlink DCS-900

images/dcs-900.jpg
#!/usr/local/bin/python

# Derived from the example in Python Library Reference


import urllib2

# create an OpenerDirector with support for Basic HTTP Authentication...
auth_handler = urllib2.HTTPBasicAuthHandler()
auth_handler.add_password('Administrator or User', 'webcam.ath.cx', 'admin', 'password')
opener = urllib2.build_opener(auth_handler)
# ...and install it globally so it can be used with urlopen.
urllib2.install_opener(opener)
image = urllib2.urlopen('http://webcam.ath.cx/IMAGE.JPG').read()
file = open('/home/admin/www/webcam.jpg', 'w')
file.write(image)
file.close()