mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 10:47:04 +02:00
feat: parallel
This commit is contained in:
1 parent
1b884a52f9
commit
78160041e8
1 file changed
+15
-5
@@ -129,21 +129,31 @@ jobs:
|
||||
mkdir -p temp/game
|
||||
|
||||
i=1
|
||||
urls=()
|
||||
|
||||
while :; do
|
||||
part=$(printf "%03d" $i)
|
||||
url="${ARCHIVE_URL}.${part}"
|
||||
|
||||
echo "Downloading $url"
|
||||
|
||||
if wget -q -O "temp/archives/part.${part}" "$url"; then
|
||||
if wget --spider -q "$url"; then
|
||||
urls+=("$url")
|
||||
((i++))
|
||||
else
|
||||
echo "Last part: $part"
|
||||
rm -f "temp/archives/part.${part}"
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
for u in "${urls[@]}"; do
|
||||
echo "$u"
|
||||
done
|
||||
|
||||
for url in "${urls[@]}"; do
|
||||
part=$(basename "$url")
|
||||
wget -q -O "temp/archives/$part" "$url" &
|
||||
done
|
||||
|
||||
wait
|
||||
|
||||
7z x temp/archives/part.001 -otemp/game
|
||||
rm -rf temp/archives
|
||||
|
||||
|
||||
Reference in new issue
Block a user