El codigo
Código
#!usr/bin/perl #MP3 Downloader 0.1 #Coded By Doddy H use LWP::UserAgent; use Time::HiRes "usleep"; my $nave = LWP::UserAgent->new; $nave->agent( "Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.8.1.12) Gecko/20080201Firefox/2.0.0.12" ); $nave->timeout(5); my $se = "downloads_mp3"; unless ( -d $se ) { } head(); $song =~ s/ /-/; my $code = toma( "http://mp3skull.com/mp3/" . $song . ".html" ); if ( $code =~ /Sorry, no results found for/ ) { copyright(); } my @nombres; my @datas; my @links; while ( $code =~ /<div style="font-size:15px;"><b>(.*)<\/b><\/div>/mig ) { my $nombre = $1; #print "name : $nombre\n"; } while ( $code =~ /<!-- info mp3 here -->\s+(.*?)<\/div>/migs ) { my $data = $1; $data =~ s/<br \/>/ /; $data =~ s/<br \/>/ /; #print "data : $data\n"; } while ( $code =~ /<a href=\"(.*)\.mp3\"/mig ) { my $link = $1 . ".mp3"; #print "link : $link\n"; } for my $aca ( 0 .. $encontrados ) { } now( $links[$number] ); copyright(); sub head { my @logo = ( "#=============================================#", "\n", "# MP3 Downloader 0.1 #", "\n", "#---------------------------------------------#", "\n", "# Written By Doddy H #", "\n", "# Email: lepuke[at]hotmail[com] #", "\n", "# Website: doddyhackman.webcindario.com #", "\n", "#---------------------------------------------#", "\n", "# The End ? #", "\n", "#=============================================#", "\n" ); marquesina(@logo); } sub copyright { my @fin = ("-- == (C) Doddy Hackman 2012 == --"); marquesina(@fin); <stdin>; } sub marquesina { #Effect based in the exploits by Jafer Al Zidjali my @logo = @_; my $car = "|"; for my $uno (@logo) { $|++; if ( $car eq "|" ) { mostrar( "\b" . $dos . $car, "/" ); } elsif ( $car eq "/" ) { mostrar( "\b" . $dos . $car, "-" ); } elsif ( $car eq "-" ) { mostrar( "\b" . $dos . $car, "\\" ); } else { mostrar( "\b" . $dos . $car, "|" ); } usleep(40_000); } } sub mostrar { $car = $_[1]; } } sub now { my ( $scheme, $auth, $path, $query, $frag ) = uri_split( $_[0] ); if ( $path =~ /(.*)\/(.*)$/ ) { my $file = $2; if ( download( $_[0], $file ) ) { } } } sub download { if ( $nave->mirror( $_[0], $_[1] ) ) { if ( -f $_[1] ) { return true; } } } sub toma { } #The End ?
Un ejemplo de uso
Código:
#=============================================#
# MP3 Downloader 0.1 #
#---------------------------------------------#
# Written By Doddy H #
# Email: lepuke[at]hotmail[com] #
# Website: doddyhackman.webcindario.com #
#---------------------------------------------#
# The End ? #
#=============================================#
[?] Song : bones now
[+] Searching ...
[Song 0] : Discovery Now - bionic bones mp3
[Data] : 256 kbps 1:30 2.79 mb
[Link] : http://www.whro.org/home/html/podcasts/discoverynow/041408.mp3
[Song 1] : Sean Bones - 'Here Now' mp3
[Data] : 128 kbps 3:28 3.19 mb
[Link] : http://serve.castfire.com/audio/878039/sean-bones-here-now_2012-02-23-1
74939.128.mp3
[Song 2] : Discovery Now - bionic bones mp3
[Data] : 256 kbps 00:01:30 2.8 mb
[Link] : http://whro.org/home/html/podcasts/discoverynow/041408.mp3
[Song 3] : Sean Bones - Here Now mp3
[Data] : 5.02 mb
[Link] : http://www.hulkshare.com/dl/4t42l4kxi811/sean_bones_-_here_now.mp3
[Song 4] : Fuego Ft. Amara - Lo Que Quiero (Prod. By Bones, Now & Laterz) (Www.S
tiloCaro.Com) mp3
[Data] : 4.43 mb
[Link] : http://www.hulkshare.com/dl/w86wxq8bl0n4/fuego_ft._amara_-_lo_que_quier
o_%28prod._by_bones%2c_now_%26_laterz%29.mp3
[Song 5] : Sean Bones - Here Now mp3
[Data] : 160 kbps 3:27 3.95 mb
[Link] : http://myspoonful.com/wp-content/uploads/Sean-Bones-Here-Now.mp3
[Song 6] : Frankie Bones - Bonesbreaks Vol. 2 (B2) On The Beat Now-freestyle na
veia mp3
[Data] : 4:40 mins 6.41 mb
[Link] : http://dc203.4shared.com/img/564370108/97ff8470/dlink__2Fdownload_2FS4X
eLchH_3Ftsid_3D20121127-94941-8934f180/preview.mp3
[?] Number : 1
[+] Downloading ...
[+] Finished
-- == (C) Doddy Hackman 2012 == --