mirror of
https://github.com/iv-org/youtube-utils.git
synced 2024-10-01 03:45:35 -04:00
api-helper: Allow querying all clients at once
This commit is contained in:
parent
8df7834c36
commit
f82f81ff00
@ -569,11 +569,34 @@ fi
|
|||||||
# Run the request
|
# Run the request
|
||||||
#
|
#
|
||||||
|
|
||||||
client_select "$client_option"
|
# Only ran once (this requests some additional data in interactive mode)
|
||||||
endpoint_select "$endpoint_option"
|
endpoint_select "$endpoint_option"
|
||||||
|
|
||||||
if [ $interactive = true ]; then
|
if [ "$client_option" = "all" ]; then
|
||||||
data=$(make_request_data)
|
# Run the client selector (get client-specific infos) and request for each client
|
||||||
fi
|
if [ -z "$output" ]; then
|
||||||
|
printf "\nAll clients requested, response will be written to output file anyway\n" >&2
|
||||||
|
output=response-$endpoint_option.$(date '+%s')
|
||||||
|
else
|
||||||
|
output=$(basename "$output" ".json")
|
||||||
|
fi
|
||||||
|
|
||||||
send_request "$data" "$output"
|
for client_name in $ALL_CLIENTS; do
|
||||||
|
client_select "$client_name"
|
||||||
|
|
||||||
|
if [ $interactive = true ]; then
|
||||||
|
data=$(make_request_data)
|
||||||
|
fi
|
||||||
|
|
||||||
|
send_request "$data" "$output.$client_name.json"
|
||||||
|
done
|
||||||
|
else
|
||||||
|
# Run the client selection and request only once
|
||||||
|
client_select "$client_option"
|
||||||
|
|
||||||
|
if [ $interactive = true ]; then
|
||||||
|
data=$(make_request_data);
|
||||||
|
fi
|
||||||
|
|
||||||
|
send_request "$data" "$output"
|
||||||
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user