remove duplicate download function
use getopts to retreive options
add -l option to output unrestricted links (fix #2)