Skip to content

Instantly share code, notes, and snippets.

@n1try n1try/deezer2json.js
Last active Mar 24, 2018

Embed
What would you like to do?
Export Deezer playlist to JSON
/*
1. Go to Deezer.com and open the playlist you want to export, e.g. https://www.deezer.com/en/profile/850026602/loved
2. Scroll down to the very bottom
3. Open your browser's dev tools (F12 on Linux an Windows) and go to the Console tab
4. Paste the following one-line command and hit enter
*/
JSON.stringify(Array.prototype.slice.call(document.getElementsByClassName('datagrid-row song')).map(r => Object.assign({}, {title: r.getElementsByClassName('title')[0].childNodes[0].textContent, artist: Array.prototype.slice.call(r.querySelectorAll('[itemprop="byArtist"]')).map(a => a.textContent).reduce((acc, a) => a + ', ' + acc, '').slice(0, -2)})), null, 2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.