mirror of
https://github.com/mirror/jdownloader.git
synced 2024-11-27 05:50:51 +00:00
-xmirror.eu: RIP fixes #6111
-fixed listalinks fixes #6118 -fixed buckshare reCaptcha handling fixes #6119 git-svn-id: svn://svn.jdownloader.org/jdownloader/trunk@18356 ebf7c1c2-ba36-0410-9fe8-c592906822b4
This commit is contained in:
parent
60e998ee1c
commit
957f8be096
@ -892,4 +892,5 @@ jd/plugins/hoster/FileCondoCom.class
|
||||
jd/plugins/decrypter/HsLgndCm.class
|
||||
jd/plugins/decrypter/PdPsteCm.class
|
||||
jd/plugins/decrypter/OnDDlCm.class
|
||||
jd/plugins/decrypter/RpdFldrCm.class
|
||||
jd/plugins/decrypter/RpdFldrCm.class
|
||||
jd/plugins/decrypter/XMirrorEu.class
|
@ -43,12 +43,12 @@ public class ListaLinksCom extends PluginForDecrypt {
|
||||
final Regex info = br.getRegex("<FONT CLASS=\"result\">(<b>)?([^<>\"]+)(</b>)?<br />(.*?)<DIV ID=\"secundario\">");
|
||||
final String fpName = info.getMatch(1);
|
||||
String linktext = info.getMatch(3);
|
||||
if (linktext == null) linktext = br.getRegex("<FONT CLASS=\"result\"><br />(.*?)<DIV ID=\"secundario\">").getMatch(0);
|
||||
if (linktext == null) linktext = br.getRegex("<FONT CLASS=\"result\">(.*?)<DIV ID=\"secundario\">").getMatch(0);
|
||||
if (linktext == null) {
|
||||
logger.warning("Decrypter broken for link: " + parameter);
|
||||
return null;
|
||||
}
|
||||
String[] links = HTMLParser.getHttpLinks(linktext, null);
|
||||
final String[] links = HTMLParser.getHttpLinks(linktext, null);
|
||||
if (links == null || links.length == 0) {
|
||||
logger.warning("Decrypter broken for link: " + parameter);
|
||||
return null;
|
||||
|
@ -1,58 +0,0 @@
|
||||
//jDownloader - Downloadmanager
|
||||
//Copyright (C) 2009 JD-Team support@jdownloader.org
|
||||
//
|
||||
//This program is free software: you can redistribute it and/or modify
|
||||
//it under the terms of the GNU General Public License as published by
|
||||
//the Free Software Foundation, either version 3 of the License, or
|
||||
//(at your option) any later version.
|
||||
//
|
||||
//This program is distributed in the hope that it will be useful,
|
||||
//but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
//GNU General Public License for more details.
|
||||
//
|
||||
//You should have received a copy of the GNU General Public License
|
||||
//along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
package jd.plugins.decrypter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import jd.PluginWrapper;
|
||||
import jd.controlling.ProgressController;
|
||||
import jd.plugins.CryptedLink;
|
||||
import jd.plugins.DecrypterPlugin;
|
||||
import jd.plugins.DownloadLink;
|
||||
import jd.plugins.PluginForDecrypt;
|
||||
|
||||
@DecrypterPlugin(revision = "$Revision$", interfaceVersion = 2, names = { "xmirror.eu" }, urls = { "http://(www\\.)?xmirror\\.eu/[a-z0-9]{3,}" }, flags = { 0 })
|
||||
public class XMirrorEu extends PluginForDecrypt {
|
||||
|
||||
public XMirrorEu(PluginWrapper wrapper) {
|
||||
super(wrapper);
|
||||
}
|
||||
|
||||
public ArrayList<DownloadLink> decryptIt(CryptedLink param, ProgressController progress) throws Exception {
|
||||
ArrayList<DownloadLink> decryptedLinks = new ArrayList<DownloadLink>();
|
||||
String parameter = param.toString();
|
||||
br.getPage(parameter);
|
||||
String[] links = br.getRegex("id=\\'stat\\d+_\\d+\\'><a href=\\'(http://.*?)\\'").getColumn(0);
|
||||
if (links == null || links.length == 0) {
|
||||
logger.warning("Decrypter broken for link: " + parameter);
|
||||
return null;
|
||||
}
|
||||
for (String singleLink : links) {
|
||||
/** Needed to get the finallink */
|
||||
br.getHeaders().put("Referer", "http://xmirror.eu/?q=r_counter");
|
||||
br.getPage(singleLink);
|
||||
final String finallink = br.getRegex("ads\\'>[\t\n\r ]+<frame src=\"([^<>\"]*?)\"").getMatch(0);
|
||||
if (finallink == null) {
|
||||
logger.warning("Decrypter broken for link: " + parameter + "\n");
|
||||
logger.warning("At link: " + singleLink);
|
||||
return null;
|
||||
}
|
||||
decryptedLinks.add(createDownloadlink(singleLink));
|
||||
}
|
||||
return decryptedLinks;
|
||||
}
|
||||
}
|
@ -42,13 +42,9 @@ import org.appwork.utils.formatter.SizeFormatter;
|
||||
public class BuckShareCom extends PluginForHost {
|
||||
|
||||
private String BRBEFORE = "";
|
||||
|
||||
private static final String PASSWORDTEXT0 = "<br><b>Password:</b> <input";
|
||||
|
||||
private static final String PASSWORDTEXT1 = "<br><b>Passwort:</b> <input";
|
||||
|
||||
private static final String COOKIE_HOST = "http://buckshare.com";
|
||||
|
||||
public boolean NOPREMIUM = false;
|
||||
|
||||
public BuckShareCom(PluginWrapper wrapper) {
|
||||
@ -56,6 +52,37 @@ public class BuckShareCom extends PluginForHost {
|
||||
// this.enablePremium(COOKIE_HOST + "/premium.html");
|
||||
}
|
||||
|
||||
@Override
|
||||
public AvailableStatus requestFileInformation(DownloadLink link) throws IOException, PluginException {
|
||||
this.setBrowserExclusive();
|
||||
br.setFollowRedirects(false);
|
||||
br.setCookie(COOKIE_HOST, "lang", "english");
|
||||
br.getPage(link.getDownloadURL());
|
||||
doSomething();
|
||||
if ("http://buckshare.com/".equals(br.getRedirectLocation()) || BRBEFORE.contains("No such file") || BRBEFORE.contains("No such user exist") || BRBEFORE.contains("File not found") || BRBEFORE.contains(">File Not Found<") || BRBEFORE.contains(">Oops...Not found, perhaps the search will help you")) {
|
||||
logger.warning("file is 99,99% offline, throwing \"file not found\" now...");
|
||||
throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
|
||||
}
|
||||
Regex theRegex = new Regex(BRBEFORE, "<h3><a href=\"[^<>\"/]*?\">([^<>\"]*?)</a> \\(([^<>\"]*?)\\) </h3>");
|
||||
String filename = theRegex.getMatch(0);
|
||||
String filesize = theRegex.getMatch(1);
|
||||
if (filename == null || filename.equals("")) {
|
||||
if (BRBEFORE.contains("You have reached the download-limit")) {
|
||||
logger.warning("Waittime detected, please reconnect to make the linkchecker work!");
|
||||
return AvailableStatus.UNCHECKABLE;
|
||||
}
|
||||
logger.warning("The filename equals null, throwing \"plugin defect\" now...");
|
||||
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
|
||||
}
|
||||
filename = filename.replaceAll("(</b>|<b>|\\.html)", "");
|
||||
link.setName(filename.trim());
|
||||
if (filesize != null && !filesize.equals("")) {
|
||||
logger.info("Filesize found, filesize = " + filesize);
|
||||
link.setDownloadSize(SizeFormatter.getSize(filesize));
|
||||
}
|
||||
return AvailableStatus.TRUE;
|
||||
}
|
||||
|
||||
public void checkErrors(DownloadLink theLink, boolean checkAll, String passCode, boolean loggedIn) throws NumberFormatException, PluginException {
|
||||
if (checkAll) {
|
||||
if (BRBEFORE.contains("<br><b>Password:</b> <input") || BRBEFORE.contains("<br><b>Passwort:</b> <input") || BRBEFORE.contains("Wrong password")) {
|
||||
@ -165,7 +192,7 @@ public class BuckShareCom extends PluginForHost {
|
||||
return finallink;
|
||||
}
|
||||
|
||||
public void doFree(DownloadLink downloadLink, boolean resumable, int maxchunks, boolean loggedIn) throws Exception, PluginException {
|
||||
public void doFree(final DownloadLink downloadLink, boolean resumable, int maxchunks, boolean loggedIn) throws Exception, PluginException {
|
||||
String dllink = null;
|
||||
String passCode = null;
|
||||
if (BRBEFORE.contains("\"download1\"")) {
|
||||
@ -182,6 +209,7 @@ public class BuckShareCom extends PluginForHost {
|
||||
br.setFollowRedirects(false);
|
||||
Form DLForm = br.getFormbyProperty("name", "F1");
|
||||
if (DLForm == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
|
||||
DLForm.setAction(br.getURL());
|
||||
long timeBefore = System.currentTimeMillis();
|
||||
boolean password = false;
|
||||
boolean recaptcha = false;
|
||||
@ -231,21 +259,19 @@ public class BuckShareCom extends PluginForHost {
|
||||
DLForm.put("code", code);
|
||||
logger.info("Put captchacode " + code + " obtained by captcha metod \"Standard captcha\" in the form.");
|
||||
} else if (BRBEFORE.contains("api.recaptcha.net") || BRBEFORE.contains("google.com/recaptcha/api/")) {
|
||||
// Some hosters also got commentfields with captchas, therefore is
|
||||
// the !br.contains...check Exampleplugin:
|
||||
// FileGigaCom
|
||||
recaptcha = true;
|
||||
logger.info("Detected captcha method \"Re Captcha\" for this host");
|
||||
PluginForHost recplug = JDUtilities.getPluginForHost("DirectHTTP");
|
||||
final PluginForHost recplug = JDUtilities.getPluginForHost("DirectHTTP");
|
||||
jd.plugins.hoster.DirectHTTP.Recaptcha rc = ((DirectHTTP) recplug).getReCaptcha(br);
|
||||
rc.parse();
|
||||
rc.setForm(DLForm);
|
||||
String id = new Regex(BRBEFORE, "\\?k=([A-Za-z0-9%_\\+\\- ]+)\"").getMatch(0);
|
||||
rc.setId(id);
|
||||
rc.load();
|
||||
File cf = rc.downloadCaptcha(getLocalCaptchaFile());
|
||||
String c = getCaptchaCode(cf, downloadLink);
|
||||
if (password) {
|
||||
passCode = handlePassword(passCode, rc.getForm(), downloadLink);
|
||||
}
|
||||
recaptcha = true;
|
||||
waitTime(timeBefore, downloadLink);
|
||||
Form rcform = rc.getForm();
|
||||
rcform.put("recaptcha_challenge_field", rc.getChallenge());
|
||||
rcform.put("recaptcha_response_field", Encoding.urlEncode(c));
|
||||
rc.setCode(c);
|
||||
logger.info("Put captchacode " + c + " obtained by captcha metod \"Re Captcha\" in the form and submitted it.");
|
||||
dllink = br.getRedirectLocation();
|
||||
@ -314,15 +340,12 @@ public class BuckShareCom extends PluginForHost {
|
||||
public String getDllink() {
|
||||
String dllink = br.getRedirectLocation();
|
||||
if (dllink == null) {
|
||||
dllink = new Regex(BRBEFORE, "dotted #bbb;padding.*?<a href=\"(.*?)\"").getMatch(0);
|
||||
dllink = new Regex(BRBEFORE, "This (direct link|download link) will be available for your IP.*?href=\"(http.*?)\"").getMatch(1);
|
||||
if (dllink == null) {
|
||||
dllink = new Regex(BRBEFORE, "This (direct link|download link) will be available for your IP.*?href=\"(http.*?)\"").getMatch(1);
|
||||
dllink = new Regex(BRBEFORE, "Download: <a href=\"(.*?)\"").getMatch(0);
|
||||
if (dllink == null) {
|
||||
dllink = new Regex(BRBEFORE, "Download: <a href=\"(.*?)\"").getMatch(0);
|
||||
if (dllink == null) {
|
||||
String crypted = br.getRegex("p}\\((.*?)\\.split\\('\\|'\\)").getMatch(0);
|
||||
if (crypted != null) dllink = decodeDownloadLink(crypted);
|
||||
}
|
||||
String crypted = br.getRegex("p}\\((.*?)\\.split\\('\\|'\\)").getMatch(0);
|
||||
if (crypted != null) dllink = decodeDownloadLink(crypted);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -362,62 +385,6 @@ public class BuckShareCom extends PluginForHost {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AvailableStatus requestFileInformation(DownloadLink link) throws IOException, PluginException {
|
||||
this.setBrowserExclusive();
|
||||
br.setFollowRedirects(false);
|
||||
br.setCookie(COOKIE_HOST, "lang", "english");
|
||||
br.getPage(link.getDownloadURL());
|
||||
doSomething();
|
||||
if ("http://buckshare.com/".equals(br.getRedirectLocation()) || BRBEFORE.contains("No such file") || BRBEFORE.contains("No such user exist") || BRBEFORE.contains("File not found") || BRBEFORE.contains(">File Not Found<") || BRBEFORE.contains(">Oops...Not found, perhaps the search will help you")) {
|
||||
logger.warning("file is 99,99% offline, throwing \"file not found\" now...");
|
||||
throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
|
||||
}
|
||||
Regex additionalRegex = new Regex(BRBEFORE, "<h3>(.*?)<span style=\"color:#A0A0A4;\">\\ \\((.*?)\\)</span> </h3>");
|
||||
String filename = new Regex(BRBEFORE, "You have requested.*?http://.*?[a-z0-9]{12}/(.*?)</font>").getMatch(0);
|
||||
if (filename == null) {
|
||||
filename = new Regex(BRBEFORE, "fname\"( type=\"hidden\")? value=\"(.*?)\"").getMatch(1);
|
||||
if (filename == null) {
|
||||
filename = new Regex(BRBEFORE, "<h2>Download File(.*?)</h2>").getMatch(0);
|
||||
if (filename == null) {
|
||||
filename = new Regex(BRBEFORE, "Filename:</b></td><td[ ]{0,2}>(.*?)</td>").getMatch(0);
|
||||
if (filename == null) {
|
||||
filename = new Regex(BRBEFORE, "Filename.*?nowrap.*?>(.*?)</td").getMatch(0);
|
||||
if (filename == null) {
|
||||
filename = new Regex(BRBEFORE, "File Name.*?nowrap>(.*?)</td").getMatch(0);
|
||||
if (filename == null) {
|
||||
filename = additionalRegex.getMatch(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
String filesize = new Regex(BRBEFORE, "\\(([0-9]+ bytes)\\)").getMatch(0);
|
||||
if (filesize == null) {
|
||||
filesize = new Regex(BRBEFORE, "<small>\\((.*?)\\)</small>").getMatch(0);
|
||||
if (filesize == null) {
|
||||
filesize = new Regex(BRBEFORE, "</font>[ ]+\\((.*?)\\)(.*?)</font>").getMatch(0);
|
||||
if (filesize == null) filesize = additionalRegex.getMatch(1);
|
||||
}
|
||||
}
|
||||
if (filename == null || filename.equals("")) {
|
||||
if (BRBEFORE.contains("You have reached the download-limit")) {
|
||||
logger.warning("Waittime detected, please reconnect to make the linkchecker work!");
|
||||
return AvailableStatus.UNCHECKABLE;
|
||||
}
|
||||
logger.warning("The filename equals null, throwing \"plugin defect\" now...");
|
||||
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
|
||||
}
|
||||
filename = filename.replaceAll("(</b>|<b>|\\.html)", "");
|
||||
link.setName(filename.trim());
|
||||
if (filesize != null && !filesize.equals("")) {
|
||||
logger.info("Filesize found, filesize = " + filesize);
|
||||
link.setDownloadSize(SizeFormatter.getSize(filesize));
|
||||
}
|
||||
return AvailableStatus.TRUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset() {
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user