<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel>
        <title>Fileserve 1.1.11 - plugin update (reCaptcha fixes)</title>
        <description> Hi, recently I found some problems with reCaptcha in Fileserve plugin:

1. Common problem: we have to wait extra time (6m:45s) after reCaptcha error (i.e. when typed code doesn't match pictrue).

Why exactly 6m:45s? The Plugin parse the string returned by the server which should contain correct number of seconds to wait. When everything is OK, the string looks like this: &quot;25&quot; (25 seconds to wait), but on error it contains: &quot;fail404&quot;. The plugin interprets as 404 + 1 seconds = 6m:45s.

2. From time to time I got: &quot;incorrect-captcha-sol&quot; error (even if the typed code match exactly pictrue).

It may be caused by missing hidden parameter like: ppp = 301:Language: HTML&amp;lt;input type=&amp;quot;text&amp;quot; id=&amp;quot;recaptcha_response_field&amp;quot; class=&amp;quot;textfield&amp;quot; size=&amp;quot;30&amp;quot; name=&amp;quot;recaptcha_response_field&amp;quot; /&amp;gt;
&amp;lt;input type=&amp;quot;hidden&amp;quot; id=&amp;quot;recaptcha_challenge_field&amp;quot; name=&amp;quot;recaptcha_challenge_field&amp;quot; /&amp;gt;
&amp;lt;input type=&amp;quot;hidden&amp;quot; id=&amp;quot;recaptcha_shortencode_field&amp;quot; name=&amp;quot;recaptcha_shortencode_field&amp;quot; value=&amp;quot;ZuGVQ3K&amp;quot; /&amp;gt;
&amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;ppp&amp;quot; value=&amp;quot;301&amp;quot;/&amp;gt;
It should be pass to server in POST request data (http://www.fileserve.com/checkReCaptcha.php) as well.

recaptcha_challenge_field=...&amp;recaptcha_response_field=...&amp;recaptcha_shortencode_field=...&amp;ppp=301
I'm not 100% sure if this is the real reason, but I tested updated plugin a few days, and it seems that it works fine now.


I made some fixes:
Index: src/fileserve/cz/vity/freerapid/plugins/services/fileserve/FileserveFilesRunner.java
===================================================================
--- src/fileserve/cz/vity/freerapid/plugins/services/fileserve/FileserveFilesRunner.java	(revision 3187)
+++ src/fileserve/cz/vity/freerapid/plugins/services/fileserve/FileserveFilesRunner.java	(working copy)
@@ -5,7 +5,10 @@
 import cz.vity.freerapid.plugins.webclient.FileState;
 import cz.vity.freerapid.plugins.webclient.utils.PlugUtils;
 import org.apache.commons.httpclient.HttpMethod;
+import org.apache.commons.httpclient.NameValuePair;
+import org.apache.commons.httpclient.methods.PostMethod;
 
+import java.util.ArrayList;
 import java.util.logging.Logger;
 import java.util.regex.Matcher;
 
@@ -49,6 +52,16 @@
             }
             String recaptcha = &quot;http://www.google.com/recaptcha/api/challenge?k=&quot; + matcher.group(1) + &quot;&amp;ajax=1&amp;cachestop=0.&quot; + System.currentTimeMillis();
 
+            // Finding ALL (that's why I use dynamic array) extra hidden parameters (like: ppp = 301):
+            ArrayList extraHiddenParams = new ArrayList();
+            matcher = PlugUtils.matcher(&quot;]+name=\&quot;([^\&quot;]+)\&quot;[^&amp;gt;]+value=\&quot;([^\&quot;]+)\&quot;[^&amp;gt;]*&amp;gt;&quot;, getContentAsString().replaceFirst(&quot;(?s)^.*?(]+id=\&quot;recaptcha_[^\&quot;]+_field\&quot;[^&amp;gt;]*&amp;gt;.*?)]+id=\&quot;captchaAreaLabel\&quot;[^&amp;gt;]*&amp;gt;.*$&quot;, &quot;$1&quot;));
+            while (matcher.find()) {
+                if (matcher.group(1).contains(&quot;recaptcha_shortencode_field&quot;))
+                    continue; // skip standard field
+                extraHiddenParams.add(new NameValuePair(matcher.group(1), matcher.group(2)));
+            }
+            logger.info(&quot;Captcha extra hidden params (&quot; + extraHiddenParams.size() + &quot;): &quot; + extraHiddenParams);
+
             do {
                 logger.info(&quot;Captcha URL: &quot; + recaptcha);
                 getMethod = getGetMethod(recaptcha);
@@ -77,10 +90,14 @@
                         .setParameter(&quot;recaptcha_response_field&quot;, captcha)
                         .setParameter(&quot;recaptcha_shortencode_field&quot;, fileKey)
                         .toPostMethod();
+
+                // Adding extra hidden parameters (like: ppp = 301) to postMethod before request:
+                ((PostMethod)postMethod).addParameters(extraHiddenParams.toArray(new NameValuePair[0]));
+
                 if (!makeRedirectedRequest(postMethod)) {
                     throw new ServiceConnectionProblemException();
                 }
-            } while (!getContentAsString().contains(&quot;success&quot;));
+            } while (!getContentAsString().matches(&quot;.*?success\&quot;?\\s*:\\s*1.*?&quot;)); // {&quot;success&quot;:1} -&amp;gt; OK, {&quot;success&quot;:0,&quot;error&quot;: ... } -&amp;gt; try again
 
             HttpMethod pMethod = getMethodBuilder().setAction(fileURL).setReferer(fileURL)
                     .setParameter(&quot;downloadLink&quot;, &quot;wait&quot;)

Someone from dev team, please commit this patch to the main repository.

Thanks</description>
        <link>https://wordrider.net/forum/10/8546/8546/_subject_#msg-8546</link>
        <lastBuildDate>Wed, 08 Apr 2026 18:41:32 +0000</lastBuildDate>
        <generator>Phorum 5.2.10</generator>
        <item>
            <guid>https://wordrider.net/forum/10/8546/8547/_subject_#msg-8547</guid>
            <title>Re: Fileserve 1.1.11 - plugin update (reCaptcha fixes)</title>
            <link>https://wordrider.net/forum/10/8546/8547/_subject_#msg-8547</link>
            <description><![CDATA[ Thanks for the patch, I've committed and released it.]]></description>
            <dc:creator>ntoskrnl</dc:creator>
            <category>FreeRapid Downloader - Plugins</category>
            <pubDate>Thu, 13 Oct 2011 17:14:11 +0000</pubDate>
        </item>
        <item>
            <guid>https://wordrider.net/forum/10/8546/8546/_subject_#msg-8546</guid>
            <title>Fileserve 1.1.11 - plugin update (reCaptcha fixes)</title>
            <link>https://wordrider.net/forum/10/8546/8546/_subject_#msg-8546</link>
            <description><![CDATA[ Hi, recently I found some problems with reCaptcha in Fileserve plugin:<br />
<br />
<hr class="bbcode"/><b>1.</b> Common problem: <b>we have to wait extra time (6m:45s) after reCaptcha error</b> (i.e. when typed code doesn't match pictrue).<br />
<br />
Why exactly 6m:45s? The Plugin parse the string returned by the server which should contain correct number of seconds to wait. When everything is OK, the string looks like this: "25" (25 seconds to wait), but on error it contains: "fail404". The plugin interprets as 404 + 1 seconds = 6m:45s.<br />
<br />
<hr class="bbcode"/><b>2.</b> From time to time <b>I got: "incorrect-captcha-sol" error</b> (even if the typed code match exactly pictrue).<br />
<br />
It may be caused by missing hidden parameter like: <b>ppp = 301</b>:<pre class="bbcode_geshi"><div class="head">Language: HTML</div><span class="sc2"><a href="http://december.com/html/4/element/input.html"><span class="kw2">&lt;input</span></a> <span class="kw3">type</span>=<span class="st0">&quot;text&quot;</span> <span class="kw3">id</span>=<span class="st0">&quot;recaptcha_response_field&quot;</span> <span class="kw3">class</span>=<span class="st0">&quot;textfield&quot;</span> <span class="kw3">size</span>=<span class="st0">&quot;30&quot;</span> <span class="kw3">name</span>=<span class="st0">&quot;recaptcha_response_field&quot;</span> /<span class="kw2">&gt;</span></span>
<span class="sc2"><a href="http://december.com/html/4/element/input.html"><span class="kw2">&lt;input</span></a> <span class="kw3">type</span>=<span class="st0">&quot;hidden&quot;</span> <span class="kw3">id</span>=<span class="st0">&quot;recaptcha_challenge_field&quot;</span> <span class="kw3">name</span>=<span class="st0">&quot;recaptcha_challenge_field&quot;</span> /<span class="kw2">&gt;</span></span>
<span class="sc2"><a href="http://december.com/html/4/element/input.html"><span class="kw2">&lt;input</span></a> <span class="kw3">type</span>=<span class="st0">&quot;hidden&quot;</span> <span class="kw3">id</span>=<span class="st0">&quot;recaptcha_shortencode_field&quot;</span> <span class="kw3">name</span>=<span class="st0">&quot;recaptcha_shortencode_field&quot;</span> <span class="kw3">value</span>=<span class="st0">&quot;ZuGVQ3K&quot;</span> /<span class="kw2">&gt;</span></span>
<span class="sc2"><a href="http://december.com/html/4/element/input.html"><span class="kw2">&lt;input</span></a> <span class="kw3">type</span>=<span class="st0">&quot;hidden&quot;</span> <span class="kw3">name</span>=<span class="st0">&quot;ppp&quot;</span> <span class="kw3">value</span>=<span class="st0">&quot;301&quot;</span>/<span class="kw2">&gt;</span></span></pre>
It should be pass to server in POST request data (http://www.fileserve.com/checkReCaptcha.php) as well.<br />
<pre class="bbcode">
recaptcha_challenge_field=...&recaptcha_response_field=...&recaptcha_shortencode_field=...&<b><span style="color:#FF0000">ppp=301</span></b></pre>
I'm not 100% sure if this is the real reason, but I tested updated plugin a few days, and it seems that it works fine now.<br />
<br />
<hr class="bbcode"/>
I made some fixes:<pre class="bbcode">
Index: src/fileserve/cz/vity/freerapid/plugins/services/fileserve/FileserveFilesRunner.java
===================================================================
--- src/fileserve/cz/vity/freerapid/plugins/services/fileserve/FileserveFilesRunner.java	(revision 3187)
+++ src/fileserve/cz/vity/freerapid/plugins/services/fileserve/FileserveFilesRunner.java	(working copy)
@@ -5,7 +5,10 @@
 import cz.vity.freerapid.plugins.webclient.FileState;
 import cz.vity.freerapid.plugins.webclient.utils.PlugUtils;
 import org.apache.commons.httpclient.HttpMethod;
+import org.apache.commons.httpclient.NameValuePair;
+import org.apache.commons.httpclient.methods.PostMethod;
 
+import java.util.ArrayList;
 import java.util.logging.Logger;
 import java.util.regex.Matcher;
 
@@ -49,6 +52,16 @@
             }
             String recaptcha = "http://www.google.com/recaptcha/api/challenge?k=" + matcher.group(1) + "&ajax=1&cachestop=0." + System.currentTimeMillis();
 
+            // Finding ALL (that's why I use dynamic array) extra hidden parameters (like: ppp = 301):
+            ArrayList<NameValuePair> extraHiddenParams = new ArrayList<NameValuePair>();
+            matcher = PlugUtils.matcher("<input[^>]+name=\"([^\"]+)\"[^&gt;]+value=\"([^\"]+)\"[^&gt;]*&gt;", getContentAsString().replaceFirst("(?s)^.*?(<input[^>]+id=\"recaptcha_[^\"]+_field\"[^&gt;]*&gt;.*?)<div[^>]+id=\"captchaAreaLabel\"[^&gt;]*&gt;.*$", "$1"));
+            while (matcher.find()) {
+                if (matcher.group(1).contains("recaptcha_shortencode_field"))
+                    continue; // skip standard field
+                extraHiddenParams.add(new NameValuePair(matcher.group(1), matcher.group(2)));
+            }
+            logger.info("Captcha extra hidden params (" + extraHiddenParams.size() + "): " + extraHiddenParams);
+
             do {
                 logger.info("Captcha URL: " + recaptcha);
                 getMethod = getGetMethod(recaptcha);
@@ -77,10 +90,14 @@
                         .setParameter("recaptcha_response_field", captcha)
                         .setParameter("recaptcha_shortencode_field", fileKey)
                         .toPostMethod();
+
+                // Adding extra hidden parameters (like: ppp = 301) to postMethod before request:
+                ((PostMethod)postMethod).addParameters(extraHiddenParams.toArray(new NameValuePair[0]));
+
                 if (!makeRedirectedRequest(postMethod)) {
                     throw new ServiceConnectionProblemException();
                 }
-            } while (!getContentAsString().contains("success"));
+            } while (!getContentAsString().matches(".*?success\"?\\s*:\\s*1.*?")); // {"success":1} -&gt; OK, {"success":0,"error": ... } -&gt; try again
 
             HttpMethod pMethod = getMethodBuilder().setAction(fileURL).setReferer(fileURL)
                     .setParameter("downloadLink", "wait")</pre>
<br />
Someone from dev team, please commit this patch to the main repository.<br />
<br />
Thanks]]></description>
            <dc:creator>RubinX</dc:creator>
            <category>FreeRapid Downloader - Plugins</category>
            <pubDate>Thu, 13 Oct 2011 15:39:47 +0000</pubDate>
        </item>
    </channel>
</rss>
