Last active
June 1, 2023 10:43
-
-
Save Senci/f1bef044f12ee9212511b53ab7420e30 to your computer and use it in GitHub Desktop.
exports playlist to text format, when run on beatport playlist sites
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// exports playlist to text format, when run on beatport playlist sites | |
let playlist = '' | |
document.querySelectorAll('li.track').forEach(li => { | |
let title = li.querySelector('.buk-track-primary-title').textContent.replace(/\s+/g, ' ').trim() | |
let mix = li.querySelector('.buk-track-remixed').textContent.replace(/\s+/g, ' ').trim() | |
let artist = li.querySelector('.buk-track-artists').textContent.replace(/\s+/g, ' ').trim() | |
if (mix === 'Original Mix') { | |
playlist += `${artist} - ${title}\n` | |
} else { | |
playlist += `${artist} - ${title} (${mix})\n` | |
} | |
}) | |
console.log(playlist) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment