Compare commits
3 Commits
1eadb44490
...
ff36e65ed7
Author | SHA1 | Date | |
---|---|---|---|
ff36e65ed7 | |||
42148e6292 | |||
bdef1cac44 |
@ -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
1120
spotify/playlist.txt
Normal file
File diff suppressed because it is too large
Load Diff
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user