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';
# 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);