diff --git a/scripts/yt-api-helper.sh b/scripts/yt-api-helper.sh index 479e6a2..c660f1b 100755 --- a/scripts/yt-api-helper.sh +++ b/scripts/yt-api-helper.sh @@ -262,12 +262,6 @@ case $endpoint_option in if [ -z $browse_id ]; then browse_id="UCXuqSBlHAE6Xw-yeJA0Tunw"; fi partial_data="\"browseId\":\"${browse_id}\"" - printf "Enter optional parameters (base64-encoded protobuf) []: " - read params - - if [ ! -z $params ]; then - partial_data="${partial_data},\"params\":\"${params}\"" - fi fi ;; @@ -292,16 +286,6 @@ case $endpoint_option in if [ -z $vid ]; then vid="dQw4w9WgXcQ"; fi partial_data="\"videoId\":\"${vid}\"" - - - if [ "$endpoint_option" = "player" ]; then - printf "Enter optional parameters (base64-encoded protobuf) []: " - read params - - if [ ! -z $params ]; then - partial_data="${partial_data},\"params\":\"${params}\"" - fi - fi fi ;; @@ -338,6 +322,28 @@ case $endpoint_option in esac +# +# Interactively request additional parameters for the supported endpoints +# + +if [ $interactive = true ] +then + case $endpoint_option in + + browse|player) + params=$(query_with_default "Enter optional parameters (base64-encoded protobuf)" "") + + if [ ! -z $params ]; then + partial_data="${partial_data},\"params\":\"${params}\"" + fi + ;; + esac +fi + +# new line +echo + + # # Interactive language/region selection #