Skip to content

Instantly share code, notes, and snippets.

@pheuter
Created March 5, 2012 20:44
Show Gist options
  • Save pheuter/1980967 to your computer and use it in GitHub Desktop.
Save pheuter/1980967 to your computer and use it in GitHub Desktop.
Bookmarklet that generates download link for a Soundcloud upload
(function(d) {
var dl = d.createElement('a');
dl.innerText = 'Download MP3';
dl.href = "http://media.soundcloud.com/stream/"+d.querySelector('#main-content-inner img[class=waveform]').src.match(/\.com\/(.+)\_/)[1];
dl.download = d.querySelector('em').innerText+".mp3";
d.querySelector('.primary').appendChild(dl);
dl.style.marginLeft = '10px';
dl.style.color = 'red';
dl.style.fontWeight = 700;
})(document);
/** Minified **/
(function(b){var a=b.createElement("a");a.innerText="Download MP3";a.href="http://media.soundcloud.com/stream/"+b.querySelector("#main-content-inner img[class=waveform]").src.match(/\.com\/(.+)\_/)[1];a.download=b.querySelector("em").innerText+".mp3";b.querySelector(".primary").appendChild(a);a.style.marginLeft="10px";a.style.color="red";a.style.fontWeight=700})(document);
@rediris
Copy link

rediris commented Jul 1, 2012

@britishtea: You have managed to insult every musician I know with your statement above: "You seem to think that being a musician is a job. It's not, it is a hobby." Just because people "play" music doesn't mean it isn't work. There are musicians who earn all of their income via music – people who practice, perform, teach, etc. Does that make it a hobby?

I wish there were a script to prevent people like you from having any access to music, just to serve you right for taking musicians for granted.

As for this script, it enables something that is disabled by default for those musicians who chose to disable downloads. If an artists chooses to disable downloading, but allows streaming, why not just respect it?

And, again, I bring up the point of dialogue - why not just ask? Why take?

@britishtea
Copy link

I'm a musician myself :) I'm not saying being a musician can't be a job. It obviously can. I'm just saying that if you chose to spend your time making music, you aren't (automatically) entitled to payment. Especially not when you put your 'product' online for free. If you find someone who will hire you to record an album, great!

There's a small difference between streaming and downloading, one that is mostly visual. In the end they achieve the same result: they deliver a file from a server to a client. The client can do whatever he wants with the files he receives. One of those things is play the file with the Soundcloud player, but there is a lot more you can do with that file. If you have a problem with that, you shouldn't let the server send files to client in the first place.

As to your point of dialogue, the answer is simplicity.

P.S. I'm a musician myself.

@rediris
Copy link

rediris commented Jul 1, 2012

@britishtea:

As a musician, you're obviously used to shooting yourself in the foot when it comes to visualizing the value placed on your creative efforts. I suggest you think more highly of your efforts. It's true a musician who puts their stuff online for sale isn't entitled to payment (that is a factor of how "deserving" they are in the eyes [or ears] of the listener [it's subjective, isn't it?]), but it also doesn't entitle the listener to the track for free, especially without asking.

As for the streaming/downloading debate: the whole point in preventing downloading is to ensure that a client doesn't do whatever he/she wants with the file "received". Streaming a file doesn't entitle the listener to ownership - it entitles A streaming file isn't cached locally - it is streamed from the server. In many cases, the actual URL is obfuscated. Why go to all this trouble if there is "no difference" between downloading and streaming?

As to your response about simplicity, why not call a spade a spade - it is laziness and utter disregard for a human connection. It is rooted in a trigger-happiness based on convenience. And I would argue that as a musician, this trigger-happy mentality has already helped undermine your career as a musician, hobby or not.

P.S. Send me a link to your Soundcloud tracks, so I can use this bookmarklet to "stream" your songs.

@britishtea
Copy link

I'll stop replying here now, as I've said what I wanted to say. This bookmarktlet was a convenient tool to enjoy some good music that's freely available on the internet in other players than the Soundcloud player.

Here's a link to my Soundcloud profile: https://soundcloud.com/jipjip. Do with it what you want :)

@felixfischer
Copy link

Guys, sorry to disturb your conversation, but let's get back to hacker business: This bookmarklet should be updated to work with the next version of Soundcloud: http://next.soundcloud.com/

@duncanbeevers
Copy link

My updated version is still working on the original site. I've added myself to the soundcloud next waiting list, and I'll go ahead and update or create a new version to get things working over there too.

@jojbot
Copy link

jojbot commented Dec 10, 2012

britishtea - you are an idiot.

@CamiloMM
Copy link

Completely agreed with @jojbot. @britishtea, please go fork yourself, thanks.

But I'll still download songs because you know what? If I listen it on SoundCloud or an MP3 player, it makes no difference whatsoever.

@marcandrebenoit
Copy link

@duncanbeevers do you know if your version could be modified to be used on mixcloud as well ?
(maybe not.. not the same API etc etc..)

@Hexkbr
Copy link

Hexkbr commented Feb 17, 2014

This made my day..thanks a lot :)

@duncanbeevers
Copy link

@marcandrebenoit I doubt it. The version I wrote is pretty soundcloud-specific. No reason a different one couldn't be written for MixCloud, but I just don't use the service that much.

@availablespace
Copy link

You may follow this simple guide to download and convert SoundCloud songs to MP3, WAV, FLAC, at http://www.allavsoft.com/how-to/soundcloud-to-mp3.html

@rhgrafix
Copy link

rhgrafix commented Oct 3, 2019

These are ancient, any new bookmarklets? I use klickaud.net but a marklet would be nice if anyone can build a new one, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment