Compare commits

..

3 Commits

Author SHA1 Message Date
ff36e65ed7
text mode playlist 2024-11-17 20:09:27 +01:00
42148e6292
silent curl progress 2024-11-17 20:09:15 +01:00
bdef1cac44
update spotify, 1120 2024-11-17 20:09:05 +01:00
4 changed files with 2912 additions and 38 deletions

View File

@ -2,7 +2,7 @@
set -eu
BEARER_TOKEN_RES=$(
curl -L https://open.spotify.com/ \
curl -sL https://open.spotify.com/ \
| grep 'id="session"' \
| sed 's&.*<script id="session"[^>]*>&&' \
| sed 's/<.*//'
@ -11,7 +11,7 @@ BEARER_TOKEN=$(echo "$BEARER_TOKEN_RES" | jq -r .accessToken)
export BEARER_TOKEN
GUEST_TOKEN_RES=$(
curl -X POST https://clienttoken.spotify.com/v1/clienttoken \
curl -sX POST https://clienttoken.spotify.com/v1/clienttoken \
-H "Accept: application/json" -H "content-type: application/json" \
--data '{"client_data":{"client_version":"1.2.27.147.g503c721c","client_id":"d8a5ed958d274c2e8ee717e6a4b0971d","js_sdk_data":{"device_brand":"unknown","device_model":"unknown","os":"linux","os_version":"unknown","device_id":"nuhuh","device_type":"computer"}}}'
)

File diff suppressed because it is too large Load Diff

1120
spotify/playlist.txt Normal file

File diff suppressed because it is too large Load Diff

View File

@ -26,4 +26,8 @@ done \
| jq -s 'reduce .[] as $x ([]; . + $x)' \
| jq 'del(.. | .available_markets?, .added_by?, .popularity?)' > playlist.json
printf "downloaded %s songs metadata" "$(jq length playlist.json)"
printf "downloaded %s songs metadata\n" "$(jq length playlist.json)"
jq -r '.[].track | ( .name + " - " + (.album.artists | map(.name) | join(", ")) )' playlist.json \
| pv > playlist.txt
printf "and dumped it as text on %s\n" playlist.txt