whatever
This commit is contained in:
parent
20b8930ee6
commit
e4732d88cd
2 changed files with 27 additions and 4 deletions
2
boorufind
Normal file → Executable file
2
boorufind
Normal file → Executable file
|
@ -24,7 +24,7 @@ push() {
|
|||
page=1
|
||||
while; do
|
||||
once=0
|
||||
${curl[@]} -G -d page=search -d limit=100 -d page=$page $de tags=$q $url \
|
||||
${curl[@]} -G -d limit=100 -d page=$page $de tags=$q $url \
|
||||
| xml2 2>/dev/null \
|
||||
| while IFS== read -r tree val; do
|
||||
[ $tree = /posts/post ] && push && continue
|
||||
|
|
29
boorugrab
Normal file → Executable file
29
boorugrab
Normal file → Executable file
|
@ -4,14 +4,37 @@ url='http://danbooru.donmai.us/data/'
|
|||
|
||||
curl=(curl -sS -m 900 --connect-timeout 8 --retry 3 --retry-delay 1)
|
||||
|
||||
cleanup() {
|
||||
[ -e $dir/$md5e ] && {
|
||||
rm -f $dir/$md5e
|
||||
echo "\e[F\e[K$md5e - canceled"
|
||||
}
|
||||
exit 1
|
||||
}
|
||||
trap cleanup INT
|
||||
|
||||
mkdir -p $dir
|
||||
while read -r; do
|
||||
if [[ ${REPLY[1]} = "#" ]]; then
|
||||
md5e=${REPLY:1}
|
||||
${curl[@]} $url$md5e > $dir/$md5e || rm -f $dir/$md5e
|
||||
echo "$md5e - downloading..."
|
||||
${curl[@]} $url$md5e > $dir/$md5e || {
|
||||
rm -f $dir/$md5e
|
||||
echo "\e[F\e[K$md5e - failed"
|
||||
}
|
||||
echo "\e[F\e[K$md5e - downloaded!"
|
||||
else
|
||||
md5e=${REPLY##*/}
|
||||
[ -s $dir/$md5e ] && continue
|
||||
[ $REPLY -ef $dir/$md5e ] || cp $REPLY $dir
|
||||
[ $REPLY -ef $dir/$md5e ] && {
|
||||
echo "$md5e - skipping (ef)"
|
||||
continue
|
||||
}
|
||||
[ -s $dir/$md5e ] && {
|
||||
echo "$md5e - skipping (s)"
|
||||
continue
|
||||
}
|
||||
echo "$md5e - copying..."
|
||||
cp $REPLY $dir
|
||||
echo "\e[F\e[K$md5e - copied!"
|
||||
fi
|
||||
done
|
||||
|
|
Loading…
Reference in a new issue