summaryrefslogtreecommitdiff
path: root/home/xyz
diff options
context:
space:
mode:
authorxyz <gky44px1999@gmail.com>2021-11-20 22:56:41 -0800
committerxyz <gky44px1999@gmail.com>2021-11-20 22:56:41 -0800
commit55ca47392423c3358ae67cfe37bf586259676d22 (patch)
treed4eed9a324d59fa13ca2d74779b270dead40400d /home/xyz
parent262d02c3c9b693e7d713697116e1d1a80962ecd6 (diff)
curlkg; use & and wait, so no need to wait for curl, much faster
Diffstat (limited to 'home/xyz')
-rwxr-xr-xhome/xyz/.local/bin/curlkg3
1 files changed, 2 insertions, 1 deletions
diff --git a/home/xyz/.local/bin/curlkg b/home/xyz/.local/bin/curlkg
index 624eb689..8ae0b49f 100755
--- a/home/xyz/.local/bin/curlkg
+++ b/home/xyz/.local/bin/curlkg
@@ -34,8 +34,9 @@ ugc_total_count=$(jq '.data.ugc_total_count' "$tmp_json_file")
# can also use while loop with i=$((i+1))
# the calculation considers both ugc_total_count%num==0 and ugc_total_count%num>0
for i in $(seq 2 $(((ugc_total_count+num-1)/num))); do
- get_json "$i"
+ get_json "$i" &
done
+wait
jq -r '.data.ugclist[]|"'"$music_url"'?shareid=\(.shareid)\n out=\(.title)_\(.time).m4a"' "$tmp_json_file" | aria2c -d "$download_dir" --auto-file-renaming=false --console-log-level=warn -i-
rm "$tmp_json_file"