diff options
author | Daniel Friesel <derf@derf.homelinux.org> | 2010-05-22 21:35:54 +0200 |
---|---|---|
committer | Daniel Friesel <derf@derf.homelinux.org> | 2010-05-22 21:35:54 +0200 |
commit | 63923778142849ff92f8990a73e4846dad41a9f2 (patch) | |
tree | 3b4601ac0577873fbb93e8660135169ea6f63105 | |
parent | c272dcceb53c8894a2d421390f506dc6c948af6c (diff) |
comirror.conf: Add link-to-image option
-rwxr-xr-x | bin/comirror | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/bin/comirror b/bin/comirror index 0de6d22..a9d1c7c 100755 --- a/bin/comirror +++ b/bin/comirror @@ -48,7 +48,18 @@ sub find_next_link { } sub find_image { - my $image = $mech->find_image(url_abs_regex => $image_re); + my $image; + + if ( + $conf{'link-to-image'} + and $mech->find_link(url_abs_regex => $image_re) + ) + { + $image = $mech->find_link(url_abs_regex => $image_re); + } + else { + $image = $mech->find_image(url_abs_regex => $image_re); + } if ($image) { my $tmpmech = WWW::Mechanize->new(); @@ -193,6 +204,14 @@ A regular expression matching the URL of the webcomic image to be saved. The text on the link to the next image. Can be left out if it contains "next". +=item link-to-image + +If this is set to a true value, B<comirror> will first try to find a link +pointing to image_re and only if that fails look directly for images. This is +useful for comics with small-ish preview images which link to larger ones. + +The future of this option is unclear, such behaviour may become the default. + =back =head2 COMIRROR.STATE |