Skip to content

Commit 434bed9

Browse files
authored
Merge pull request #93 from albertfougy/albert_dev
improved on script with aria2c
2 parents 4ebf481 + d1b84f8 commit 434bed9

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

get_latest_dumps.sh

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#/bin/bash
1+
#!/bin/bash
22
#set -xv
33

44
USER_AGENT="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_2) AppleWebKit/534.51.22 (KHTML, like Gecko) Version/5.1.1 Safari/534.51.22"
@@ -13,8 +13,19 @@ TEST=""
1313

1414
echo "" > $D_TMP
1515

16-
for f in `wget -c --user-agent="$USER_AGENT" --header="$ACCEPT" -qO- $D_URL_LIST | grep -Eio "$D_PATTERN" | sort | uniq | tail -n 4` ; do
17-
echo $D_URL_DIR$f >> $D_TMP
16+
for f in $(wget -c --user-agent="$USER_AGENT" --header="$ACCEPT" \
17+
-qO- $D_URL_LIST | grep -Eio "$D_PATTERN" | sort | uniq | tail -n 4) ; do
18+
echo $D_URL_DIR$f >> $D_TMP
1819
done
1920

20-
wget -c --user-agent="$USER_AGENT" --header="$ACCEPT" --no-clobber --input-file=$D_TMP $TEST --progress=bar
21+
if ! type "aria2c" > /dev/null; then
22+
wget -c --user-agent="$USER_AGENT" --header="$ACCEPT" --no-clobber \
23+
--input-file=$D_TMP $TEST --show-progress --progress=bar
24+
else
25+
IFS='
26+
'
27+
28+
for f in $(cat $D_TMP); do
29+
aria2c -c "$f"
30+
done
31+
fi

0 commit comments

Comments
 (0)