Bienvenido a Tecnohackers

Tecnohackers » Programacion » Area de Programacion » Scripting. VBS, Batch, Bash, JavaSript.
 » 

[Perl] Simple Downloader 0.1



Autor Tema: [Perl] Simple Downloader 0.1  (Leído 945 veces)

Desconectado Doddy

  • Veterano
  • ***
  • Mensajes: 249
  • Slow Mind
[Perl] Simple Downloader 0.1
« en: Mayo 06, 2012, 02:09:05 am »
Un simple script en perl para bajar archivos.

Código: You are not allowed to view links. Register or Login
#!usr/bin/perl
#Simple downloader 0.1
#Coded By Doddy H

use LWP::UserAgent;
use URI::Split qw(uri_split);

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(20);

head();
unless ( $ARGV[0] ) {
    sintax();
}
else {
    now( $ARGV[0] );
}
copyright();

sub now {

    my ( $scheme, $auth, $path, $query, $frag ) = uri_split( $_[0] );

    if ( $path =~ /(.*)\/(.*)$/ ) {
        my $file = $2;
        print "\n[+] Downloading ....\n";
        if ( download( $_[0], $file ) ) {
            print "\n[+] File downloaded\n";
        }
        else {
            print "\n[-] Error\n";
        }
    }
}

sub sintax {
    print "\n[+] Sintax : $0 <url>\n";
}

sub head {
    print "\n-- == Simple Downloader == --\n\n";
}

sub copyright {
    print "\n\n(C) Doddy Hackman 2012\n\n";
    exit(1);
}

sub download {
    if ( $nave->mirror( $_[0], $_[1] ) ) {
        if ( -f $_[1] ) {
            return true;
        }
    }
}

#The End ?

You are not allowed to view links. Register or Login

Tags:
Tags:

 


SMF 2.0.19 | SMF © 2016, Simple Machines
Paginas Afiliadas
Twitter - FaceBook - Daraxblog
Designed by Smf Personal