From 63923778142849ff92f8990a73e4846dad41a9f2 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sat, 22 May 2010 21:35:54 +0200 Subject: comirror.conf: Add link-to-image option --- bin/comirror | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'bin') 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 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 -- cgit v1.2.3