Skip to content

Instantly share code, notes, and snippets.

@trapd00r
Created April 30, 2010 08:12
Show Gist options
  • Save trapd00r/384923 to your computer and use it in GitHub Desktop.
Save trapd00r/384923 to your computer and use it in GitHub Desktop.
# this was a oneliner before github fucked it up >_<
# rips all tracks from url and saves them like artist - title.mp3
curl http://www.vkgoeswild.com/\?section\=mp3\&songs\=1 | grep '<li><a href="downloads.php3'|perl -pe 's/<\/a>/\n/g'|perl -pe 's/^<.+\?song=//g'|perl -pe 's/">/,/'|perl -pe '%h=();while(<>){my($id,$name) = split /,/; $h{$id} = $name;}print "$_\n" for keys %h;my $burl="http://www.vkgoeswild.com/?section=mp3&songs=1";use WWW::Mechanize; my $m=WWW::Mechanize->new;$m->get($burl);foreach my $song($m->links){if($song->url_abs =~ /.+song=([0-9]+)$/) {my $id = $1;my $fname = $h{$id}.$id.".mp3";$m->follow_link(url => $song->url); print "Saving ". $song->url, " to ", "$fname\n";$m->save_content($fname);$m->back;}}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment