captchaMethodChecker update

git-svn-id: svn://svn.jdownloader.org/jdownloader/trunk@8452 ebf7c1c2-ba36-0410-9fe8-c592906822b4
This commit is contained in:
DwD 2009-09-10 10:23:48 +00:00
parent 0e2457dc95
commit 4c58d31f0d
2 changed files with 56 additions and 21 deletions

View File

@ -102,7 +102,8 @@ public class UgotFileCom extends PluginForHost {
int block = Integer.parseInt(br.getRegex("<div id='sessionCountDown' style='font-weight:bold; font-size:20px;'>(.*?)</div>").getMatch(0)) * 1000 + 1;
throw new PluginException(LinkStatus.ERROR_IP_BLOCKED, block);
}
String Captcha = getCaptchaCode("http://ugotfile.com" + br.getRegex("<td><img src=\"(.*?)\" onclick=\"captchaReload\\(\\);\"").getMatch(0), link);
String cUrl="http://ugotfile.com" + br.getRegex("<td><img src=\"(.*?)\" onclick=\"captchaReload\\(\\);\"").getMatch(0);
String Captcha = getCaptchaCode(cUrl, link);
br.getPage("http://ugotfile.com/captcha?key=" + Captcha);
if (br.containsHTML("invalid key")) throw new PluginException(LinkStatus.ERROR_CAPTCHA);
sleep(sleep * 1001, link);

View File

@ -9,7 +9,7 @@ import jd.captcha.JACMethod;
import jd.parser.Regex;
import jd.utils.JDUtilities;
public class captchaMethodeChecker {
public class captchaMethodChecker {
public static int count = 0;
public static int count2 = 0;
@ -51,36 +51,70 @@ public class captchaMethodeChecker {
// text = text.replaceAll("(?is)/\\*.*?\\*/", "");
// text = text.replaceAll("//.*", "");
// text = text.replaceAll(".*final .*", ""); // kann man nich verändern
boolean showPluginsWithountMethod = true;
String[] res = new Regex(text, regexp).getRow(0);
if (res != null && res.length > 0) {
String[] lines = text.split("(\\r\\n)|\\r|\\n");
int ln = 0;
for (; ln < lines.length; ln++) {
String string = lines[ln];
if (string.contains("getCaptchaCode"))
{
ln ++;
break;
}
}
String host = getHost(text);
for (String string : res) {
if (string.split(",").length == 2) {
String meth = getMethode(host);
if (meth == null) {
System.out.println(host);
System.out.println(file.getName());
// System.out.println("");
// System.out.println(string);
System.out.println("__________________________");
count2++;
if (showPluginsWithountMethod) {
if (meth == null) {
//new line in print cause System.out.println ignores System.err.println
System.out.print(host+"\r\n");
if (text.toLowerCase().contains("recaptcha")) System.out.print("ReCaptcha\r\n");
System.err.print("getCaptchaCode at (" + file.getName() + ":" + ln + ")\r\n");
// System.out.println("");
// System.out.println(string);
System.out.println("__________________________");
count2++;
} else
count++;
} else {
if (meth != null) {
System.out.println(host);
System.out.println("Methodname: " + meth);
System.out.println("__________________________");
}
}
else
count++;
} else {
String host2 = string.replaceFirst(".*?\"", "").replaceFirst("\".*", "");
String meth = getMethode(host2);
if (meth == null) {
System.out.println(host2);
if (host != null && !host.equals(host2)) System.out.println(host);
System.out.println(file.getName());
// System.out.println("");
// System.out.println(string);
System.out.println("__________________________");
count2++;
if (showPluginsWithountMethod) {
if (meth == null) {
System.out.print(host+"\r\n");
if (text.toLowerCase().contains("recaptcha"))
System.out.print("ReCaptcha\r\n");
else if (host != null && !host.equals(host2)) System.out.print(host2+"\r\n");
// System.out.println(); //
System.err.print("getCaptchaCode at (" + file.getName() + ":" + ln + ")\r\n");
// System.out.println(string);
System.out.println("__________________________");
count2++;
} else
count++;
} else {
if (meth != null) {
System.out.println(host2);
System.out.println("Methodname: " + meth);
System.out.println("__________________________");
}
}
else
count++;
}
}