Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- use strict;
- use LWP::Simple;
- my $tags = 'remilia_scarlet rating:safe -figure -comic -comics -4koma -4enkoma -cosplay'; # теги
- my $path = $ENV{HOME}.'/pics/Anime/Touhou/remilia_scarlet/'; # директория, куда складывать пикчи. без /home/$user/
- mkdir $path unless -d $path;
- my $pid = 0;
- my $lastpid;
- ########################
- # $tags =~ s/\s| /\+/;
- my $content = get("http://gelbooru.com/index.php?page=post&s=list&tags=$tags");
- $content =~ /;pid=(\d+)" alt="last page"/;
- $lastpid = $1;
- for(my $page = 1; $pid <= $lastpid; $pid += 63) {
- $tags =~ s/\s| /\+/;
- my $content = get("http://gelbooru.com/index.php?page=post&s=list&tags=$tags&pid=$pid");
- print "----page $page loaded\n";
- unless($content =~ m!http://.*?\.gelbooru\.com/thumbnails/\d+/thumbnail_!) { sleep(11) and redo; }
- while($content =~ m!href="index.php\?page=post&s=view&id=.*?" ><img src="http://(.*?)\.gelbooru\.com/thumbnails/(\d+)/thumbnail_(.*?\.(jpe?g|png|gif))\?\d+" alt="!gi) {
- getstore("http://$1.gelbooru.com//images/$2/$3", $path.$3);
- print $3." ---------loading\n";
- }
- print "----images from $page loaded\n";
- ++$page;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement