Index: src/depositfiles/cz/vity/freerapid/plugins/services/depositfiles/DepositFilesRunner.java
===================================================================
--- src/depositfiles/cz/vity/freerapid/plugins/services/depositfiles/DepositFilesRunner.java	(revision 3224)
+++ src/depositfiles/cz/vity/freerapid/plugins/services/depositfiles/DepositFilesRunner.java	(working copy)
@@ -3,6 +3,7 @@
 import cz.vity.freerapid.plugins.exceptions.*;
 import cz.vity.freerapid.plugins.webclient.AbstractRunner;
 import cz.vity.freerapid.plugins.webclient.FileState;
+import cz.vity.freerapid.plugins.webclient.MethodBuilder;
 import cz.vity.freerapid.plugins.webclient.utils.PlugUtils;
 import org.apache.commons.httpclient.Cookie;
 import org.apache.commons.httpclient.HttpMethod;
@@ -50,7 +51,7 @@
             return;
         }
 
-        final GetMethod getMethod = getGetMethod(fileURL);
+        GetMethod getMethod = getGetMethod(fileURL);
         if (makeRedirectedRequest(getMethod)) {
             checkNameAndSize(getContentAsString());
             checkProblems();
@@ -70,22 +71,57 @@
             int seconds = Integer.parseInt(matcher.group(1)) / 1000;
             logger.info("wait - " + seconds);
 
-            matcher = getMatcherAgainstContent("<a href=\"(/get_file\\.php\\?fid=[^&]+).*?\"[^>]*>");
+            matcher = getMatcherAgainstContent("<a href=\"(/get_file\\.php\\?fid=([^&]+)).*?\"[^>]*>");
             if (!matcher.find()) {
                 throw new PluginImplementationException();
             }
+            final String getFileUrl = matcher.group(1);
+            final String fid = matcher.group(2);
 
             downloadTask.sleep(seconds + 5);
 
-            String getFileUrl = matcher.group(1);
+            String reCaptchaUrl = "";
+            matcher = getMatcherAgainstContent("Recaptcha\\.create\\s*\\(\\s*'([^']+)'");
+            if (matcher.find())
+                reCaptchaUrl = "http://www.google.com/recaptcha/api/challenge?k=" + matcher.group(1) + "&ajax=1&cachestop=0." + System.currentTimeMillis();
+
             HttpMethod httpMethod = getMethodBuilder().setReferer(fileURL).setAction(getFileUrl).toGetMethod();
             if (!makeRedirectedRequest(httpMethod)) {
                 throw new ServiceConnectionProblemException();
             }
 
+            while (getContentAsString().matches("(?s).*?check_recaptcha\\s*\\(\\s*'" + fid + "'.*?")) {
+                logger.info("Captcha URL: " + reCaptchaUrl);
+                getMethod = getGetMethod(reCaptchaUrl);
+                if (!makeRedirectedRequest(getMethod))
+                    throw new ServiceConnectionProblemException();
+
+                matcher = getMatcherAgainstContent("(?s)challenge\\s*:\\s*'([\\w-]+)'.*?server\\s*:\\s*'([^']+)'");
+                if (!matcher.find())
+                    throw new PluginImplementationException("Error parsing ReCaptcha response");
+                String reCaptcha_challenge = matcher.group(1);
+                String captchaImg = matcher.group(2) + "image?c=" + reCaptcha_challenge;
+                logger.info("Captcha URL: " + captchaImg);
+
+                String reCaptcha_response = getCaptchaSupport().getCaptcha(captchaImg);
+                if (reCaptcha_response == null)
+                    throw new CaptchaEntryInputMismatchException();
+
+                MethodBuilder mb = getMethodBuilder()
+                        .setAction("/get_file.php")
+                        .setReferer(fileURL)
+                        .setEncodePathAndQuery(true)
+                        .setParameter("fid", fid)
+                        .setParameter("challenge", reCaptcha_challenge)
+                        .setParameter("response", reCaptcha_response);
+
+                if (!makeRedirectedRequest(mb.toGetMethod()))
+                    throw new ServiceConnectionProblemException();
+            }
+
             matcher = getMatcherAgainstContent("<form[^>]+action=\"([^\"]+)\"");
             if (!matcher.find()) {
-                throw new PluginImplementationException();
+                throw new PluginImplementationException("Cannot find download URL");
             }
             String finalDownloadUrl = matcher.group(1);
             logger.info("Download URL: " + finalDownloadUrl);
