]> git.donarmstrong.com Git - bin.git/blobdiff - get_bleachexile
add mutt alias which executes neomutt if that exists
[bin.git] / get_bleachexile
index 0d457c0d6fe49a75d92e26950f1632894e7322b1..aa13f6b0e05928eab86f20142ae0bbe91ebbe7e4 100755 (executable)
@@ -111,7 +111,7 @@ for my $manga (@manga_to_get) {
 
     my @chapters = $m->content() =~ m{<option\s+value="(\d+)"\s*(?:selected="selected"\s*)?>\s*Chapter\s+\#?\d+\s*</option>}gi;
 
-    for my $chapter (sort uniq(@chapters)) {
+    for my $chapter (uniq(@chapters)) {
        my ($chapter) = +$chapter;
        my $chapter_long = $chapter =~ /\./ ? join('.',map {sprintf'%04d',$_} split /\./,$chapter) : sprintf('%04d',$chapter);
        my $chapter_url = $options{bleachexile}.'/'.lc($manga).'-chapter-'.$chapter.'.html';
@@ -121,7 +121,8 @@ for my $manga (@manga_to_get) {
            # Find out how many pages there are
            my @pages = $m->content() =~ m{<option\s+value="(\d+)"\s*(?:selected="selected"\s*)?>\s*Page\s+\#?[\d\.\-]+\s*</option>}gi;
            mkdir("$manga/$chapter_long");
-           for my $page (sort uniq(@pages)) {
+           @pages = uniq(map {+$_} @pages);
+           for my $page (@pages) {
                my $page_url = $options{bleachexile}.'/'.lc($manga).'-chapter-'.$chapter.'-page-'.$page.'.html';
                print $page_url.qq(\n);
                mm_get($m,$page_url);