diff options
author | xyz <gky44px1999@gmail.com> | 2021-08-31 13:36:05 -0700 |
---|---|---|
committer | xyz <gky44px1999@gmail.com> | 2021-08-31 13:36:05 -0700 |
commit | ac1f038d84b2520d8eafc887494b94981d622b86 (patch) | |
tree | 502b23d0fd7a9f815981c480d0f02a2948a0ca52 | |
parent | 0c908e6e84248bdcfad00fb8cb4810e826be8d7d (diff) |
refactor
-rwxr-xr-x | .local/bin/curlkg | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/.local/bin/curlkg b/.local/bin/curlkg index d3248953..3eaa4d5b 100755 --- a/.local/bin/curlkg +++ b/.local/bin/curlkg @@ -22,7 +22,7 @@ done [ -z "$uid" ] && echo 'error: must provide share_uid ex: curlkg -u 649b9e82272a348b ./' >&2 && exit 1 shift $((OPTIND-1)) -download_dir="${1:-./}" +download_dir="${1:-"$PWD"}" [ -d "$download_dir" ] || mkdir -p "$download_dir" get_json () @@ -30,7 +30,7 @@ get_json () curl -s -G --data-urlencode type=get_uinfo -d outCharset=utf-8 -d start="$1" -d num=$num -d share_uid="$uid" "$homepage_url" | sed -e 's/^MusicJsonCallback(//' -e 's/)$//' } -# is it possible not to write to a file? only pipe stdout? +# is it possible not to write to a file? only pipe stdout? should I? get_json 1 > "$tmp_json_file" ugc_total_count=$(jq '.data.ugc_total_count' "$tmp_json_file") # can also use while loop with i=$((i+1)) |