#!/usr/bin/env python
"""A simple download script."""
# get_8bp079.py, downloads a bunch of files.
# Copyright (C) 2008 Joakim Soderlund
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
import urllib
__version__ = "1.0"
__author__ = "Joakim Soderlund"
__license__ = "GPLv3"
__copyright__ = "Copyright (C) 2008 Joakim Soderlund"
def dlfile(url):
"""Downloads a file to the current directory."""
urllib.urlretrieve(url, url.split("/")[-1])
if __name__ == "__main__":
print "Downloading five files, please wait..."
filelist = [
"http://www.8bitpeoples.com/mp3/get/497/8bp079-01-random-sitges_savepoint.mp3",
"http://www.8bitpeoples.com/mp3/get/498/8bp079-02-random-micawbers_moan.mp3",
"http://www.8bitpeoples.com/mp3/get/499/8bp079-03-random-lightyears_500.mp3",
"http://www.8bitpeoples.com/mp3/get/500/8bp079-04-random-hux_flux_deluxe.mp3",
"http://www.8bitpeoples.com/mp3/get/501/8bp079-05-random-spontaneous_devotion.mp3"
]
for a in filelist:
print "Downloading %s..." % a
dlfile(a)
print "Download completed!"