Skip to content

Instantly share code, notes, and snippets.

@snipem
Created June 1, 2016 18:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save snipem/bdbfb45d10245e0de3846f82dc2692b3 to your computer and use it in GitHub Desktop.
Save snipem/bdbfb45d10245e0de3846f82dc2692b3 to your computer and use it in GitHub Desktop.
Lists all your Deezer playlists, put's them to a file for you to edit, deletes all the playlists listed in that file
access_token="ENTER_YOUR_DEEZER_ACCESS_CODE_HERE"
nr_to_fetch="1000"
#curl https://api.deezer.com/user/me?access_token=$access_token
curl "http://api.deezer.com/user/me/playlists?access_token=$access_token&limit=$nr_to_fetch&index=0" | jq '.data[] | "\(.title),\(.nb_tracks),\(.id)"' > all_playlists.txt
# NOW Edit all_playlists.txt and copy it to all_playlists_edited.txt
cat all_playlists_edited.txt | awk -F, '{print $3}'| sed "s/\"//g" |
while read line ; do
echo Deleting $line
curl -X "DELETE" http://api.deezer.com/playlist/$line?access_token=$access_token
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment