SVN: toys/rsget.pl/Get/MegaShares

sparky sparky at pld-linux.org
Sun Dec 13 15:19:54 CET 2009


Author: sparky
Date: Sun Dec 13 15:19:53 2009
New Revision: 11038

Modified:
   toys/rsget.pl/Get/MegaShares
Log:
- try to find better file name if name on the page is incomplete


Modified: toys/rsget.pl/Get/MegaShares
==============================================================================
--- toys/rsget.pl/Get/MegaShares	(original)
+++ toys/rsget.pl/Get/MegaShares	Sun Dec 13 15:19:53 2009
@@ -39,7 +39,13 @@
 
 	! m{<!-- download page link title //-->\s*<h1.*>(.+?)</h1>}s;
 	my $name = $1;
-	$name =~ s/\.\.\.$/\0/;
+	if ( $name =~ s/\.\.\.$// ) {
+		if ( m{/(\Q$name\E.*?)["']} ) {
+			$name = $1;
+		} else {
+			$name .= "\0";
+		}
+	}
 	! m{<strong><span.*>Filesize:</span></strong> ($STDSIZE)<br />}so;
 	my $size = $1;
 	INFO( iname => $name, asize => $size );


More information about the pld-cvs-commit mailing list