From c4f18d391d33a8fc4a60d8a66cdb54e7197a6d1f Mon Sep 17 00:00:00 2001 From: localhost_frssoft Date: Thu, 31 Mar 2022 19:59:33 +0300 Subject: [PATCH] compressed requests --- funkwhale-cli.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/funkwhale-cli.sh b/funkwhale-cli.sh index 52c8d83..c368259 100755 --- a/funkwhale-cli.sh +++ b/funkwhale-cli.sh @@ -6,18 +6,18 @@ default_player_command='mpv --no-vid --no-ytdl' funkwhale_api_check_api_limits() { - curl -s "https://$instance/api/v1/rate-limit/" | jj -p + curl -s --compressed "https://$instance/api/v1/rate-limit/" | jj -p } funkwhale_api_get_tracks() { - get_json=$(curl -s "https://$instance/api/v1/tracks?ordering=$ordering&playable=true&page=$1" 2>&1 | tee preload) + get_json=$(curl -s --compressed "https://$instance/api/v1/tracks?ordering=$ordering&playable=true&page=$1" 2>&1 | tee preload) jj -i preload -l 'results.#.uploads.0.listen_url' | sed 's/"//g' } funkwhale_api_get_tracks_from_channel() { - track_list=$(curl -s "https://$instance/api/v1/tracks?channel=$1&playable=true&include_channels=true") + track_list=$(curl -s --compressed "https://$instance/api/v1/tracks?channel=$1&playable=true&include_channels=true") echo "Loaded $(echo $track_list | jj count) podcasts" echo $track_list | jj -l results.#.title listen_urls=$(echo $track_list | jj -l results.#.listen_url | sed 's/"//g') @@ -31,7 +31,7 @@ funkwhale_api_get_tracks_from_channel() funkwhale_get_podcasts_artists() { echo 'Loading podcast artists...' - curl -s --output preload "https://$instance/api/v1/artists?ordering=-creation_date&playable=true&include_channels=true&content_category=podcast&page=$1" + curl -s --compressed --output preload "https://$instance/api/v1/artists?ordering=-creation_date&playable=true&include_channels=true&content_category=podcast&page=$1" counter=0 count_artists=$(jj -i preload count) echo "$count_artists avalaible"