mixcloud offline downloads
This solution is just like the yahoo! mbox solution. Really all we're doing is asking the browser to show us what it is doing behind the scenes.
Mixcloud uses a flash component to play audio, which is a nice, slick looking player showing the volume of the stream, since HTML doesn't do this itself.
The simplest way to find the mp4
file is to load Web Developer -> Network (CTRL-SHIFT-Q). Then go to the show that you're interested in, and you'll see a table form, showing what is requested over the network. After one/two seconds you'll see a request that has not fished yet. Right click and copy the URL. Go to a terminal and retrieve it there, or your browser, but I prefer to use wget
.
Well, so I thought. Turns out that you can decipher the page a little better. I have put together a short perl script which does the hard work. You can download it following this link, it's scribbled below so you can view it prior to retrieval. Usage is simple, run perl mixcloud_scrape.pl url
the URL is the page of the radio show that you wish to get the mp4 of.
#!/usr/bin/perl use strict; use warnings; use LWP::UserAgent; sub usage { print "Usage: perl $0 <url>\n"; print "example:\nperl $0 'http://www.mixcloud.com/C00kie/crossing-the-tracks-with-kieran-cooke-171114/'\n"; } my $ua = LWP::UserAgent->new(); my $url = shift || die usage(); my $req = HTTP::Request->new(); $req->header( "User-Agent" => "Mozilla/5.0 (X11; Linux x86_64; rv:33.0) Gecko/20100101 Firefox/33.0" ); $req->header( "Accept" => "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" ); $req->header( "Accept-Language" => "en-GB,en;q=0.5" ); $req->header( "Connection" => "keep-alive" ); $req->header( "Cache-Control" => "max-age=0" ); $req->url( $url ); $req->method("GET"); my $resp = $ua->request( $req ); if( !$resp->is_success ) { die "error getting $url"; } my $cont = $resp->content; my $ident; if( $cont =~ m!//waveforms-mix.netdna-ssl.com/(([a-z0-9A-Z]/){4}[a-z0-9A-Z-]+).json! ) { $ident = $1; print "https://stream17.mixcloud.com/c/m4a/64/$ident\.m4a\n"; }
Last modified: Sun, 21 Jun 2015 09:53:36 BST