Skip to content

Instantly share code, notes, and snippets.

@abdes-zakari
Last active June 29, 2024 18:42
Show Gist options
  • Save abdes-zakari/37439ee54dc0b90649c9f97639996e98 to your computer and use it in GitHub Desktop.
Save abdes-zakari/37439ee54dc0b90649c9f97639996e98 to your computer and use it in GitHub Desktop.
Extract soundcloud urls from a playlist and create a m3u8 playlist
// Extract soundcloud url from a playlist
//open the soundcloud playlist in the browser and put this in the console of the brwoser
const tracks = document.getElementsByClassName("trackItem__trackTitle");
for (let i = 0; i < tracks.length; i++) {
console.log(tracks[i].href)
}
// Extract soundcloud url from a playlist and convert it to m3u8 format
const tracks = document.getElementsByClassName("trackItem__trackTitle");
let playlist;
for (let i = 0; i < tracks.length; i++) {
let item = "#EXTINF:-1, "+tracks[i].innerText+"\n" +tracks[i].href+"\n"
playlist+=item
//console.log(tracks[i].href)
}
console.log(playlist)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment