Skip to content

Instantly share code, notes, and snippets.

@jorgedison
Created January 27, 2016 15:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jorgedison/71e711e901a02e6580cc to your computer and use it in GitHub Desktop.
Save jorgedison/71e711e901a02e6580cc to your computer and use it in GitHub Desktop.
Descarga Ebook IT
#!/usr/bin/env perl
#Uso:
#./it-ebooks — Descargar desde it-ebooks-info
chdir "/home/jrodriguez/" or die "Cannot change directory: $!"; #replace with your path
unless ($ARGV[0]) {
for ($sm = 1; $sm <= 10000; $sm++) { #reemplaza "10000" con el identificador de libro desde it-ebooks.info
print "Libro numero $sm descargando ahora.\n\n";
system "wget http://it-ebooks.info/book/$sm/";
$filepi = `grep -P -o "filepi.com/i/[a-zA-Z0-9]*" index.html`;
system "wget --content-disposition --referer=http://it-ebooks.info/book/$sm/ $filepi";
system 'rm index.html'
}
}
else {
system "mkdir $ARGV[0]";
chdir "/home/jrodriguez/it-ebooks/$ARGV[0]/";
system "wget http://it-ebooks.info/tag/$ARGV[0]/";
@raw_urls = `grep -P -o "/book/[0-9]*" index.html`;
@pure_urls = map { $raw_urls[$_*2+1] } 0..int(@raw_urls/2)-1;
sub download_from_page {
for (@pure_urls) {
$_ =~ s/\/book\///;
print "Libro numero $_ descargando ahora.\n\n";
system "wget http://it-ebooks.info/book/$_/";
$filepi = `grep -P -o 'filepi.com/i/[a-zA-Z0-9]*' $_ `;
system "wget --content-disposition --referer=http://it-ebooks.info/book/$sm/ $filepi";
system "rm $_";
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment