X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=cmd%2Fdownload-warcs.zsh;h=0198ca25c744d6aacd9e2f8bf272064430590b34;hb=a10ac881c31515d23afad734c36392a9391e95b1;hp=ac9e589779d1028214230893ef75fed7477e6e61;hpb=012ff296ee4bf9ddfa766b18f561d8ffa308c1cc;p=feeder.git diff --git a/cmd/download-warcs.zsh b/cmd/download-warcs.zsh index ac9e589..0198ca2 100755 --- a/cmd/download-warcs.zsh +++ b/cmd/download-warcs.zsh @@ -3,6 +3,8 @@ set -e fpath=($0:h:a/functions.zsh $fpath) dst=$2:a cd $1 +[[ -n "$dst" ]] || { dst=warcs ; dst=$dst:a } +mkdir -p $dst autoload url-to-filename zmodload -F zsh/datetime b:strftime setopt EXTENDED_GLOB @@ -27,7 +29,7 @@ for new (new/*(N)) { wget_opts=(--output-document=$tmp $wget_opts) } fn=$(url-to-filename $url)-$(strftime %Y%m%d-%H%M%S) - wget $wget_opts --output-file=warc.log --warc-file=$dst/$fn $url - print $fn + wget $wget_opts --output-file=warcs.log --warc-file=$dst/$fn $url + print $dst/$fn.warc done < $new }