View Single Post
  #4  
Old 04-19-2012, 04:40 AM
Eprst_Lalaikin Eprst_Lalaikin is offline
Junior Member
 
Join Date: Apr 2012
Posts: 2
Eprst_Lalaikin is on a distinguished road
Default

Re: www.jango.com: How to record free streaming music from Jango? (http:// .mp3)


I've done this way:
Code:
#!/usr/bin/env perl

# created 18.04.2012
# This obtains "endless" jango "stream" as playlist.m3u file.
# So you can open it in vlc, xmms, e.t.c for listening online and editing.
# And you can give it to wget to download all files at once.
# This requires curl to be installed in your system

# At first, please set up values below, then run script
#where do you want start from:
 $url="http://www.jango.com/music/Adele";
#How many items in playlist you want to generate?
 $num=10;
#I've actually done with 400
#$num=400;

# Getting "sid"
$nres=`curl "$url?c=1" -c cookie`;
if ($nres=~/\(new Image\)\.src \= "http:\/\/a\.jango\.com\/0\/none\/\%252Fmusic\%252FAdele\%253Fc\%253D1\?sid=(.+)"\;/)
{
	print "found sid -> $1\n";
	$sid=$1;
}
else
{
	print "error finding sid\n";
	die;
}
print "--done with finding sid--\n\n";

# Let's start querying jango for the next track in loop
$list="";
open(OUTFILE, ">playlist.m3u") or die "Can't open playlist for write: $!";
$cont="first_time=1";
$suc=0;
for ($c=1;$c<=$num;$c++)
{
	$nres=`curl "www.jango.com/streams/0?sid=$sid&ver=4&suw=0&$cont&cb=1334773329775" -b cookie`;
	$cont="next=1";
	if ($nres=~/{"ver":4,"url":"(http:.+)"}/)
	{
		print"$c  -> $1\n";
		$list=$list . "$1.mp3\n";
		$suc++;
	}
	else
	{
		print "$c -> error getting item!";
	}

}
print OUTFILE $list;
print "\nObtained $suc of $num items\n";
Reply With Quote