diff --git a/funkwhale-cli.sh b/funkwhale-cli.sh index e7d0191..85f7248 100755 --- a/funkwhale-cli.sh +++ b/funkwhale-cli.sh @@ -324,6 +324,20 @@ case "$choice" in echo '' fi clear + export auth="$(jj -i .auth.json "$(echo $instance | sed 's/\./\\\./g')")" + if [ -n "$auth" ]; then + default_curl_opt() + { + curl -s --compressed -H "Authorization: Bearer $auth" $1 + } + listen_token=$(default_curl_opt "$instance_point/users/me" | jj tokens.listen) + echo '+Authorized account+' + else + default_curl_opt() + { + curl -s --compressed $1 + } + fi get_all_avalaible_count_tracks fi ;;