Last active
July 18, 2025 17:56
-
-
Save uahim/57405f329430ce986affcd1999dc076e to your computer and use it in GitHub Desktop.
spotify playlist to plain text list bookmarklet
This file contains hidden or 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
// this will scrape a button attribute and convert | |
// More options for The Wounds We Bled by Heather Nova | |
// to | |
// Heather Nova - The Wounds We Bled | |
// | |
// works only if the spotify ui language is english | |
var mlnk = ""; | |
for (var i = 0, l = document.querySelectorAll('[data-testid="more-button"]').length - 1; i < l; ++i) { | |
if (document.querySelectorAll('[data-testid="more-button"]')[i].getAttribute("aria-label")) { | |
if (document.querySelectorAll('[data-testid="more-button"]')[i].getAttribute("aria-label").indexOf("More options for ") != -1) { | |
if (document.querySelectorAll('[data-testid="more-button"]')[i].getAttribute("aria-label").indexOf(" by ") != -1) { | |
var artisttitle = document.querySelectorAll('[data-testid="more-button"]')[i].getAttribute("aria-label").replace("More options for ", "").split(" by "); | |
mlnk += artisttitle[1] + " - " + artisttitle[0] + "\n"; | |
} | |
} | |
} | |
} | |
alert(mlnk) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment