elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Entrar al Canal Oficial Telegram de elhacker.net


+  Foro de elhacker.net
|-+  Programación
| |-+  Scripting
| | |-+  [Perl] Simple Downloader 0.1
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: [Perl] Simple Downloader 0.1  (Leído 1,541 veces)
BigBear


Desconectado Desconectado

Mensajes: 545



Ver Perfil
[Perl] Simple Downloader 0.1
« en: 6 Mayo 2012, 02:08 am »

Un simple script en perl para bajar archivos.

Código
  1. #!usr/bin/perl
  2. #Simple downloader 0.1
  3. #Coded By Doddy H
  4.  
  5. use LWP::UserAgent;
  6. use URI::Split qw(uri_split);
  7.  
  8. my $nave = LWP::UserAgent->new;
  9. $nave->agent(
  10. "Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.8.1.12) Gecko/20080201Firefox/2.0.0.12"
  11. );
  12. $nave->timeout(20);
  13.  
  14. head();
  15. unless ( $ARGV[0] ) {
  16.    sintax();
  17. }
  18. else {
  19.    now( $ARGV[0] );
  20. }
  21. copyright();
  22.  
  23. sub now {
  24.  
  25.    my ( $scheme, $auth, $path, $query, $frag ) = uri_split( $_[0] );
  26.  
  27.    if ( $path =~ /(.*)\/(.*)$/ ) {
  28.        my $file = $2;
  29.        print "\n[+] Downloading ....\n";
  30.        if ( download( $_[0], $file ) ) {
  31.            print "\n[+] File downloaded\n";
  32.        }
  33.        else {
  34.            print "\n[-] Error\n";
  35.        }
  36.    }
  37. }
  38.  
  39. sub sintax {
  40.    print "\n[+] Sintax : $0 <url>\n";
  41. }
  42.  
  43. sub head {
  44.    print "\n-- == Simple Downloader == --\n\n";
  45. }
  46.  
  47. sub copyright {
  48.    print "\n\n(C) Doddy Hackman 2012\n\n";
  49.    exit(1);
  50. }
  51.  
  52. sub download {
  53.    if ( $nave->mirror( $_[0], $_[1] ) ) {
  54.        if ( -f $_[1] ) {
  55.            return true;
  56.        }
  57.    }
  58. }
  59.  
  60. #The End ?
  61.  
  62.  


« Última modificación: 22 Enero 2013, 01:13 am por Doddy » En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
Videotutorial Crear Downloader Simple « 1 2 »
Programación Visual Basic
k-boy 17 7,554 Último mensaje 30 Octubre 2008, 17:06 pm
por ~~
[Perl Tk] Simple Downloader 0.1
Scripting
BigBear 0 1,654 Último mensaje 6 Mayo 2012, 02:08 am
por BigBear
[Perl] MP3 Downloader 0.1
Scripting
BigBear 2 1,795 Último mensaje 27 Noviembre 2012, 16:18 pm
por BigBear
[Perl] PasteBin Downloader 0.1
Scripting
BigBear 0 1,718 Último mensaje 20 Julio 2013, 23:58 pm
por BigBear
Simple Mass Downloader: descarga todos los enlaces de una web en Chrome
Noticias
wolfbcn 0 964 Último mensaje 14 Enero 2019, 21:27 pm
por wolfbcn
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines