updated spotify_playlist_tracks.sh

pull/2/head
Hari Sekhon 4 years ago
parent 0d8a2524da
commit 1e23878ea0

@ -27,9 +27,7 @@ usage_args="<playlist_id> [<curl_options>]"
usage_description="
Returns track names for the spotify playlist for given playlist id argument or \$SPOTIFY_PLAYLIST (get this from spotify_playlists.sh)
Requires \$SPOTIFY_ACCESS_TOKEN in the environment (can generate from spotify_api_token.sh) or will auto generate from \$SPOTIFY_CLIENT_ID and \$SPOTIFY_CLIENT_SECRET if found in the environment
export SPOTIFY_ACCESS_TOKEN=\"\$('$srcdir/spotify_api_token.sh')\"
Requires \$SPOTIFY_CLIENT_ID and \$SPOTIFY_CLIENT_SECRET to be defined in the environment
"
# shellcheck disable=SC1090
@ -55,6 +53,10 @@ get_next(){
jq -r '.next' <<< "$output"
}
if [ -z "${SPOTIFY_ACCESS_TOKEN:-}" ]; then
export SPOTIFY_ACCESS_TOKEN="$("$srcdir/spotify_api_token.sh")"
fi
while [ -n "$url_path" ] && [ "$url_path" != null ]; do
output="$("$srcdir/spotify_api.sh" "$url_path" "$@")"
# shellcheck disable=SC2181

Loading…
Cancel
Save