SVN: toys/rsget.pl: Get/BitRoad Get/DepositFiles Get/EasyShare Get/FileFactory Get/HotFile Get/Media...

sparky sparky at pld-linux.org
Sat Oct 3 03:37:47 CEST 2009


Author: sparky
Date: Sat Oct  3 03:37:47 2009
New Revision: 10657

Modified:
   toys/rsget.pl/Get/BitRoad
   toys/rsget.pl/Get/DepositFiles
   toys/rsget.pl/Get/EasyShare
   toys/rsget.pl/Get/FileFactory
   toys/rsget.pl/Get/HotFile
   toys/rsget.pl/Get/MediaFire
   toys/rsget.pl/Get/MegaShares
   toys/rsget.pl/Get/NetLoad
   toys/rsget.pl/Get/OdSiebie
   toys/rsget.pl/Get/RapidShark
   toys/rsget.pl/Get/SharePlace
   toys/rsget.pl/Get/StorageTo
   toys/rsget.pl/Get/TurboUpload
   toys/rsget.pl/Get/UploadedTo
   toys/rsget.pl/Get/zSHARE
   toys/rsget.pl/RSGet/Curl.pm
   toys/rsget.pl/RSGet/Processor.pm
Log:
- introduce $STDSIZE regular expresion


Modified: toys/rsget.pl/Get/BitRoad
==============================================================================
--- toys/rsget.pl/Get/BitRoad	(original)
+++ toys/rsget.pl/Get/BitRoad	Sat Oct  3 03:37:47 2009
@@ -11,7 +11,7 @@
 	ERROR( "file not found" )
 		if /The requested file is not found/;
 
-	m#<div class="content_text"><h1>(.*?)\s*\[ ([\d\.]+ Mb) \]</h1>#;
+	m#<div class="content_text"><h1>(.*?)\s*\[ ($STDSIZE) \]</h1>#;
 	INFO( name => $1, asize => $2 );
 
 	RESTART( -(60 + int rand 300), "free limit reached" )

Modified: toys/rsget.pl/Get/DepositFiles
==============================================================================
--- toys/rsget.pl/Get/DepositFiles	(original)
+++ toys/rsget.pl/Get/DepositFiles	Sat Oct  3 03:37:47 2009
@@ -10,9 +10,9 @@
 
 	ERROR( "file not found" ) if /Such file does not exist /;
 
-	! m{<div class="info">.*?<b title="(.*?)">.*?</b>\s*<span .*?>.*?<b>(\d+(\.\d+)?)&nbsp;([KMG]B)</b></span>}s;
+	! m{<div class="info">.*?<b title="(.*?)">.*?</b>\s*<span .*?>.*?<b>(\d+(?:\.\d+)?)&nbsp;([KMG]B)</b></span>}s;
 	my $name = $1;
-	my $size = "$2$4";
+	my $size = "$2$3";
 	INFO( iname => $name, asize => $size );
 	RESTART( 5 * 60, "servers overloaded" )
 		if /We are sorry, but all downloading slots for your country are busy/;

Modified: toys/rsget.pl/Get/EasyShare
==============================================================================
--- toys/rsget.pl/Get/EasyShare	(original)
+++ toys/rsget.pl/Get/EasyShare	Sat Oct  3 03:37:47 2009
@@ -15,7 +15,7 @@
 	ERROR( "file not found" ) if /File not found/;
 	ERROR( "file removed" ) if /Requested file is deleted/;
 
-	! m{<p class="pt15 pb0 px18 txtgray family2 c">You are requesting\s+(.*?) \(([\d\.]+ [MkKH]B)\)</p>};
+	! m{<p class="pt15 pb0 px18 txtgray family2 c">You are requesting\s+(.*?) \(($STDSIZE)\)</p>};
 	INFO( name => $1, asize => $2 );
 
 	RESTART( - ( 60 + int rand 300 ), "free limit reached" )

Modified: toys/rsget.pl/Get/FileFactory
==============================================================================
--- toys/rsget.pl/Get/FileFactory	(original)
+++ toys/rsget.pl/Get/FileFactory	Sat Oct  3 03:37:47 2009
@@ -11,7 +11,7 @@
 	ERROR( "file not found" ) if /File Not Found|This file has been deleted/;
 	! m{<title>(.*?) - download now for free};
 	my $name = $1;
-	! m{<div id="info" class="metadata">\s*<span>([\d\.]+ [kKMG]B) file uploaded}s;
+	! m{<div id="info" class="metadata">\s*<span>($STDSIZE) file uploaded}s;
 	my $size = $1;
 	INFO( name => $name, asize => $size );
 	

Modified: toys/rsget.pl/Get/HotFile
==============================================================================
--- toys/rsget.pl/Get/HotFile	(original)
+++ toys/rsget.pl/Get/HotFile	Sat Oct  3 03:37:47 2009
@@ -11,7 +11,7 @@
 	ERROR( "file not found" ) unless length $_;
 	ERROR( "file not found" ) if /This file is either removed/;
 
-	! m{<table class="downloading"><tr><td>.*?<b>(.*?)</b> <span class="size">\| ([\d\.]+[KM]b)</span></td></tr></table>};
+	! m{<table class="downloading"><tr><td>.*?<b>(.*?)</b> <span class="size">\| ($STDSIZE)</span></td></tr></table>};
 	INFO( name => $1, asize => $2 );
 
 	MULTI() if /You are currently downloading/;

Modified: toys/rsget.pl/Get/MediaFire
==============================================================================
--- toys/rsget.pl/Get/MediaFire	(original)
+++ toys/rsget.pl/Get/MediaFire	Sat Oct  3 03:37:47 2009
@@ -16,7 +16,7 @@
 		ERROR( "some error" );
 	}
 
-	! m{You requested: (.*?) \(([\d\.]+ MB)\)</div>};
+	! m{You requested: (.*?) \(($STDSIZE)\)</div>};
 	INFO( name => $1, asize => $2 );
 
 	! /cu\('(.*?)','(.*?)','(.*?)'\);/;

Modified: toys/rsget.pl/Get/MegaShares
==============================================================================
--- toys/rsget.pl/Get/MegaShares	(original)
+++ toys/rsget.pl/Get/MegaShares	Sat Oct  3 03:37:47 2009
@@ -4,7 +4,7 @@
 short: MS
 uri: qr{d01\.megashares\.com/\?d01=}
 cookie: !ms
-status: OK 2009-08-28
+status: OK 2009-10-03
 
 pre:
 	use IPC::Open2;
@@ -23,15 +23,17 @@
 
 	ERROR( "temporarily unavailable" )
 		if m{<dd class="red">([^<]|<br>)*(link is currently offline)([^<]|<br>)*</dd>};
+	my $fnf = join "|",
+		"Link was removed", "Invalid link", "Could not download file";
 	ERROR( "file not found" )
-		if m{<dd class="red">([^<]|<br>)*(Link was removed|Invalid link)([^<]|<br>)*</dd>};
+		if m{<dd class="red">([^<]|<br>)*($fnf)([^<]|<br>)*</dd>};
 	MULTI()
 		if m{You already have the maximum of 1 download running};
 
 	RESTART( 600, "servers overloaded" )
 		if m{All download slots for this link are currently filled};
 
-	m{<dt>Filename:&nbsp;<strong>(.*?)</strong>&nbsp;&nbsp;&nbsp;size: (\d+\.\d+ [GMK]B)</dt>};
+	m{<dt>Filename:&nbsp;<strong>(.*?)</strong>&nbsp;&nbsp;&nbsp;size: ($STDSIZE)(?:ytes)?</dt>};
 	my ( $name, $size ) = ( $1, $2 );
 	$name =~ s/\.\.\.$/\0/;
 	INFO( iname => $name, asize => $size );

Modified: toys/rsget.pl/Get/NetLoad
==============================================================================
--- toys/rsget.pl/Get/NetLoad	(original)
+++ toys/rsget.pl/Get/NetLoad	Sat Oct  3 03:37:47 2009
@@ -25,7 +25,7 @@
 
 	ERROR( "file not found" )
 		if /(Sorry, we don't host the requested file|unknown_file_data)/;
-	m#<div class="dl_first_filename">\s*(.+?)<span.*?>, ([\d\.]+ MB)</span></div>#s;
+	m#<div class="dl_first_filename">\s*(.+?)<span.*?>, ($STDSIZE)</span></div>#s;
 	INFO( name => $1, asize => $2 );
 
 	RESTART( 60, "Not prepared" )

Modified: toys/rsget.pl/Get/OdSiebie
==============================================================================
--- toys/rsget.pl/Get/OdSiebie	(original)
+++ toys/rsget.pl/Get/OdSiebie	Sat Oct  3 03:37:47 2009
@@ -13,7 +13,10 @@
 	ERROR( "some problem, file not found ?" )
 		if $-{_referer} =~ m{/(upload|error)\.html};
 
-	m{<dl class="file-info">.*?<dd.*?>(?:\s*<!--.*?-->\s*<!--.*?-->\s*)?(.*?)</dd>.*?<dd>\s*(\d+\.\d+ MB)</dd>}s;
+	m{<dl\s+class="file-info">.*?<dd.*?>
+		(?:\s*<!--.*?-->\s*<!--.*?-->\s*)?
+		(.*?)
+		</dd>.*?<dd>\s*($STDSIZE)</dd>}sx;
 	INFO( name => $1, asize => $2 );
 
 	! m{href="(/pobierz/\d+---.*?(\.html)?)"};

Modified: toys/rsget.pl/Get/RapidShark
==============================================================================
--- toys/rsget.pl/Get/RapidShark	(original)
+++ toys/rsget.pl/Get/RapidShark	Sat Oct  3 03:37:47 2009
@@ -13,7 +13,7 @@
 	ERROR( "file not found" )
 		if m{<font class="err">No such file};
 
-	m{<font style="font-size:12px;">Chcesz pobrac plik <font color="red">.*/(.*?)</font> \(([\d\.]+ ([MK])?b)\)</font>};
+	m{<font style="font-size:12px;">Chcesz pobrac plik <font color="red">.*/(.*?)</font> \(($STDSIZE)\)</font>};
 	INFO( name => $1, asize => $2 );
 
 	! s/^.*?<Form method="POST" action=''>//s;

Modified: toys/rsget.pl/Get/SharePlace
==============================================================================
--- toys/rsget.pl/Get/SharePlace	(original)
+++ toys/rsget.pl/Get/SharePlace	Sat Oct  3 03:37:47 2009
@@ -12,7 +12,7 @@
 	ERROR( "file not found" )
 		if /Your requested file is not found/;
 
-	! m#<b>File name: </b>(.*)<b><br>\s*File size: </b>([\d\.]+ [MkK]B)<b><br>#s;
+	! m#<b>File name: </b>(.*)<b><br>\s*File size: </b>($STDSIZE)<b><br>#s;
 	INFO( name => $1, asize => $2 );
 
 	RESTART( - ( 60 + int rand 300 ), "limit reached" ) if /You have got max allowed download sessions from the same IP/;

Modified: toys/rsget.pl/Get/StorageTo
==============================================================================
--- toys/rsget.pl/Get/StorageTo	(original)
+++ toys/rsget.pl/Get/StorageTo	Sat Oct  3 03:37:47 2009
@@ -9,7 +9,7 @@
 	GET( $-{_uri} );
 
 	ERROR( "file not found" ) if /File not found\./;
-	! m{<span class="orange">.*?:</span> (.*?) <span class="light">\(([\d\.]+ [KM]B)\)</span>};
+	! m{<span class="orange">.*?:</span> (.*?) <span class="light">\(($STDSIZE)\)</span>};
 	INFO( name => $1, asize => $2 );
 
 	! /onclick='javascript:startcountdown\("(.*?)",\s*"(?:.*?)",\s*"(.*?)"\);'/;

Modified: toys/rsget.pl/Get/TurboUpload
==============================================================================
--- toys/rsget.pl/Get/TurboUpload	(original)
+++ toys/rsget.pl/Get/TurboUpload	Sat Oct  3 03:37:47 2009
@@ -9,7 +9,7 @@
 	GET( $-{_uri} );
 
 	ERROR( "file not found" ) if /File Not Found/;
-	! m{<h2>\S* \S* (.*?)</h2>\s*<font .*?</font> \((\d+\.\d+ [MK]b)\)</font>}s;
+	! m{<h2>\S* \S* (.*?)</h2>\s*<font .*?</font> \(($STDSIZE)\)</font>}s;
 	INFO( name => $1, asize => $2 );
 
 	! s/^.*?<Form method="POST" action=''>//s;

Modified: toys/rsget.pl/Get/UploadedTo
==============================================================================
--- toys/rsget.pl/Get/UploadedTo	(original)
+++ toys/rsget.pl/Get/UploadedTo	Sat Oct  3 03:37:47 2009
@@ -25,7 +25,7 @@
 		! m{<tr><td style="padding-left:4px;">Filetype: &nbsp;</td><td>(.*?)</td></tr>};
 		$name .= $1;
 	}
-	! m{<tr><td style="padding-left:4px;">Filesize: &nbsp;</td><td>\s*(\d+\.\d+ [KM]B)\s*</td></tr>};
+	! m{<tr><td style="padding-left:4px;">Filesize: &nbsp;</td><td>\s*($STDSIZE)\s*</td></tr>};
 	INFO( name => $name, asize => $1 );
 
 

Modified: toys/rsget.pl/Get/zSHARE
==============================================================================
--- toys/rsget.pl/Get/zSHARE	(original)
+++ toys/rsget.pl/Get/zSHARE	Sat Oct  3 03:37:47 2009
@@ -14,7 +14,7 @@
 
 	! m{>File Name:\s*<font.*?>(.*?)</font></td>}s;
 	my $name = $1;
-	! m{>File Size:\s*<font.*?>([\d\.]+MB)</font></td>}s;
+	! m{>File Size:\s*<font.*?>($STDSIZE)</font></td>}s;
 	INFO( name => $name, asize => $1 );
 
 	my $x = 10 + int rand 180;

Modified: toys/rsget.pl/RSGet/Curl.pm
==============================================================================
--- toys/rsget.pl/RSGet/Curl.pm	(original)
+++ toys/rsget.pl/RSGet/Curl.pm	Sat Oct  3 03:37:47 2009
@@ -14,7 +14,7 @@
 
 def_settings(
 	backup => [ "Make backups if downloaded file exists.",
-	"copy,move", qr/copy,move|copy|move|no(ne)/ ],
+	"copy,move", qr/copy,move|copy|move|no(ne)?/ ],
 	backup_suf => [ "Rename backup files with specified suffix. " .
 		"If none defined -N will be added to file name, without disrupting file extension.",
 		undef, qr/.+/ ],

Modified: toys/rsget.pl/RSGet/Processor.pm
==============================================================================
--- toys/rsget.pl/RSGet/Processor.pm	(original)
+++ toys/rsget.pl/RSGet/Processor.pm	Sat Oct  3 03:37:47 2009
@@ -145,6 +145,8 @@
 		our @ISA;
 		@ISA = qw(RSGet::Get);
 	}
+
+	my $STDSIZE = qr/\d+(?:\.\d+)?\s*[kmg]?b/i;
 EOF
 
 	pr join "\n", @{$parts{pre}}, "\n";


More information about the pld-cvs-commit mailing list