]> git.donarmstrong.com Git - bin.git/commitdiff
* only print the chapter link if we haven't yet gotten the manga
authorDon Armstrong <don@donarmstrong.com>
Wed, 16 Sep 2009 22:38:31 +0000 (22:38 +0000)
committerDon Armstrong <don@donarmstrong.com>
Wed, 16 Sep 2009 22:38:31 +0000 (22:38 +0000)
get_one_manga

index 3fd8118d5bbf84772ce88a9ba7fabcc0033b9ced..3faf99fa944215fe756c7e8fc0329e7ecdb7b677 100755 (executable)
@@ -104,10 +104,10 @@ for my $manga (@manga_to_get) {
     # figure out where to start getting stuff
     my @chapter_links = $m->find_all_links(url_abs_regex => qr{\Q$manga\E\/\d+});
     for my $chapter_link (reverse @chapter_links) {
-       print $chapter_link->url(),qq(\n);
        my ($chapter) = $chapter_link->url() =~ m/([\d-]+)\/?$/;
        my $chapter_long = sprintf('%04d',$chapter);
        if (! -d "$manga/$chapter_long") {
+           print $chapter_link->url(),qq(\n);
            mkdir("$manga/$chapter_long");
            $m->get($chapter_link->url_abs());
            $m->follow_link(text_regex => qr{Begin reading});