#!/bin/zsh if test -e $_mwget_limit;then _mwget_limit=150;fi url=$(echo "$1"|sed -re 's,/*$,/,') o=$(basename "$url") cutdirs=$[ $(echo "$url"|sed -re 's@^(http|ftp)://([[:alnum:]]+|[._-:@]+)+/@@'|cut -d/ -f1- --output-delimiter=$'\n'|wc -l) -2 ] wget --tries=inf --waitretry=10 -c -r -np -nH --cut-dirs=$cutdirs --reject index.html --remove-listing --limit-rate=${_mwget_limit}k "$url" #-o"$(pwd)/${o}/wget.log"