From 55ca47392423c3358ae67cfe37bf586259676d22 Mon Sep 17 00:00:00 2001 From: xyz Date: Sat, 20 Nov 2021 22:56:41 -0800 Subject: curlkg; use & and wait, so no need to wait for curl, much faster --- home/xyz/.local/bin/curlkg | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'home/xyz/.local/bin/curlkg') 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" -- cgit v1.2.3-70-g09d2