-added amateurgalore support for empflix fixes #5721

-fixed sendmyway fixes #5723
-fixed qshare fnf errorhandling fixes #5724
-pyramidfiles.com: RIP fixes #5725
-improved 1000eb errorhandling fixes #5726
-cumfox.com: RIP fixes #5569
-xxlupload.com: RIP fixes #5583
-dragonuploadz.com: RIP fixes #5598
-fixed xhamster, now i finally got both linktypes supported fixes #5732
-fixed oron FREE
-checked shareupload limits fixes #5735

git-svn-id: svn://svn.jdownloader.org/jdownloader/trunk@18061 ebf7c1c2-ba36-0410-9fe8-c592906822b4
This commit is contained in:
psp 2012-07-25 21:12:10 +00:00
parent 0c6d41fc73
commit 4ad1550381
17 changed files with 134 additions and 1713 deletions

View File

@ -843,4 +843,9 @@ jd/plugins/hoster/AnnonHostNet.class
jd/plugins/hoster/JSharerCom.class
jd/plugins/hoster/NahrajCz.class
jd/plugins/hoster/MyHomeClipCom.class
jd/plugins/hoster/PlikosPl.class
jd/plugins/hoster/PlikosPl.class
jd/plugins/hoster/XxlUploadCom.class
jd/plugins/hoster/PyramidFilesCom.class
jd/plugins/hoster/TangleCom.class
jd/plugins/hoster/CumFoxCom.class
jd/plugins/hoster/DragonUploadzCom.class

View File

@ -39,15 +39,15 @@ public class AmateurGaloreNet extends PluginForDecrypt {
br.getPage(parameter);
String filename = br.getRegex("<meta name=\"DC\\.title\" content=\"([^<>\"]*?) \\- Amateur Porn \\- AmateurGalore \\- Free Amateur Porn\"").getMatch(0);
if (filename != null) filename = Encoding.htmlDecode(filename.trim());
String tempID = br.getRegex("\"http://videobam\\.com/widget/(.*?)/custom").getMatch(0);
if (tempID != null) {
DownloadLink dl = createDownloadlink("http://videobam.com/videos/download/" + tempID);
String externID = br.getRegex("\"http://videobam\\.com/widget/(.*?)/custom").getMatch(0);
if (externID != null) {
DownloadLink dl = createDownloadlink("http://videobam.com/videos/download/" + externID);
decryptedLinks.add(dl);
return decryptedLinks;
}
tempID = br.getRegex("name=\"FlashVars\" value=\"options=(http://(www\\.)keezmovies\\.com/.*?)\"").getMatch(0);
if (tempID != null) {
br.getPage(tempID);
externID = br.getRegex("name=\"FlashVars\" value=\"options=(http://(www\\.)keezmovies\\.com/.*?)\"").getMatch(0);
if (externID != null) {
br.getPage(externID);
String finallink = br.getRegex("<flv_url>(http://.*?)</flv_url>").getMatch(0);
if (finallink == null) {
logger.warning("Decrypter broken for link: " + parameter);
@ -62,35 +62,40 @@ public class AmateurGaloreNet extends PluginForDecrypt {
decryptedLinks.add(dl);
return decryptedLinks;
}
tempID = br.getRegex("movie_id=(\\d+)").getMatch(0);
if (tempID != null) {
DownloadLink dl = createDownloadlink("http://www.pornrabbit.com/" + tempID + "/bla.html");
externID = br.getRegex("movie_id=(\\d+)").getMatch(0);
if (externID != null) {
DownloadLink dl = createDownloadlink("http://www.pornrabbit.com/" + externID + "/bla.html");
decryptedLinks.add(dl);
return decryptedLinks;
}
tempID = br.getRegex("id_video=(\\d+)\"").getMatch(0);
if (tempID == null) tempID = br.getRegex("xvideos\\.com/embedframe/(\\d+)\"").getMatch(0);
if (tempID != null) {
decryptedLinks.add(createDownloadlink("http://www.xvideos.com/video" + tempID));
externID = br.getRegex("id_video=(\\d+)\"").getMatch(0);
if (externID == null) externID = br.getRegex("xvideos\\.com/embedframe/(\\d+)\"").getMatch(0);
if (externID != null) {
decryptedLinks.add(createDownloadlink("http://www.xvideos.com/video" + externID));
return decryptedLinks;
}
tempID = br.getRegex("\"(http://(www\\.)?tube8\\.com/embed/[^<>\"/]*?/[^<>\"/]*?/\\d+/?)\"").getMatch(0);
if (tempID != null) {
decryptedLinks.add(createDownloadlink(tempID.replace("tube8.com/embed", "tube8.com/")));
externID = br.getRegex("\"(http://(www\\.)?tube8\\.com/embed/[^<>\"/]*?/[^<>\"/]*?/\\d+/?)\"").getMatch(0);
if (externID != null) {
decryptedLinks.add(createDownloadlink(externID.replace("tube8.com/embed", "tube8.com/")));
return decryptedLinks;
}
tempID = br.getRegex("redtube\\.com/player/\"><param name=\"FlashVars\" value=\"id=(\\d+)\\&").getMatch(0);
if (tempID == null) tempID = br.getRegex("embed\\.redtube\\.com/player/\\?id=(\\d+)\\&").getMatch(0);
if (tempID != null) {
DownloadLink dl = createDownloadlink("http://www.redtube.com/" + tempID);
externID = br.getRegex("redtube\\.com/player/\"><param name=\"FlashVars\" value=\"id=(\\d+)\\&").getMatch(0);
if (externID == null) externID = br.getRegex("embed\\.redtube\\.com/player/\\?id=(\\d+)\\&").getMatch(0);
if (externID != null) {
DownloadLink dl = createDownloadlink("http://www.redtube.com/" + externID);
decryptedLinks.add(dl);
return decryptedLinks;
}
externID = br.getRegex("player\\.empflix\\.com/video/(\\d+)\"").getMatch(0);
if (externID != null) {
decryptedLinks.add(createDownloadlink("http://www.empflix.com/videos/" + System.currentTimeMillis() + "-" + externID + ".html"));
return decryptedLinks;
}
if (br.containsHTML("(name=\"movie\" value=\"http://(www\\.)?megaporn\\.com/|name=\"movie\" value=\"http://video\\.megarotic\\.com/|<h3><center><a href=\"http://seemygf\\.com/vod/)")) {
logger.info("Link offline: " + parameter);
return decryptedLinks;
}
if (tempID == null) {
if (externID == null) {
logger.warning("Decrypter broken for link: " + parameter);
return null;
}

View File

@ -40,8 +40,7 @@ public class Mv2kTo extends PluginForDecrypt {
* Description of the regexes array: 1= nowvideo.eu,streamcloud.com
* 2=flashx.tv,veervid.com,ginbig
* .com,vidbux.com,xvidstage.com,xvidstream.net
* ,flashstream.in,hostingbulk.com
* ,vreer.com,uploadc.com,dragonuploadz.com,allmyvideos
* ,flashstream.in,hostingbulk.com ,vreer.com,uploadc.com,allmyvideos
* .net,vidreel.com,putlocker
* .com,vureel.com,vidbox.netdeditv.com,watchfreeinhd.com and many others
* 3=zalaa.com,sockshare.com 4=stream2k.com 5=flashx.tv

View File

@ -28,13 +28,15 @@ import jd.plugins.DownloadLink;
import jd.plugins.FilePackage;
import jd.plugins.PluginForDecrypt;
@DecrypterPlugin(revision = "$Revision$", interfaceVersion = 2, names = { "XFileShareProFolder" }, urls = { "http://(www\\.)?((divload\\.org|divupload\\.org)|rapidfileshare\\.net|rd\\-fs\\.com|hostinoo\\.com|fireget\\.com|filedefend\\.com|creafile\\.net|247upload\\.com|dippic\\.com|4savefile\\.com|4bytez\\.com|fileprohost\\.com|bitupload\\.com|galaxy\\-file\\.com|aa\\.vg|fileza\\.net|allbox4\\.com|netuploaded\\.com|ishareupload\\.com|project\\-free\\-upload\\.com|upfile\\.biz|syfiles\\.com|gorillavid\\.in|(ezzfile\\.com|file4up\\.com)|foxishare\\.com|your\\-filehosting\\.com|mp3the\\.net|mummyfile\\.com|kongsifile\\.com|filerose\\.com|shareupload\\.com|gbitfiles\\.com|animegoon\\.com|ddl\\.mn|spaceha\\.com|mooshare\\.biz|flashdrive\\.it|gptfile\\.com|zooupload\\.com|filedwon\\.com|filemade\\.com|xenubox\\.com|backupload\\.net|mixshared\\.com|longfiles\\.com|helluploads\\.com|novafile\\.com|vidpe\\.com|filetechnology\\.com|saryshare\\.com|orangefiles\\.com|filecosy\\.com|squillion\\.com|ufile\\.eu|fileor\\.com|filesega\\.com|qtyfiles\\.com|pizzaupload\\.com|filesbb\\.com|free\\-uploading\\.com|megaul\\.com|megaup1oad\\.net|fireuploads\\.net|filestay\\.com|(elitedisk\\.com|igetfile\\.com|pandamemo\\.com)|free\\-uploading\\.com|uload\\.to|cosmobox\\.org|filereactor\\.com|uploadjet\\.net|fileove\\.com|rapidapk\\.com|filehost\\.ws|hyshare\\.com|(squillion\\.com|uppit\\.com)|vidhuge\\.com|nosupload\\.com|idup\\.in|potload\\.com|coraldrive\\.net|uploadbaz\\.com|simpleshare\\.org|ryushare\\.com|lafiles\\.com|clicktoview\\.org|lumfiles\\.com|bloonga\\.com|gigfiles\\.net|shareonline\\.org|downloadani\\.me|allmyvideos\\.net|dragonuploadz\\.com|movdivx\\.com|filenuke\\.com|((flashstream\\.in|sharefiles4u\\.com)|xvidstage\\.com|xvidstream\\.net)|ginbig\\.com|vidbux\\.com|divxbase\\.com|batshare\\.com|queenshare\\.com|filesabc\\.com|((fiberupload|bulletupload)\\.com)|edoc\\.com|easybytez\\.com|filesabc\\.com|mojofile\\.com|fileduct\\.com)/(users/[a-z0-9_]+/.+|folder/\\d+/.+)" }, flags = { 0 })
@DecrypterPlugin(revision = "$Revision$", interfaceVersion = 2, names = { "XFileShareProFolder" }, urls = { "http://(www\\.)?((divload\\.org|divupload\\.org)|rapidfileshare\\.net|rd\\-fs\\.com|hostinoo\\.com|fireget\\.com|filedefend\\.com|creafile\\.net|247upload\\.com|dippic\\.com|4savefile\\.com|4bytez\\.com|fileprohost\\.com|bitupload\\.com|galaxy\\-file\\.com|aa\\.vg|fileza\\.net|allbox4\\.com|netuploaded\\.com|ishareupload\\.com|project\\-free\\-upload\\.com|upfile\\.biz|syfiles\\.com|gorillavid\\.in|(ezzfile\\.com|file4up\\.com)|foxishare\\.com|your\\-filehosting\\.com|mp3the\\.net|mummyfile\\.com|kongsifile\\.com|filerose\\.com|shareupload\\.com|gbitfiles\\.com|animegoon\\.com|ddl\\.mn|spaceha\\.com|mooshare\\.biz|flashdrive\\.it|gptfile\\.com|zooupload\\.com|filedwon\\.com|filemade\\.com|xenubox\\.com|backupload\\.net|mixshared\\.com|longfiles\\.com|helluploads\\.com|novafile\\.com|vidpe\\.com|filetechnology\\.com|saryshare\\.com|orangefiles\\.com|filecosy\\.com|squillion\\.com|ufile\\.eu|fileor\\.com|filesega\\.com|qtyfiles\\.com|pizzaupload\\.com|filesbb\\.com|free\\-uploading\\.com|megaul\\.com|megaup1oad\\.net|fireuploads\\.net|filestay\\.com|(elitedisk\\.com|igetfile\\.com|pandamemo\\.com)|free\\-uploading\\.com|uload\\.to|cosmobox\\.org|filereactor\\.com|uploadjet\\.net|fileove\\.com|rapidapk\\.com|filehost\\.ws|hyshare\\.com|(squillion\\.com|uppit\\.com)|vidhuge\\.com|nosupload\\.com|idup\\.in|potload\\.com|coraldrive\\.net|uploadbaz\\.com|simpleshare\\.org|ryushare\\.com|lafiles\\.com|clicktoview\\.org|lumfiles\\.com|bloonga\\.com|gigfiles\\.net|shareonline\\.org|downloadani\\.me|allmyvideos\\.net|movdivx\\.com|filenuke\\.com|((flashstream\\.in|sharefiles4u\\.com)|xvidstage\\.com|xvidstream\\.net)|ginbig\\.com|vidbux\\.com|divxbase\\.com|batshare\\.com|queenshare\\.com|filesabc\\.com|((fiberupload|bulletupload)\\.com)|edoc\\.com|easybytez\\.com|filesabc\\.com|mojofile\\.com|fileduct\\.com)/(users/[a-z0-9_]+/.+|folder/\\d+/.+)" }, flags = { 0 })
public class XFileShareProFolder extends PluginForDecrypt {
// DEV NOTES
// other: keep last /.+ for fpName. Not needed otherwise.
// other: group sister sites or aliased domains together for easy of maintance.
// TODO: add spanning folders + page support, at this stage it's not important.
// other: group sister sites or aliased domains together for easy of
// maintance.
// TODO: add spanning folders + page support, at this stage it's not
// important.
// TODO: remove old xfileshare folder plugins after next major update.
public XFileShareProFolder(PluginWrapper wrapper) {

View File

@ -1,106 +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.hoster;
import java.io.IOException;
import jd.PluginWrapper;
import jd.http.Browser;
import jd.http.URLConnectionAdapter;
import jd.plugins.DownloadLink;
import jd.plugins.DownloadLink.AvailableStatus;
import jd.plugins.HostPlugin;
import jd.plugins.LinkStatus;
import jd.plugins.PluginException;
import jd.plugins.PluginForHost;
@HostPlugin(revision = "$Revision$", interfaceVersion = 2, names = { "cumfox.com" }, urls = { "http://(www\\.)?cumfox\\.com/videos/.*?-\\d+\\.html" }, flags = { 0 })
public class CumFoxCom extends PluginForHost {
private String DLLINK = null;
public CumFoxCom(PluginWrapper wrapper) {
super(wrapper);
}
@Override
public String getAGBLink() {
return "http://www.cumfox.com/contact.php";
}
@Override
public int getMaxSimultanFreeDownloadNum() {
return -1;
}
@Override
public AvailableStatus requestFileInformation(DownloadLink downloadLink) throws IOException, PluginException {
this.setBrowserExclusive();
br.setFollowRedirects(true);
br.getPage(downloadLink.getDownloadURL());
if (br.containsHTML(">404: File Not Found")) throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
String filename = br.getRegex("<h1>Watch free porn ([^<>\"]*?)</h1></div>").getMatch(0);
if (filename == null) filename = br.getRegex("<title>Watch free porn ([^<>\"]*?) \\- Cumfox\\.com</title>").getMatch(0);
final String configPage = br.getRegex("settings=(http://(www\\.)?cumfox\\.com/playerConfig\\.php\\?[^<>\"/]*?\\.(mp4|flv))\"").getMatch(0);
if (configPage == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
br.getPage(configPage);
DLLINK = br.getRegex("defaultVideo:(http://.*?);").getMatch(0);
if (filename == null || DLLINK == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
filename = filename.trim();
String ext = configPage.substring(configPage.lastIndexOf("."));
if (ext == null || ext.length() > 5) ext = ".flv";
downloadLink.setFinalFileName(filename + ext);
Browser br2 = br.cloneBrowser();
URLConnectionAdapter con = null;
try {
con = br2.openGetConnection(DLLINK);
if (!con.getContentType().contains("html"))
downloadLink.setDownloadSize(con.getLongContentLength());
else
throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
return AvailableStatus.TRUE;
} finally {
try {
con.disconnect();
} catch (Throwable e) {
}
}
}
@Override
public void handleFree(DownloadLink downloadLink) throws Exception {
requestFileInformation(downloadLink);
dl = jd.plugins.BrowserAdapter.openDownload(br, downloadLink, DLLINK, true, 0);
if (dl.getConnection().getContentType().contains("html")) {
br.followConnection();
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
dl.startDownload();
}
@Override
public void reset() {
}
@Override
public void resetDownloadlink(DownloadLink link) {
}
@Override
public void resetPluginGlobals() {
}
}

View File

@ -1,484 +0,0 @@
// jDownloader - Downloadmanager
// Copyright (C) 2012 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.hoster;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.SortedMap;
import java.util.TreeMap;
import java.util.regex.Pattern;
import jd.PluginWrapper;
import jd.config.Property;
import jd.http.Browser;
import jd.http.URLConnectionAdapter;
import jd.nutils.encoding.Encoding;
import jd.parser.Regex;
import jd.parser.html.Form;
import jd.parser.html.HTMLParser;
import jd.plugins.DownloadLink;
import jd.plugins.DownloadLink.AvailableStatus;
import jd.plugins.HostPlugin;
import jd.plugins.LinkStatus;
import jd.plugins.Plugin;
import jd.plugins.PluginException;
import jd.plugins.PluginForHost;
import jd.utils.JDUtilities;
import jd.utils.locale.JDL;
import org.appwork.utils.formatter.SizeFormatter;
@HostPlugin(revision = "$Revision$", interfaceVersion = 2, names = { "dragonuploadz.com" }, urls = { "https?://(www\\.)?dragonuploadz\\.com/[a-z0-9]{12}" }, flags = { 0 })
public class DragonUploadzCom extends PluginForHost {
private String correctedBR = "";
private static final String PASSWORDTEXT = "<br><b>Passwor(d|t):</b> <input";
private static final String COOKIE_HOST = "http://dragonuploadz.com";
private static final String MAINTENANCE = ">This server is in maintenance mode";
private static final String MAINTENANCEUSERTEXT = "This server is under Maintenance";
private static final String ALLWAIT_SHORT = "Waiting till new downloads can be started";
// DEV NOTES
// XfileSharingProBasic Version 2.5.5.3-raz
// mods: AvailableStatus
// non account: 20 * unlimited
// free account:
// premium account:
// protocol: no https
// captchatype: null
// other: no redirects
@Override
public void correctDownloadLink(DownloadLink link) {
link.setUrlDownload(link.getDownloadURL().replace("https://", "http://"));
}
@Override
public String getAGBLink() {
return COOKIE_HOST + "/tos.html";
}
public DragonUploadzCom(PluginWrapper wrapper) {
super(wrapper);
// this.enablePremium(COOKIE_HOST + "/premium.html");
}
// do not add @Override here to keep 0.* compatibility
public boolean hasAutoCaptcha() {
return false;
}
// do not add @Override here to keep 0.* compatibility
public boolean hasCaptcha() {
return false;
}
public void prepBrowser() {
// define custom browser headers and language settings.
br.getHeaders().put("Accept-Language", "en-gb, en;q=0.9, de;q=0.8");
br.setCookie(COOKIE_HOST, "lang", "english");
}
@Override
public AvailableStatus requestFileInformation(DownloadLink link) throws Exception {
this.setBrowserExclusive();
br.setFollowRedirects(false);
prepBrowser();
getPage(link.getDownloadURL());
if (new Regex(correctedBR, Pattern.compile("(No such file|>File Not Found<|>The file was removed by|Reason (of|for) deletion:\n)", Pattern.CASE_INSENSITIVE)).matches()) throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
if (correctedBR.contains(MAINTENANCE)) {
link.getLinkStatus().setStatusText(JDL.L("plugins.hoster.xfilesharingprobasic.undermaintenance", MAINTENANCEUSERTEXT));
return AvailableStatus.TRUE;
}
String filename = new Regex(correctedBR, "You have requested.*?https?://(www\\.)?" + this.getHost() + "/[A-Za-z0-9]{12}/(.*?)</font>").getMatch(1);
if (filename == null) {
filename = new Regex(correctedBR, "fname\"( type=\"hidden\")? value=\"(.*?)\"").getMatch(1);
if (filename == null) {
filename = new Regex(correctedBR, "<h2>Download File(.*?)</h2>").getMatch(0);
if (filename == null) {
filename = new Regex(correctedBR, "(?i)\\]([^<]+) \\- ([\\d\\.]+ ?(KB|MB|GB))\\[/URL\\]").getMatch(0);
}
}
}
String filesize = new Regex(correctedBR, "\\(([0-9]+ bytes)\\)").getMatch(0);
if (filesize == null) {
filesize = new Regex(correctedBR, "</font>[ ]+\\(([^<>\"\\'/]+)\\)(.*?)</font>").getMatch(0);
if (filesize == null) {
// generic regex picks up false positives (premium ads above
// filesize)
// adjust accordingly to make work with COOKIE_HOST
filesize = new Regex(correctedBR, "(?i)([\\d\\.]+ ?(KB|MB|GB))").getMatch(0);
}
}
if (filename == null || filename.equals("")) {
if (correctedBR.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.setProperty("plainfilename", filename);
link.setFinalFileName(filename.trim());
if (filesize != null && !filesize.equals("")) link.setDownloadSize(SizeFormatter.getSize(filesize));
return AvailableStatus.TRUE;
}
@Override
public void handleFree(DownloadLink downloadLink) throws Exception, PluginException {
requestFileInformation(downloadLink);
doFree(downloadLink, true, 0, "freelink");
}
public void doFree(DownloadLink downloadLink, boolean resumable, int maxchunks, String directlinkproperty) throws Exception, PluginException {
String passCode = null;
String md5hash = new Regex(correctedBR, "<b>MD5.*?</b>.*?nowrap>(.*?)<").getMatch(0);
if (md5hash != null) {
md5hash = md5hash.trim();
logger.info("Found md5hash: " + md5hash);
downloadLink.setMD5Hash(md5hash);
}
String dllink = checkDirectLink(downloadLink, directlinkproperty);
/**
* Video links can already be found here, if a link is found here we can
* skip wait times and captchas
*/
if (dllink == null) {
checkErrors(downloadLink, false, passCode);
if (correctedBR.contains("\"download1\"")) {
postPage(br.getURL(), "op=download1&usr_login=&id=" + new Regex(downloadLink.getDownloadURL(), "/([A-Za-z0-9]{12})$").getMatch(0) + "&fname=" + Encoding.urlEncode(downloadLink.getStringProperty("plainfilename")) + "&referer=&method_free=Free+Download");
checkErrors(downloadLink, false, passCode);
}
dllink = getDllink();
}
if (dllink == null) {
Form dlForm = br.getFormbyProperty("name", "F1");
if (dlForm == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
// this is for sites with multiple f1 forms deep. This does not hurt
// or interfere any other sections of this script
for (int i = 0; i <= 3; i++) {
dlForm.remove(null);
final long timeBefore = System.currentTimeMillis();
boolean password = false;
boolean skipWaittime = false;
if (new Regex(correctedBR, PASSWORDTEXT).matches()) {
password = true;
logger.info("The downloadlink seems to be password protected.");
}
/* Captcha START */
if (correctedBR.contains(";background:#ccc;text-align")) {
logger.info("Detected captcha method \"plaintext captchas\" for this host");
/** Captcha method by ManiacMansion */
String[][] letters = new Regex(Encoding.htmlDecode(br.toString()), "<span style=\\'position:absolute;padding\\-left:(\\d+)px;padding\\-top:\\d+px;\\'>(\\d)</span>").getMatches();
if (letters == null || letters.length == 0) {
logger.warning("plaintext captchahandling broken!");
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
SortedMap<Integer, String> capMap = new TreeMap<Integer, String>();
for (String[] letter : letters) {
capMap.put(Integer.parseInt(letter[0]), letter[1]);
}
StringBuilder code = new StringBuilder();
for (String value : capMap.values()) {
code.append(value);
}
dlForm.put("code", code.toString());
logger.info("Put captchacode " + code.toString() + " obtained by captcha metod \"plaintext captchas\" in the form.");
} else if (correctedBR.contains("/captchas/")) {
logger.info("Detected captcha method \"Standard captcha\" for this host");
String[] sitelinks = HTMLParser.getHttpLinks(br.toString(), null);
String captchaurl = null;
if (sitelinks == null || sitelinks.length == 0) {
logger.warning("Standard captcha captchahandling broken!");
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
for (String link : sitelinks) {
if (link.contains("/captchas/")) {
captchaurl = link;
break;
}
}
if (captchaurl == null) {
logger.warning("Standard captcha captchahandling broken!");
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
String code = getCaptchaCode("xfilesharingprobasic", captchaurl, downloadLink);
dlForm.put("code", code);
logger.info("Put captchacode " + code + " obtained by captcha metod \"Standard captcha\" in the form.");
} else if (new Regex(correctedBR, "(api\\.recaptcha\\.net|google\\.com/recaptcha/api/)").matches()) {
logger.info("Detected captcha method \"Re Captcha\" for this host");
PluginForHost recplug = JDUtilities.getPluginForHost("DirectHTTP");
jd.plugins.hoster.DirectHTTP.Recaptcha rc = ((DirectHTTP) recplug).getReCaptcha(br);
rc.setForm(dlForm);
String id = new Regex(correctedBR, "\\?k=([A-Za-z0-9%_\\+\\- ]+)\"").getMatch(0);
rc.setId(id);
rc.load();
File cf = rc.downloadCaptcha(getLocalCaptchaFile());
String c = getCaptchaCode(cf, downloadLink);
Form rcform = rc.getForm();
rcform.put("recaptcha_challenge_field", rc.getChallenge());
rcform.put("recaptcha_response_field", Encoding.urlEncode(c));
logger.info("Put captchacode " + c + " obtained by captcha metod \"Re Captcha\" in the form and submitted it.");
dlForm = rc.getForm();
/** wait time is often skippable for reCaptcha handling */
// skipWaittime = true;
}
/* Captcha END */
if (password) passCode = handlePassword(passCode, dlForm, downloadLink);
if (!skipWaittime) waitTime(timeBefore, downloadLink);
sendForm(dlForm);
logger.info("Submitted DLForm");
checkErrors(downloadLink, true, passCode);
dllink = getDllink();
if (dllink == null && br.containsHTML("(?i)<Form name=\"F1\" method=\"POST\" action=\"\"")) {
dlForm = br.getFormbyProperty("name", "F1");
continue;
} else if (dllink == null && !br.containsHTML("(?i)<Form name=\"F1\" method=\"POST\" action=\"\"")) {
logger.warning("Final downloadlink (String is \"dllink\") regex didn't match!");
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
} else
break;
}
}
logger.info("Final downloadlink = " + dllink + " starting the download...");
dl = jd.plugins.BrowserAdapter.openDownload(br, downloadLink, dllink, resumable, maxchunks);
if (dl.getConnection().getContentType().contains("html")) {
logger.warning("The final dllink seems not to be a file!");
br.followConnection();
correctBR();
checkServerErrors();
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
downloadLink.setProperty(directlinkproperty, dllink);
if (passCode != null) downloadLink.setProperty("pass", passCode);
dl.startDownload();
}
@Override
public int getMaxSimultanFreeDownloadNum() {
return -1;
}
/** Remove HTML code which could break the plugin */
public void correctBR() throws NumberFormatException, PluginException {
correctedBR = br.toString();
ArrayList<String> someStuff = new ArrayList<String>();
ArrayList<String> regexStuff = new ArrayList<String>();
regexStuff.add("<\\!(\\-\\-.*?\\-\\-)>");
regexStuff.add("(display: none;\">.*?</div>)");
regexStuff.add("(visibility:hidden>.*?<)");
for (String aRegex : regexStuff) {
String lolz[] = br.getRegex(aRegex).getColumn(0);
if (lolz != null) {
for (String dingdang : lolz) {
someStuff.add(dingdang);
}
}
}
for (String fun : someStuff) {
correctedBR = correctedBR.replace(fun, "");
}
}
public String getDllink() {
String dllink = br.getRedirectLocation();
if (dllink == null) {
dllink = new Regex(correctedBR, "dotted #bbb;padding.*?<a href=\"(.*?)\"").getMatch(0);
if (dllink == null) {
dllink = new Regex(correctedBR, "This (direct link|download link) will be available for your IP.*?href=\"(http.*?)\"").getMatch(1);
if (dllink == null) {
dllink = new Regex(correctedBR, "Download: <a href=\"(.*?)\"").getMatch(0);
if (dllink == null) {
dllink = new Regex(correctedBR, "<a href=\"(https?://[^\"]+)\"[^>]+>Click to Download").getMatch(0);
if (dllink == null) {
String cryptedScripts[] = new Regex(correctedBR, "p\\}\\((.*?)\\.split\\('\\|'\\)").getColumn(0);
if (cryptedScripts != null && cryptedScripts.length != 0) {
for (String crypted : cryptedScripts) {
dllink = decodeDownloadLink(crypted);
if (dllink != null) break;
}
}
}
}
}
}
}
return dllink;
}
private void getPage(String page) throws Exception {
br.getPage(page);
correctBR();
}
private void postPage(String page, String postdata) throws Exception {
br.postPage(page, postdata);
correctBR();
}
private void sendForm(Form form) throws Exception {
br.submitForm(form);
correctBR();
}
public void checkErrors(DownloadLink theLink, boolean checkAll, String passCode) throws NumberFormatException, PluginException {
if (checkAll) {
if (new Regex(correctedBR, PASSWORDTEXT).matches() || correctedBR.contains("Wrong password")) {
logger.warning("Wrong password, the entered password \"" + passCode + "\" is wrong, retrying...");
throw new PluginException(LinkStatus.ERROR_RETRY, "Wrong password entered");
}
if (correctedBR.contains("Wrong captcha")) {
logger.warning("Wrong captcha or wrong password!");
throw new PluginException(LinkStatus.ERROR_CAPTCHA);
}
if (correctedBR.contains("\">Skipped countdown<")) throw new PluginException(LinkStatus.ERROR_FATAL, "Fatal countdown error (countdown skipped)");
}
/** Wait time reconnect handling */
if (new Regex(correctedBR, "(You have reached the download\\-limit|You have to wait)").matches()) {
// adjust this regex to catch the wait time string for COOKIE_HOST
String WAIT = new Regex(correctedBR, "((You have reached the download\\-limit|You have to wait)[^<>]+)").getMatch(0);
String tmphrs = new Regex(WAIT, "\\s+(\\d+)\\s+hours?").getMatch(0);
if (tmphrs == null) tmphrs = new Regex(correctedBR, "You have to wait.*?\\s+(\\d+)\\s+hours?").getMatch(0);
String tmpmin = new Regex(WAIT, "\\s+(\\d+)\\s+minutes?").getMatch(0);
if (tmpmin == null) tmpmin = new Regex(correctedBR, "You have to wait.*?\\s+(\\d+)\\s+minutes?").getMatch(0);
String tmpsec = new Regex(WAIT, "\\s+(\\d+)\\s+seconds?").getMatch(0);
String tmpdays = new Regex(WAIT, "\\s+(\\d+)\\s+days?").getMatch(0);
if (tmphrs == null && tmpmin == null && tmpsec == null && tmpdays == null) {
logger.info("Waittime regexes seem to be broken");
throw new PluginException(LinkStatus.ERROR_IP_BLOCKED, null, 60 * 60 * 1000l);
} else {
int minutes = 0, seconds = 0, hours = 0, days = 0;
if (tmphrs != null) hours = Integer.parseInt(tmphrs);
if (tmpmin != null) minutes = Integer.parseInt(tmpmin);
if (tmpsec != null) seconds = Integer.parseInt(tmpsec);
if (tmpdays != null) days = Integer.parseInt(tmpdays);
int waittime = ((days * 24 * 3600) + (3600 * hours) + (60 * minutes) + seconds + 1) * 1000;
logger.info("Detected waittime #2, waiting " + waittime + "milliseconds");
/** Not enough wait time to reconnect->Wait and try again */
if (waittime < 180000) { throw new PluginException(LinkStatus.ERROR_HOSTER_TEMPORARILY_UNAVAILABLE, JDL.L("plugins.hoster.xfilesharingprobasic.allwait", ALLWAIT_SHORT), waittime); }
throw new PluginException(LinkStatus.ERROR_IP_BLOCKED, null, waittime);
}
}
if (correctedBR.contains("You're using all download slots for IP")) { throw new PluginException(LinkStatus.ERROR_IP_BLOCKED, null, 10 * 60 * 1001l); }
if (correctedBR.contains("Error happened when generating Download Link")) throw new PluginException(LinkStatus.ERROR_TEMPORARILY_UNAVAILABLE, "Server error!", 10 * 60 * 1000l);
/** Error handling for only-premium links */
if (new Regex(correctedBR, "( can download files up to |Upgrade your account to download bigger files|>Upgrade your account to download larger files|>The file You requested reached max downloads limit for Free Users|Please Buy Premium To download this file<|This file reached max downloads limit)").matches()) {
String filesizelimit = new Regex(correctedBR, "You can download files up to(.*?)only").getMatch(0);
if (filesizelimit != null) {
filesizelimit = filesizelimit.trim();
logger.warning("As free user you can download files up to " + filesizelimit + " only");
throw new PluginException(LinkStatus.ERROR_FATAL, "Free users can only download files up to " + filesizelimit);
} else {
logger.warning("Only downloadable via premium");
throw new PluginException(LinkStatus.ERROR_FATAL, "Only downloadable via premium or registered");
}
}
if (correctedBR.contains(MAINTENANCE)) throw new PluginException(LinkStatus.ERROR_TEMPORARILY_UNAVAILABLE, JDL.L("plugins.hoster.xfilesharingprobasic.undermaintenance", MAINTENANCEUSERTEXT), 2 * 60 * 60 * 1000l);
}
public void checkServerErrors() throws NumberFormatException, PluginException {
if (new Regex(correctedBR, Pattern.compile("No file", Pattern.CASE_INSENSITIVE)).matches()) throw new PluginException(LinkStatus.ERROR_FATAL, "Server error");
if (new Regex(correctedBR, "(File Not Found|<h1>404 Not Found</h1>)").matches()) {
logger.warning("Server says link offline, please recheck that!");
throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
}
}
private String decodeDownloadLink(String s) {
String decoded = null;
try {
Regex params = new Regex(s, "\\'(.*?[^\\\\])\\',(\\d+),(\\d+),\\'(.*?)\\'");
String p = params.getMatch(0).replaceAll("\\\\", "");
int a = Integer.parseInt(params.getMatch(1));
int c = Integer.parseInt(params.getMatch(2));
String[] k = params.getMatch(3).split("\\|");
while (c != 0) {
c--;
if (k[c].length() != 0) p = p.replaceAll("\\b" + Integer.toString(c, a) + "\\b", k[c]);
}
decoded = p;
} catch (Exception e) {
}
String finallink = null;
if (decoded != null) {
finallink = new Regex(decoded, "name=\"src\"value=\"(.*?)\"").getMatch(0);
if (finallink == null) {
finallink = new Regex(decoded, "type=\"video/divx\"src=\"(.*?)\"").getMatch(0);
if (finallink == null) {
finallink = new Regex(decoded, "\\.addVariable\\(\\'file\\',\\'(http://.*?)\\'\\)").getMatch(0);
}
}
}
return finallink;
}
private String handlePassword(String passCode, Form pwform, DownloadLink thelink) throws IOException, PluginException {
passCode = thelink.getStringProperty("pass", null);
if (passCode == null) passCode = Plugin.getUserInput("Password?", thelink);
pwform.put("password", passCode);
logger.info("Put password \"" + passCode + "\" entered by user in the DLForm.");
return Encoding.urlEncode(passCode);
}
private String checkDirectLink(DownloadLink downloadLink, String property) {
String dllink = downloadLink.getStringProperty(property);
if (dllink != null) {
try {
Browser br2 = br.cloneBrowser();
URLConnectionAdapter con = br2.openGetConnection(dllink);
if (con.getContentType().contains("html") || con.getLongContentLength() == -1) {
downloadLink.setProperty(property, Property.NULL);
dllink = null;
}
con.disconnect();
} catch (Exception e) {
downloadLink.setProperty(property, Property.NULL);
dllink = null;
}
}
return dllink;
}
@Override
public void reset() {
}
@Override
public void resetDownloadlink(DownloadLink link) {
}
private void waitTime(long timeBefore, DownloadLink downloadLink) throws PluginException {
int passedTime = (int) ((System.currentTimeMillis() - timeBefore) / 1000) - 1;
/** Ticket Time */
final String ttt = new Regex(correctedBR, "id=\"countdown_str\">[^<>\"]+<span id=\"[^<>\"]+\"( class=\"[^<>\"]+\")?>([\n ]+)?(\\d+)([\n ]+)?</span>").getMatch(2);
if (ttt != null) {
int tt = Integer.parseInt(ttt);
tt -= passedTime;
logger.info("Waittime detected, waiting " + ttt + " - " + passedTime + " seconds from now on...");
if (tt > 0) sleep(tt * 1000l, downloadLink);
}
}
}

View File

@ -35,17 +35,18 @@ import jd.plugins.PluginForHost;
/* Set interfaceVersion to 3 to avoid old Stable trying to load this Plugin */
@HostPlugin(revision = "$Revision$", interfaceVersion = 3, names = { "nahraj.cz", "jsharer.com", "annonhost.net", "filekeeper.org", "dynyoo.com", "163pan.com", "imagehost.org", "4us.to", "yabadaba.ru", "madshare.com", "diglo.com", "tubeload.to", "tunabox.net", "yourfilehost.com", "uploadegg.com", "brsbox.com", "amateurboobtube.com", "realgfporn.com", "good.net", "freeload.to", "netporn.nl", "przeklej.pl", "alldrives.ge", "allshares.ge", "holderfile.com", "megashare.vnn.vn", "link.ge", "up.jeje.ge", "up-4.com", "cloudcache", "ddlanime.com", "mountfile.com", "platinshare.com", "ishare.iask.sina.com.cn", "megavideo.com", "megaupload.com", "cum.com", "zshare.net", "uploading4u.com", "megafree.kz", "batubia.com", "upload24.net", "files.namba.kz", "datumbit.com", "fik1.com", "fileape.com", "filezzz.com", "imagewaste.com", "fyels.com", "gotupload.com", "sharehub.com", "sharehut.com",
"filesurf.ru", "openfile.ru", "letitfile.ru", "tab.net.ua", "uploadbox.com", "supashare.net", "usershare.net", "skipfile.com", "10upload.com", "x7.to", "multiupload.com", "uploadking.com", "uploadhere.com", "fileshaker.com", "vistaupload.com", "groovefile.com", "enterupload.com", "xshareware.com", "xun6.com", "yourupload.de", "youshare.eu", "mafiaupload.com", "addat.hu", "archiv.to", "bigupload.com", "biggerupload.com", "bitload.com", "bufiles.com", "cash-file.net", "combozip.com", "duckload.com", "exoshare.com", "file2upload.net", "filebase.to", "filebling.com", "filecrown.com", "filefrog.to", "filefront.com", "filehook.com", "filestage.to", "filezup.com", "fullshare.net", "gaiafile.com", "keepfile.com", "kewlshare.com", "lizshare.net", "loaded.it", "loadfiles.in", "megarapid.eu", "megashare.vn", "metahyper.com", "missupload.com", "netstorer.com", "nextgenvidz.com",
"piggyshare.com", "profitupload.com", "quickload.to", "quickyshare.com", "share.cx", "sharehoster.de", "shareua.com", "speedload.to", "upfile.in", "ugotfile.com", "upload.ge", "uploadmachine.com", "uploady.to", "uploadstore.net", "vspace.cc", "web-share.net", "yvh.cc", "x-files.kz" }, urls = { "http://(www\\.)?nahraj\\.cz/content/(view|download)/[a-z0-9]+\\-[a-z0-9]+\\-[a-z0-9]+\\-[a-z0-9]+\\-[a-z0-9]+", "http://(www\\.)?jsharer\\.com/download/[a-z0-9]+\\.htm", "https?://(www\\.)?annonhost\\.net/[a-z0-9]{12}", "http://(www\\.)?filekeeper\\.org/download/[0-9a-zA-Z]+/([\\(\\)0-9A-Za-z\\.\\-_% ]+|[/]+/[\\(\\)0-9A-Za-z\\.\\-_% ])", "http://(www\\.)?dynyoo\\.com/\\?goto=dl\\&id=[a-z0-9]{32}", "http://[\\w\\.]*?163pan\\.com/files/[a-z0-9]+\\.html", "http://[\\w\\.]*?imagehost\\.org/(download/[0-9]+/.+|[0-9]+/.+)", "http://[\\w\\.]*?4us\\.to/download\\.php\\?id=[A-Z0-9]+",
"http://[\\w\\.]*?yabadaba\\.ru/files/[0-9]+", "http://(www\\.)?madshare\\.com/(en/)?download/[a-zA-Z0-9]+/", "http://(www\\.)?diglo\\.com/download/[a-z0-9]+", "http://(www\\.)?tubeload\\.to/file(\\d+)?\\-.+", "http://(www\\.)?tunabox\\.net/files/[A-Za-z0-9]+\\.html", "http://[\\w\\.]*?yourfilehost\\.com/media\\.php\\?cat=.*?\\&file=.+", "https?://(www\\.)?uploadegg\\.com/[a-z0-9]{12}", "http://(www\\.)?brsbox\\.com/filebox/down/fc/[a-z0-9]{32}", "http://(www\\.)?amateurboobtube\\.com/videos/\\d+/.*?\\.html", "http://(www\\.)?realgfporn\\.com/\\d+/.*?\\.html", "http://(www\\.)?good\\.net/.+", "http://(www\\.)*?(freeload|mcload)\\.to/(divx\\.php\\?file_id=|\\?Mod=Divx\\&Hash=)[a-z0-9]+", "http://(www\\.)?netporn\\.nl/watch/[a-z0-9]+/.{1}", "http://(www\\.)?przeklej\\.pl/(d/\\w+/|\\d+|plik/)[^\\s]+", "http://(www\\.)?alldrives\\.ge/main/linkform\\.php\\?f=[a-z0-9]+",
"http://(www\\.)?allshares\\.ge/(\\?d|download\\.php\\?id)=[A-Z0-9]+", "https?://(www\\.)?holderfile\\.com/[a-z0-9]{12}", "http://(www\\.)?megashare\\.vnn\\.vn/((\\?d|download\\.php\\?id)=[A-Z0-9]+|((en|ru|fr|es)/)?file/[0-9]+/)", "http://(www\\.)?link\\.ge/((\\?d|download\\.php\\?id)=[A-Z0-9]+|((en|ru|fr|es)/)?file/[0-9]+/)", "http://(www\\.)?up\\.jeje\\.ge//((\\?d|download\\.php\\?id)=[A-Z0-9]+|((en|ru|fr|es)/)?file/[0-9]+/)", "http://(www\\.)?up\\-4\\.com/(\\?d|download\\.php\\?id)=[A-Z0-9]+", "https?://(www\\.)?cloudcache\\.cc/[a-z0-9]{12}", "https?://(www\\.)?(ddlanime\\.com|ddlani\\.me)/[a-z0-9]{12}", "http://(www\\.)?mountfile\\.com/file/[a-z0-9]+/[a-z0-9]+", "http://(www\\.)?platinshare\\.com/files/[A-Za-z0-9]+", "http://(www\\.)?ishare\\.iask\\.sina\\.com\\.cn/f/\\d+\\.html", "http://(www\\.)?megavideo\\.com/(.*?(v|d)=|v/)[a-zA-Z0-9]+",
"http://(www\\.)?megaupload\\.com/.*?(\\?|&)d=[0-9A-Za-z]+", "http://(www\\.)?(cum|megaporn|megarotic|sexuploader)\\.com/(.*?v=|v/)[a-zA-Z0-9]+", "http://(www\\.)?zshare\\.net/(download|video|image|audio|flash)/.*", "http://(www\\.)?uploading4u\\.com/((\\?d|download\\.php\\?id)=[A-Z0-9]+|((en|ru|fr|es)/)?file/[0-9]+/)", "http://(www\\.)?megafree\\.kz/file\\d+", "http://(www\\.)?batubia\\.com/[a-z0-9]{12}", "http://(www\\.)?upload24\\.net/[a-z0-9]+\\.[a-z0-9]+", "http://(www\\.)?download\\.files\\.namba\\.kz/files/\\d+", "http://(www\\.)?datumbit\\.com/file/.*?/", "http://(www\\.)?fik1\\.com/[a-z0-9]{12}", "http://(www\\.)?fileape\\.com/(index\\.php\\?act=download\\&id=|dl/)\\w+", "http://(www\\.)?filezzz\\.com/download/[0-9]+/", "http://(www\\.)?imagewaste\\.com/pictures/\\d+/.{1}", "http://(www\\.)?fyels\\.com/[A-Za-z0-9]+", "http://(www\\.)?gotupload\\.com/[a-z0-9]{12}",
"http://(go.sharehub.com|sharehub.me|follow.to|kgt.com|krt.com)/.*", "http://(www\\.)?sharehut\\.com/[a-z0-9]{12}", "http://[\\w\\.]*?(filesurf|4ppl|files\\.youmama)\\.ru/[0-9]+", "http://[\\w\\.]*?openfile\\.ru/[0-9]+", "http://[\\w\\.]*?letitfile\\.(ru|com)/download/id\\d+", "http://[\\w\\.]*?tab\\.net\\.ua/sites/files/site_name\\..*?/id\\.\\d+/", "http://[\\w\\.]*?uploadbox\\.com/.*?files/[0-9a-zA-Z]+", "http://(www\\.)?supashare\\.net/[a-z0-9]{12}", "https?://(www\\.)?usershare\\.net/[a-z0-9]{12}", "http://(www\\.)?skipfile\\.com/[a-z0-9]{12}", "http://(www\\.)?10upload\\.com/[a-z0-9]{12}", "http://[\\w\\.]*?x7\\.to/(?!list)[a-zA-Z0-9]+(/(?!inList)[^/\r\n]+)?", "http://(www\\.)?multiuploaddecrypted\\.com/([A-Z0-9]{2}_[A-Z0-9]+|[0-9A-Z]+)", "http://(www\\.)?uploadking\\.com/[A-Z0-9]+", "http://(www\\.)?uploadhere\\.com/[A-Z0-9]+", "http://[\\w\\.]*?fileshaker\\.com/.+",
"http://(www\\.)?vistaupload\\.com/[a-z0-9]{12}", "https?://(www\\.)?groovefile\\.com/[a-z0-9]{12}", "http://[\\w\\.]*?enterupload\\.com/[a-z0-9]{12}", "http://[\\w\\.]*?xshareware\\.com/[\\w]+/.*", "http://[\\w\\.]*?xun6\\.(com|net)/file/[a-z0-9]+", "http://(www\\.)?yourupload\\.de/[a-z0-9]{12}", "http://(www\\.)?youshare\\.eu/[a-z0-9]{12}", "http://(www\\.)?mafiaupload\\.com/do\\.php\\?id=\\d+", "http://[\\w\\.]*?addat.hu/.+/.+", "http://(www\\.)?archiv\\.to/((\\?Module\\=Details\\&HashID\\=|GET/)FILE[A-Z0-9]+|view/divx/[a-z0-9]+)", "http://[\\w\\.]*?bigupload\\.com/(d=|files/)[A-Z0-9]+", "http://(www\\.)?biggerupload\\.com/[a-z0-9]{12}", "http://(www\\.)?(bitload\\.com/(f|d)/\\d+/[a-z0-9]+|mystream\\.to/file-\\d+-[a-z0-9]+)", "https?://(www\\.)?bufiles\\.com/[a-z0-9]{12}", "http://(www\\.)?cash-file\\.(com|net)/[a-z0-9]{12}", "http://[\\w\\.]*?combozip\\.com/[a-z0-9]{12}",
"http://[\\w\\.]*?(duckload\\.com|youload\\.to)/(download/[a-z0-9]+|(divx|play)/[A-Z0-9\\.-]+|[a-zA-Z0-9\\.]+)", "http://(www\\.)?exoshare\\.com/[a-z0-9]{12}", "http://[\\w\\.]*?file2upload\\.(net|com)/download/[0-9]+/", "http://[\\w\\.]*?filebase\\.to/(files|download)/\\d{1,}/.*", "http://[\\w\\.]*?filebling\\.com/[a-z0-9]{12}", "http://(www\\.)?filecrown\\.com/[a-z0-9]{12}", "http://[\\w\\.]*?filefrog\\.to/download/\\d+/[a-zA-Z0-9]+", "http://[\\w\\.]*?filefront\\.com/[0-9]+", "http://(www\\.)?filehook\\.com/[a-z0-9]{12}", "http://(www\\.)?filestage\\.to/watch/[a-z0-9]+/", "http://(www\\.)?(filezup|divxupfile)\\.com/[a-z0-9]{12}", "http://[\\w\\.]*?fullshare\\.net/show/[a-z0-9]+/.+", "http://(www\\.)?gaiafile\\.com/[a-z0-9]{12}", "http://[\\w\\.]*?keepfile\\.com/[a-z0-9]{12}", "http://[\\w\\.]*?kewlshare\\.com/dl/[\\w]+/", "http://[\\w\\.]*?lizshare\\.net/[a-z0-9]{12}",
"http://(www\\.)?loaded\\.it/(show/[a-z0-9]+/[A-Za-z0-9_\\-% \\.]+|(flash|divx)/[a-z0-9]+/)", "http://[\\w\\.]*?loadfiles\\.in/[a-z0-9]{12}", "(http://[\\w\\.]*?megarapid\\.eu/files/\\d+/.+)|(http://[\\w\\.]*?megarapid\\.eu/\\?e=403\\&m=captcha\\&file=\\d+/.+)", "http://[\\w\\.]*?(megashare\\.vn/(download\\.php\\?uid=[0-9]+\\&id=[0-9]+|dl\\.php/\\d+)|share\\.megaplus\\.vn/dl\\.php/\\d+)", "http://(www\\.)?metahyper\\.com/[a-z0-9]{12}", "http://[\\w\\.]*?missupload\\.com/[a-z0-9]{12}", "http://[\\w\\.]*?netstorer\\.com/[a-zA-Z0-9]+/.+", "http://[\\w\\.]*?nextgenvidz\\.com/view/\\d+", "http://(www\\.)?piggyshare\\.com/file/[a-z0-9]+", "http://(www\\.)?profitupload\\.com/files/[A-Za-z0-9]+\\.html", "http://[\\w\\.]*?quickload\\.to/\\?Go=Player\\&HashID=FILE[A-Z0-9]+", "http://[\\w\\.]*?quickyshare\\.com/[a-z0-9]{12}", "http://[\\w\\.]*?share\\.cx/(files/)?\\d+",
"http://[\\w\\.]*?sharehoster\\.(de|com|net)/(dl|wait|vid)/[a-z0-9]+", "http://[\\w\\.]*?shareua.com/get_file/.*?/\\d+", "http://[\\w\\.]*?speedload\\.to/FILE[A-Z0-9]+", "http://(www\\.)?upfile\\.in/[a-z0-9]{12}", "http://[\\w\\.]*?ugotfile.com/file/\\d+/.+", "http://[\\w\\.]*?upload\\.ge/((\\?d|download\\.php\\?id)=[A-Z0-9]+|((en|ru|fr|es)/)?file/[0-9]+/)", "http://[\\w\\.]*?uploadmachine\\.com/(download\\.php\\?id=[0-9]+&type=[0-9]{1}|file/[0-9]+/)", "http://[\\w\\.]*?uploady\\.to/dl/((\\?d|download\\.php\\?id)=[A-Z0-9]+|((en|ru|fr|es)/)?file/[0-9]+/)", "http://(www\\.)?uploadstore\\.net/[a-z0-9]{12}", "http://[\\w\\.]*?vspace\\.cc/file/[A-Z0-9]+\\.html", "http://[\\w\\.]*?web-share\\.net/download/file/item/.*?_[0-9]+", "http://(www\\.)?yvh\\.cc/video\\.php\\?file=[a-z0-9_]+", "http://[\\w\\.]*?x-files\\.kz/[a-z0-9]+" }, flags = { 0 })
@HostPlugin(revision = "$Revision$", interfaceVersion = 3, names = { "xxlupload.com", "cumfox.com", "pyramidfiles.com", "nahraj.cz", "jsharer.com", "annonhost.net", "filekeeper.org", "dynyoo.com", "163pan.com", "imagehost.org", "4us.to", "yabadaba.ru", "madshare.com", "diglo.com", "tubeload.to", "tunabox.net", "yourfilehost.com", "uploadegg.com", "brsbox.com", "amateurboobtube.com", "good.net", "freeload.to", "netporn.nl", "przeklej.pl", "alldrives.ge", "allshares.ge", "holderfile.com", "megashare.vnn.vn", "link.ge", "up.jeje.ge", "up-4.com", "cloudcache", "ddlanime.com", "mountfile.com", "platinshare.com", "ishare.iask.sina.com.cn", "megavideo.com", "megaupload.com", "cum.com", "zshare.net", "uploading4u.com", "megafree.kz", "batubia.com", "upload24.net", "files.namba.kz", "datumbit.com", "fik1.com", "fileape.com", "filezzz.com", "imagewaste.com", "fyels.com", "gotupload.com",
"sharehub.com", "sharehut.com", "filesurf.ru", "openfile.ru", "letitfile.ru", "tab.net.ua", "uploadbox.com", "supashare.net", "usershare.net", "skipfile.com", "10upload.com", "x7.to", "multiupload.com", "uploadking.com", "uploadhere.com", "fileshaker.com", "vistaupload.com", "groovefile.com", "enterupload.com", "xshareware.com", "xun6.com", "yourupload.de", "youshare.eu", "mafiaupload.com", "addat.hu", "archiv.to", "bigupload.com", "biggerupload.com", "bitload.com", "bufiles.com", "cash-file.net", "combozip.com", "duckload.com", "exoshare.com", "file2upload.net", "filebase.to", "filebling.com", "filecrown.com", "filefrog.to", "filefront.com", "filehook.com", "filestage.to", "filezup.com", "fullshare.net", "gaiafile.com", "keepfile.com", "kewlshare.com", "lizshare.net", "loaded.it", "loadfiles.in", "megarapid.eu", "megashare.vn", "metahyper.com", "missupload.com",
"netstorer.com", "nextgenvidz.com", "piggyshare.com", "profitupload.com", "quickload.to", "quickyshare.com", "share.cx", "sharehoster.de", "shareua.com", "speedload.to", "upfile.in", "ugotfile.com", "upload.ge", "uploadmachine.com", "uploady.to", "uploadstore.net", "vspace.cc", "web-share.net", "yvh.cc", "x-files.kz" }, urls = { "https?://(www\\.)?xxlupload\\.com/[a-z0-9]{12}", "http://(www\\.)?cumfox\\.com/videos/.*?-\\d+\\.html", "http://(www\\.)?pyramidfiles\\.com/[a-z0-9]{12}", "http://(www\\.)?nahraj\\.cz/content/(view|download)/[a-z0-9]+\\-[a-z0-9]+\\-[a-z0-9]+\\-[a-z0-9]+\\-[a-z0-9]+", "http://(www\\.)?jsharer\\.com/download/[a-z0-9]+\\.htm", "https?://(www\\.)?annonhost\\.net/[a-z0-9]{12}", "http://(www\\.)?filekeeper\\.org/download/[0-9a-zA-Z]+/([\\(\\)0-9A-Za-z\\.\\-_% ]+|[/]+/[\\(\\)0-9A-Za-z\\.\\-_% ])", "http://(www\\.)?dynyoo\\.com/\\?goto=dl\\&id=[a-z0-9]{32}",
"http://[\\w\\.]*?163pan\\.com/files/[a-z0-9]+\\.html", "http://[\\w\\.]*?imagehost\\.org/(download/[0-9]+/.+|[0-9]+/.+)", "http://[\\w\\.]*?4us\\.to/download\\.php\\?id=[A-Z0-9]+", "http://[\\w\\.]*?yabadaba\\.ru/files/[0-9]+", "http://(www\\.)?madshare\\.com/(en/)?download/[a-zA-Z0-9]+/", "http://(www\\.)?diglo\\.com/download/[a-z0-9]+", "http://(www\\.)?tubeload\\.to/file(\\d+)?\\-.+", "http://(www\\.)?tunabox\\.net/files/[A-Za-z0-9]+\\.html", "http://[\\w\\.]*?yourfilehost\\.com/media\\.php\\?cat=.*?\\&file=.+", "https?://(www\\.)?uploadegg\\.com/[a-z0-9]{12}", "http://(www\\.)?brsbox\\.com/filebox/down/fc/[a-z0-9]{32}", "http://(www\\.)?amateurboobtube\\.com/videos/\\d+/.*?\\.html", "http://(www\\.)?good\\.net/.+", "http://(www\\.)*?(freeload|mcload)\\.to/(divx\\.php\\?file_id=|\\?Mod=Divx\\&Hash=)[a-z0-9]+", "http://(www\\.)?netporn\\.nl/watch/[a-z0-9]+/.{1}",
"http://(www\\.)?przeklej\\.pl/(d/\\w+/|\\d+|plik/)[^\\s]+", "http://(www\\.)?alldrives\\.ge/main/linkform\\.php\\?f=[a-z0-9]+", "http://(www\\.)?allshares\\.ge/(\\?d|download\\.php\\?id)=[A-Z0-9]+", "https?://(www\\.)?holderfile\\.com/[a-z0-9]{12}", "http://(www\\.)?megashare\\.vnn\\.vn/((\\?d|download\\.php\\?id)=[A-Z0-9]+|((en|ru|fr|es)/)?file/[0-9]+/)", "http://(www\\.)?link\\.ge/((\\?d|download\\.php\\?id)=[A-Z0-9]+|((en|ru|fr|es)/)?file/[0-9]+/)", "http://(www\\.)?up\\.jeje\\.ge//((\\?d|download\\.php\\?id)=[A-Z0-9]+|((en|ru|fr|es)/)?file/[0-9]+/)", "http://(www\\.)?up\\-4\\.com/(\\?d|download\\.php\\?id)=[A-Z0-9]+", "https?://(www\\.)?cloudcache\\.cc/[a-z0-9]{12}", "https?://(www\\.)?(ddlanime\\.com|ddlani\\.me)/[a-z0-9]{12}", "http://(www\\.)?mountfile\\.com/file/[a-z0-9]+/[a-z0-9]+", "http://(www\\.)?platinshare\\.com/files/[A-Za-z0-9]+",
"http://(www\\.)?ishare\\.iask\\.sina\\.com\\.cn/f/\\d+\\.html", "http://(www\\.)?megavideo\\.com/(.*?(v|d)=|v/)[a-zA-Z0-9]+", "http://(www\\.)?megaupload\\.com/.*?(\\?|&)d=[0-9A-Za-z]+", "http://(www\\.)?(cum|megaporn|megarotic|sexuploader)\\.com/(.*?v=|v/)[a-zA-Z0-9]+", "http://(www\\.)?zshare\\.net/(download|video|image|audio|flash)/.*", "http://(www\\.)?uploading4u\\.com/((\\?d|download\\.php\\?id)=[A-Z0-9]+|((en|ru|fr|es)/)?file/[0-9]+/)", "http://(www\\.)?megafree\\.kz/file\\d+", "http://(www\\.)?batubia\\.com/[a-z0-9]{12}", "http://(www\\.)?upload24\\.net/[a-z0-9]+\\.[a-z0-9]+", "http://(www\\.)?download\\.files\\.namba\\.kz/files/\\d+", "http://(www\\.)?datumbit\\.com/file/.*?/", "http://(www\\.)?fik1\\.com/[a-z0-9]{12}", "http://(www\\.)?fileape\\.com/(index\\.php\\?act=download\\&id=|dl/)\\w+", "http://(www\\.)?filezzz\\.com/download/[0-9]+/",
"http://(www\\.)?imagewaste\\.com/pictures/\\d+/.{1}", "http://(www\\.)?fyels\\.com/[A-Za-z0-9]+", "http://(www\\.)?gotupload\\.com/[a-z0-9]{12}", "http://(go.sharehub.com|sharehub.me|follow.to|kgt.com|krt.com)/.*", "http://(www\\.)?sharehut\\.com/[a-z0-9]{12}", "http://[\\w\\.]*?(filesurf|4ppl|files\\.youmama)\\.ru/[0-9]+", "http://[\\w\\.]*?openfile\\.ru/[0-9]+", "http://[\\w\\.]*?letitfile\\.(ru|com)/download/id\\d+", "http://[\\w\\.]*?tab\\.net\\.ua/sites/files/site_name\\..*?/id\\.\\d+/", "http://[\\w\\.]*?uploadbox\\.com/.*?files/[0-9a-zA-Z]+", "http://(www\\.)?supashare\\.net/[a-z0-9]{12}", "https?://(www\\.)?usershare\\.net/[a-z0-9]{12}", "http://(www\\.)?skipfile\\.com/[a-z0-9]{12}", "http://(www\\.)?10upload\\.com/[a-z0-9]{12}", "http://[\\w\\.]*?x7\\.to/(?!list)[a-zA-Z0-9]+(/(?!inList)[^/\r\n]+)?",
"http://(www\\.)?multiuploaddecrypted\\.com/([A-Z0-9]{2}_[A-Z0-9]+|[0-9A-Z]+)", "http://(www\\.)?uploadking\\.com/[A-Z0-9]+", "http://(www\\.)?uploadhere\\.com/[A-Z0-9]+", "http://[\\w\\.]*?fileshaker\\.com/.+", "http://(www\\.)?vistaupload\\.com/[a-z0-9]{12}", "https?://(www\\.)?groovefile\\.com/[a-z0-9]{12}", "http://[\\w\\.]*?enterupload\\.com/[a-z0-9]{12}", "http://[\\w\\.]*?xshareware\\.com/[\\w]+/.*", "http://[\\w\\.]*?xun6\\.(com|net)/file/[a-z0-9]+", "http://(www\\.)?yourupload\\.de/[a-z0-9]{12}", "http://(www\\.)?youshare\\.eu/[a-z0-9]{12}", "http://(www\\.)?mafiaupload\\.com/do\\.php\\?id=\\d+", "http://[\\w\\.]*?addat.hu/.+/.+", "http://(www\\.)?archiv\\.to/((\\?Module\\=Details\\&HashID\\=|GET/)FILE[A-Z0-9]+|view/divx/[a-z0-9]+)", "http://[\\w\\.]*?bigupload\\.com/(d=|files/)[A-Z0-9]+", "http://(www\\.)?biggerupload\\.com/[a-z0-9]{12}",
"http://(www\\.)?(bitload\\.com/(f|d)/\\d+/[a-z0-9]+|mystream\\.to/file-\\d+-[a-z0-9]+)", "https?://(www\\.)?bufiles\\.com/[a-z0-9]{12}", "http://(www\\.)?cash-file\\.(com|net)/[a-z0-9]{12}", "http://[\\w\\.]*?combozip\\.com/[a-z0-9]{12}", "http://[\\w\\.]*?(duckload\\.com|youload\\.to)/(download/[a-z0-9]+|(divx|play)/[A-Z0-9\\.-]+|[a-zA-Z0-9\\.]+)", "http://(www\\.)?exoshare\\.com/[a-z0-9]{12}", "http://[\\w\\.]*?file2upload\\.(net|com)/download/[0-9]+/", "http://[\\w\\.]*?filebase\\.to/(files|download)/\\d{1,}/.*", "http://[\\w\\.]*?filebling\\.com/[a-z0-9]{12}", "http://(www\\.)?filecrown\\.com/[a-z0-9]{12}", "http://[\\w\\.]*?filefrog\\.to/download/\\d+/[a-zA-Z0-9]+", "http://[\\w\\.]*?filefront\\.com/[0-9]+", "http://(www\\.)?filehook\\.com/[a-z0-9]{12}", "http://(www\\.)?filestage\\.to/watch/[a-z0-9]+/", "http://(www\\.)?(filezup|divxupfile)\\.com/[a-z0-9]{12}",
"http://[\\w\\.]*?fullshare\\.net/show/[a-z0-9]+/.+", "http://(www\\.)?gaiafile\\.com/[a-z0-9]{12}", "http://[\\w\\.]*?keepfile\\.com/[a-z0-9]{12}", "http://[\\w\\.]*?kewlshare\\.com/dl/[\\w]+/", "http://[\\w\\.]*?lizshare\\.net/[a-z0-9]{12}", "http://(www\\.)?loaded\\.it/(show/[a-z0-9]+/[A-Za-z0-9_\\-% \\.]+|(flash|divx)/[a-z0-9]+/)", "http://[\\w\\.]*?loadfiles\\.in/[a-z0-9]{12}", "(http://[\\w\\.]*?megarapid\\.eu/files/\\d+/.+)|(http://[\\w\\.]*?megarapid\\.eu/\\?e=403\\&m=captcha\\&file=\\d+/.+)", "http://[\\w\\.]*?(megashare\\.vn/(download\\.php\\?uid=[0-9]+\\&id=[0-9]+|dl\\.php/\\d+)|share\\.megaplus\\.vn/dl\\.php/\\d+)", "http://(www\\.)?metahyper\\.com/[a-z0-9]{12}", "http://[\\w\\.]*?missupload\\.com/[a-z0-9]{12}", "http://[\\w\\.]*?netstorer\\.com/[a-zA-Z0-9]+/.+", "http://[\\w\\.]*?nextgenvidz\\.com/view/\\d+", "http://(www\\.)?piggyshare\\.com/file/[a-z0-9]+",
"http://(www\\.)?profitupload\\.com/files/[A-Za-z0-9]+\\.html", "http://[\\w\\.]*?quickload\\.to/\\?Go=Player\\&HashID=FILE[A-Z0-9]+", "http://[\\w\\.]*?quickyshare\\.com/[a-z0-9]{12}", "http://[\\w\\.]*?share\\.cx/(files/)?\\d+", "http://[\\w\\.]*?sharehoster\\.(de|com|net)/(dl|wait|vid)/[a-z0-9]+", "http://[\\w\\.]*?shareua.com/get_file/.*?/\\d+", "http://[\\w\\.]*?speedload\\.to/FILE[A-Z0-9]+", "http://(www\\.)?upfile\\.in/[a-z0-9]{12}", "http://[\\w\\.]*?ugotfile.com/file/\\d+/.+", "http://[\\w\\.]*?upload\\.ge/((\\?d|download\\.php\\?id)=[A-Z0-9]+|((en|ru|fr|es)/)?file/[0-9]+/)", "http://[\\w\\.]*?uploadmachine\\.com/(download\\.php\\?id=[0-9]+&type=[0-9]{1}|file/[0-9]+/)", "http://[\\w\\.]*?uploady\\.to/dl/((\\?d|download\\.php\\?id)=[A-Z0-9]+|((en|ru|fr|es)/)?file/[0-9]+/)", "http://(www\\.)?uploadstore\\.net/[a-z0-9]{12}",
"http://[\\w\\.]*?vspace\\.cc/file/[A-Z0-9]+\\.html", "http://[\\w\\.]*?web-share\\.net/download/file/item/.*?_[0-9]+", "http://(www\\.)?yvh\\.cc/video\\.php\\?file=[a-z0-9_]+", "http://[\\w\\.]*?x-files\\.kz/[a-z0-9]+" }, flags = { 0 })
public class Offline extends PluginForHost {
public Offline(PluginWrapper wrapper) {

View File

@ -139,7 +139,7 @@ public class OneThousandEbCom extends PluginForHost {
setBrowserExclusive();
br.setFollowRedirects(true);
br.getPage(link.getDownloadURL());
if (br.getURL().contains("1000eb.com/exception_0.htm") || br.containsHTML("你要下载的文件已经不存在</span>")) { throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND); }
if (br.getURL().contains("1000eb.com/exception_") || br.containsHTML("你要下载的文件已经不存在</span>")) { throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND); }
String filename = br.getRegex("\" title=\"点击查看 ([^<>\"\\']+) 的访问统计\"").getMatch(0);
if (filename == null) {
filename = br.getRegex("\">文件名</div>[\t\n\r ]+<div class=\"infotext singlerow\" title=\"([^<>\"\\']+)\"").getMatch(0);

View File

@ -68,6 +68,60 @@ public class OronCom extends PluginForHost {
link.setUrlDownload(link.getDownloadURL().replaceAll("://.*\\.oron.com", "://oron.com"));
}
@Override
public AvailableStatus requestFileInformation(DownloadLink link) throws IOException, PluginException {
this.setBrowserExclusive();
br.getHeaders().put("User-Agent", ua);
br.setCookie("http://www.oron.com", "lang", "english");
br.getPage(link.getDownloadURL());
if (br.getHttpConnection().getResponseCode() == 404) {
logger.warning("Oron: Hoster server problems, or the hoster blocking JD.");
logger.warning("Oron: Please confirm in browser and report issues to JD developement team.");
throw new PluginException(LinkStatus.ERROR_FATAL);
}
doSomething();
if (new Regex(brbefore, Pattern.compile("(?i)(No such file with this filename|No such user exist|File( could)? Not( be)? Found|>This file has been blocked for TOS violation)", Pattern.CASE_INSENSITIVE)).matches()) {
String suggestedName;
if ((suggestedName = (String) link.getProperty("SUGGESTEDFINALFILENAME", (String) null)) != null) {
link.setName(suggestedName);
}
throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
}
// Not using brbefore as filename can be <!--commented out & cleanup
// removes comments.
String filename = br.getRegex("Filename: ?(<[\\w\"\\= ]+>)?([^\"<]+)").getMatch(1);
if (filename == null) filename = new Regex(brbefore, "div.*?Filename:.*?<.*?>(.*?)<").getMatch(0);
String filesize = new Regex(brbefore, "Size: (.*?)<").getMatch(0);
// Handling for links which can only be downloaded by premium users
if (brbefore.contains(ONLY4PREMIUMERROR0) || brbefore.contains(ONLY4PREMIUMERROR1)) {
// return AvailableStatus.UNCHECKABLE;
link.getLinkStatus().setStatusText(JDL.L("plugins.host.errormsg.only4premium", "Only downloadable for premium users!"));
}
// Prevention measures against hoster change ups.
// Allow null filesize, allows plugins to 'work longer'.
if (filesize == null) {
logger.warning("Oron: Filesize could not be found, continuing...");
logger.warning("Oron: Please report bug to developement team.");
}
// Set fail over filename when null.
if (filename == null) {
logger.warning("Oron: Filename could not be found, continuing with UID as temp filename.");
logger.warning("Oron: Please report bug to developement team.");
filename = new Regex(link.getDownloadURL(), "oron.com/(.+)").getMatch(0);
}
if (filename != null) link.setName(filename);
if (filesize != null) link.setDownloadSize(SizeFormatter.getSize(filesize));
if (br.containsHTML(MAINTENANCE)) {
link.getLinkStatus().setStatusText("Site maintenance");
return AvailableStatus.UNCHECKABLE;
}
if (br.containsHTML(SERVERERROR)) {
link.getLinkStatus().setStatusText("Server error");
return AvailableStatus.UNCHECKABLE;
}
return AvailableStatus.TRUE;
}
public void checkErrors(DownloadLink theLink) throws NumberFormatException, PluginException {
// Some waittimes...
if (brbefore.contains(MAINTENANCE)) { throw new PluginException(LinkStatus.ERROR_TEMPORARILY_UNAVAILABLE, "Site maintenance mode", 10 * 60 * 1000l); }
@ -84,7 +138,7 @@ public class OronCom extends PluginForHost {
if (tmpsec != null) seconds = Integer.parseInt(tmpsec);
int waittime = ((3600 * hours) + (60 * minutes) + seconds + 1) * 1000;
logger.info("Detected waittime #1, waiting " + waittime + "milliseconds");
throw new PluginException(LinkStatus.ERROR_IP_BLOCKED, null, waittime);
throw new PluginException(LinkStatus.ERROR_IP_BLOCKED, waittime);
}
if (brbefore.contains("You have reached the download-limit")) {
String tmphrs = new Regex(brbefore, "\\s+(\\d+)\\s+hours?").getMatch(0);
@ -125,7 +179,7 @@ public class OronCom extends PluginForHost {
if (br.containsHTML(SERVERERROR)) { throw new PluginException(LinkStatus.ERROR_TEMPORARILY_UNAVAILABLE, "Server error", 30 * 60 * 1000l); }
if (brbefore.contains(ONLY4PREMIUMERROR0) || brbefore.contains(ONLY4PREMIUMERROR1)) throw new PluginException(LinkStatus.ERROR_FATAL, JDL.L("plugins.host.errormsg.only4premium", "Only downloadable for premium users!"));
br.setFollowRedirects(true);
if (brbefore.contains("\"download1\"")) br.postPage(downloadLink.getDownloadURL(), "op=download1&usr_login=&id=" + new Regex(downloadLink.getDownloadURL(), COOKIE_HOST.replace("http://", "") + "/" + "([a-z0-9]{12})").getMatch(0) + "&fname=" + Encoding.urlEncode(downloadLink.getName()) + "&referer=&method_free=Free+Download");
if (brbefore.contains("\"download1\"")) br.postPage(downloadLink.getDownloadURL(), "op=download1&usr_login=&id=" + new Regex(downloadLink.getDownloadURL(), COOKIE_HOST.replace("http://", "") + "/" + "([a-z0-9]{12})").getMatch(0) + "&fname=" + Encoding.urlEncode(downloadLink.getName()) + "&referer=&method_free=+Regular+Download+");
long timeBefore = System.currentTimeMillis();
doSomething();
checkErrors(downloadLink);
@ -175,7 +229,7 @@ public class OronCom extends PluginForHost {
if (passCode != null) {
downloadLink.setProperty("pass", passCode);
}
String dllink = br.getRegex("height=\"[0-9]+\"><a href=\"(.*?)\"").getMatch(0);
String dllink = br.getRegex("\"(http://[a-zA-Z0-9]+\\.oron\\.com/[a-z0-9]+/[^<>\"/]*?)\"").getMatch(0);
if (dllink == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
dl = jd.plugins.BrowserAdapter.openDownload(br, downloadLink, dllink, false, 1);
if (!(dl.getConnection().isContentDisposition()) && dl.getConnection().getContentType() != null && !dl.getConnection().getContentType().contains("octet")) {
@ -241,7 +295,8 @@ public class OronCom extends PluginForHost {
return ai;
} else {
/*
* one day more as we want the account be valid on expire day too
* one day more as we want the account be valid on expire day
* too
*/
ai.setValidUntil(TimeFormatter.getMilliSeconds(expire, "dd MMMM yyyy", Locale.ENGLISH) + (24 * 60 * 60 * 1000l));
}
@ -467,60 +522,6 @@ public class OronCom extends PluginForHost {
if (!br.containsHTML("Premium Account expires")) nopremium = true;
}
@Override
public AvailableStatus requestFileInformation(DownloadLink link) throws IOException, PluginException {
this.setBrowserExclusive();
br.getHeaders().put("User-Agent", ua);
br.setCookie("http://www.oron.com", "lang", "english");
br.getPage(link.getDownloadURL());
if (br.getHttpConnection().getResponseCode() == 404) {
logger.warning("Oron: Hoster server problems, or the hoster blocking JD.");
logger.warning("Oron: Please confirm in browser and report issues to JD developement team.");
throw new PluginException(LinkStatus.ERROR_FATAL);
}
doSomething();
if (new Regex(brbefore, Pattern.compile("(?i)(No such file with this filename|No such user exist|File( could)? Not( be)? Found|>This file has been blocked for TOS violation)", Pattern.CASE_INSENSITIVE)).matches()) {
String suggestedName;
if ((suggestedName = (String) link.getProperty("SUGGESTEDFINALFILENAME", (String) null)) != null) {
link.setName(suggestedName);
}
throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
}
// Not using brbefore as filename can be <!--commented out & cleanup
// removes comments.
String filename = br.getRegex("Filename: ?(<[\\w\"\\= ]+>)?([^\"<]+)").getMatch(1);
if (filename == null) filename = new Regex(brbefore, "div.*?Filename:.*?<.*?>(.*?)<").getMatch(0);
String filesize = new Regex(brbefore, "Size: (.*?)<").getMatch(0);
// Handling for links which can only be downloaded by premium users
if (brbefore.contains(ONLY4PREMIUMERROR0) || brbefore.contains(ONLY4PREMIUMERROR1)) {
// return AvailableStatus.UNCHECKABLE;
link.getLinkStatus().setStatusText(JDL.L("plugins.host.errormsg.only4premium", "Only downloadable for premium users!"));
}
// Prevention measures against hoster change ups.
// Allow null filesize, allows plugins to 'work longer'.
if (filesize == null) {
logger.warning("Oron: Filesize could not be found, continuing...");
logger.warning("Oron: Please report bug to developement team.");
}
// Set fail over filename when null.
if (filename == null) {
logger.warning("Oron: Filename could not be found, continuing with UID as temp filename.");
logger.warning("Oron: Please report bug to developement team.");
filename = new Regex(link.getDownloadURL(), "oron.com/(.+)").getMatch(0);
}
if (filename != null) link.setName(filename);
if (filesize != null) link.setDownloadSize(SizeFormatter.getSize(filesize));
if (br.containsHTML(MAINTENANCE)) {
link.getLinkStatus().setStatusText("Site maintenance");
return AvailableStatus.UNCHECKABLE;
}
if (br.containsHTML(SERVERERROR)) {
link.getLinkStatus().setStatusText("Server error");
return AvailableStatus.UNCHECKABLE;
}
return AvailableStatus.TRUE;
}
@Override
public void reset() {
}

View File

@ -1,441 +0,0 @@
//jDownloader - Downloadmanager
//Copyright (C) 2011 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.hoster;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.SortedMap;
import java.util.TreeMap;
import jd.PluginWrapper;
import jd.nutils.encoding.Encoding;
import jd.parser.Regex;
import jd.parser.html.Form;
import jd.parser.html.HTMLParser;
import jd.plugins.DownloadLink;
import jd.plugins.DownloadLink.AvailableStatus;
import jd.plugins.HostPlugin;
import jd.plugins.LinkStatus;
import jd.plugins.Plugin;
import jd.plugins.PluginException;
import jd.plugins.PluginForHost;
import jd.utils.JDUtilities;
import org.appwork.utils.formatter.SizeFormatter;
@HostPlugin(revision = "$Revision$", interfaceVersion = 2, names = { "pyramidfiles.com" }, urls = { "http://(www\\.)?pyramidfiles\\.com/[a-z0-9]{12}" }, flags = { 0 })
public class PyramidFilesCom 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://pyramidfiles.com";
public boolean NOPREMIUM = false;
public PyramidFilesCom(PluginWrapper wrapper) {
super(wrapper);
// this.enablePremium(COOKIE_HOST + "/premium.html");
}
public void checkErrors(DownloadLink theLink, boolean checkAll, String passCode) throws NumberFormatException, PluginException {
if (checkAll) {
if (BRBEFORE.contains("<br><b>Password:</b> <input") || BRBEFORE.contains("<br><b>Passwort:</b> <input") || BRBEFORE.contains("Wrong password")) {
logger.warning("Wrong password, the entered password \"" + passCode + "\" is wrong, retrying...");
theLink.setProperty("pass", null);
throw new PluginException(LinkStatus.ERROR_RETRY);
}
if (BRBEFORE.contains("Wrong captcha")) {
logger.warning("Wrong captcha or wrong password!");
throw new PluginException(LinkStatus.ERROR_CAPTCHA);
}
if (BRBEFORE.contains("\">Skipped countdown<")) throw new PluginException(LinkStatus.ERROR_FATAL, "Fatal countdown error (countdown skipped)");
}
// Some waittimes...
if (BRBEFORE.contains("You have to wait")) {
int minutes = 0, seconds = 0, hours = 0;
String tmphrs = new Regex(BRBEFORE, "You have to wait.*?\\s+(\\d+)\\s+hours?").getMatch(0);
if (tmphrs != null) hours = Integer.parseInt(tmphrs);
String tmpmin = new Regex(BRBEFORE, "You have to wait.*?\\s+(\\d+)\\s+minutes?").getMatch(0);
if (tmpmin != null) minutes = Integer.parseInt(tmpmin);
String tmpsec = new Regex(BRBEFORE, "You have to wait.*?\\s+(\\d+)\\s+seconds?").getMatch(0);
if (tmpsec != null) seconds = Integer.parseInt(tmpsec);
int waittime = ((3600 * hours) + (60 * minutes) + seconds + 1) * 1000;
if (waittime != 0) {
logger.info("Detected waittime #1, waiting " + waittime + " milliseconds");
throw new PluginException(LinkStatus.ERROR_IP_BLOCKED, null, waittime);
} else {
logger.info("Waittime regexes seem to be broken");
throw new PluginException(LinkStatus.ERROR_IP_BLOCKED);
}
}
if (BRBEFORE.contains("You have reached the download-limit")) {
String tmphrs = new Regex(BRBEFORE, "\\s+(\\d+)\\s+hours?").getMatch(0);
String tmpmin = new Regex(BRBEFORE, "\\s+(\\d+)\\s+minutes?").getMatch(0);
String tmpsec = new Regex(BRBEFORE, "\\s+(\\d+)\\s+seconds?").getMatch(0);
String tmpdays = new Regex(BRBEFORE, "\\s+(\\d+)\\s+days?").getMatch(0);
if (tmphrs == null && tmpmin == null && tmpsec == null && tmpdays == null) {
throw new PluginException(LinkStatus.ERROR_IP_BLOCKED, null, 60 * 60 * 1000l);
} else {
int minutes = 0, seconds = 0, hours = 0, days = 0;
if (tmphrs != null) hours = Integer.parseInt(tmphrs);
if (tmpmin != null) minutes = Integer.parseInt(tmpmin);
if (tmpsec != null) seconds = Integer.parseInt(tmpsec);
if (tmpdays != null) days = Integer.parseInt(tmpdays);
int waittime = ((days * 24 * 3600) + (3600 * hours) + (60 * minutes) + seconds + 1) * 1000;
logger.info("Detected waittime #2, waiting " + waittime + "milliseconds");
throw new PluginException(LinkStatus.ERROR_IP_BLOCKED, null, waittime);
}
}
if (BRBEFORE.contains("You're using all download slots for IP")) { throw new PluginException(LinkStatus.ERROR_IP_BLOCKED, null, 10 * 60 * 1001l); }
if (BRBEFORE.contains("Error happened when generating Download Link")) throw new PluginException(LinkStatus.ERROR_TEMPORARILY_UNAVAILABLE, "Server error!", 10 * 60 * 1000l);
// Errorhandling for only-premium links
if (BRBEFORE.contains(" can download files up to ") || BRBEFORE.contains("Upgrade your account to download bigger files") || BRBEFORE.contains(">Upgrade your account to download larger files") || BRBEFORE.contains(">The file You requested reached max downloads limit for Free Users") || BRBEFORE.contains("Please Buy Premium To download this file<") || BRBEFORE.contains("This file reached max downloads limit")) {
String filesizelimit = new Regex(BRBEFORE, "You can download files up to(.*?)only").getMatch(0);
if (filesizelimit != null) {
filesizelimit = filesizelimit.trim();
logger.warning("As free user you can download files up to " + filesizelimit + " only");
throw new PluginException(LinkStatus.ERROR_FATAL, "Free users can only download files up to " + filesizelimit);
} else {
logger.warning("Only downloadable via premium");
throw new PluginException(LinkStatus.ERROR_FATAL, "Only downloadable via premium");
}
}
}
public void checkServerErrors() throws NumberFormatException, PluginException {
if (BRBEFORE.contains("No file")) throw new PluginException(LinkStatus.ERROR_FATAL, "Server error");
if (BRBEFORE.contains("File Not Found") || BRBEFORE.contains("<h1>404 Not Found</h1>")) {
logger.warning("Server says link offline, please recheck that!");
throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
}
}
private String decodeDownloadLink(String s) {
String decoded = null;
try {
Regex params = new Regex(s, "\\'(.*?[^\\\\])\\',(\\d+),(\\d+),\\'(.*?)\\'");
String p = params.getMatch(0).replaceAll("\\\\", "");
int a = Integer.parseInt(params.getMatch(1));
int c = Integer.parseInt(params.getMatch(2));
String[] k = params.getMatch(3).split("\\|");
while (c != 0) {
c--;
if (k[c].length() != 0) p = p.replaceAll("\\b" + Integer.toString(c, a) + "\\b", k[c]);
}
decoded = p;
} catch (Exception e) {
}
String finallink = null;
if (decoded != null) {
finallink = new Regex(decoded, "name=\"src\"value=\"(.*?)\"").getMatch(0);
if (finallink == null) {
finallink = new Regex(decoded, "type=\"video/divx\"src=\"(.*?)\"").getMatch(0);
if (finallink == null) finallink = new Regex(decoded, "s1\\.addVariable\\(\\'file\\',\\'(http://.*?)\\'\\)").getMatch(0);
}
}
return finallink;
}
public void doFree(DownloadLink downloadLink, boolean resumable, int maxchunks) throws Exception, PluginException {
String dllink = null;
String passCode = null;
if (BRBEFORE.contains("\"download1\"")) {
br.postPage(downloadLink.getDownloadURL(), "op=download1&usr_login=&id=" + new Regex(downloadLink.getDownloadURL(), COOKIE_HOST.replace("http://", "") + "/" + "([a-z0-9]{12})").getMatch(0) + "&fname=" + Encoding.urlEncode(downloadLink.getName()) + "&referer=&method_free=Free+Download");
doSomething();
}
checkErrors(downloadLink, false, passCode);
String md5hash = new Regex(BRBEFORE, "<b>MD5.*?</b>.*?nowrap>(.*?)<").getMatch(0);
if (md5hash != null) {
md5hash = md5hash.trim();
logger.info("Found md5hash: " + md5hash);
downloadLink.setMD5Hash(md5hash);
}
br.setFollowRedirects(false);
// Videolinks can already be found here, if a link is found here we can
// skip waittimes and captchas
dllink = getDllink();
if (dllink == null) {
Form DLForm = br.getFormbyProperty("name", "F1");
if (DLForm == null) {
if (BRBEFORE.contains("Easy way to share your files</Title>")) throw new PluginException(LinkStatus.ERROR_TEMPORARILY_UNAVAILABLE, "Server error", 10 * 60 * 1000l);
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
long timeBefore = System.currentTimeMillis();
boolean password = false;
if (BRBEFORE.contains(PASSWORDTEXT0) || BRBEFORE.contains(PASSWORDTEXT1)) {
password = true;
logger.info("The downloadlink seems to be password protected.");
}
boolean wait = true;
/* Captcha START */
if (BRBEFORE.contains(";background:#ccc;text-align")) {
logger.info("Detected captcha method \"plaintext captchas\" for this host");
// Captcha method by ManiacMansion
String[][] letters = new Regex(Encoding.htmlDecode(br.toString()), "<span style='position:absolute;padding-left:(\\d+)px;padding-top:\\d+px;'>(\\d)</span>").getMatches();
if (letters == null || letters.length == 0) {
logger.warning("plaintext captchahandling broken!");
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
SortedMap<Integer, String> capMap = new TreeMap<Integer, String>();
for (String[] letter : letters) {
capMap.put(Integer.parseInt(letter[0]), letter[1]);
}
StringBuilder code = new StringBuilder();
for (String value : capMap.values()) {
code.append(value);
}
DLForm.put("code", code.toString());
logger.info("Put captchacode " + code.toString() + " obtained by captcha metod \"plaintext captchas\" in the form.");
} else if (BRBEFORE.contains("/captchas/")) {
logger.info("Detected captcha method \"Standard captcha\" for this host");
String[] sitelinks = HTMLParser.getHttpLinks(br.toString(), null);
String captchaurl = null;
if (sitelinks == null || sitelinks.length == 0) {
logger.warning("Standard captcha captchahandling broken!");
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
for (String link : sitelinks) {
if (link.contains("/captchas/")) {
captchaurl = link;
break;
}
}
if (captchaurl == null) {
logger.warning("Standard captcha captchahandling broken!");
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
String code = getCaptchaCode(captchaurl, downloadLink);
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
logger.info("Detected captcha method \"Re Captcha\" for this host");
PluginForHost recplug = JDUtilities.getPluginForHost("DirectHTTP");
jd.plugins.hoster.DirectHTTP.Recaptcha rc = ((DirectHTTP) recplug).getReCaptcha(br);
String id = this.br.getRegex("\\?k=([A-Za-z0-9%_\\+\\- ]+)\"").getMatch(0);
rc.setId(id);
rc.setForm(DLForm);
rc.load();
File cf = rc.downloadCaptcha(getLocalCaptchaFile());
String c = getCaptchaCode(cf, downloadLink);
Form rcform = rc.getForm();
rcform.put("recaptcha_challenge_field", rc.getChallenge());
rcform.put("recaptcha_response_field", Encoding.urlEncode(c));
DLForm = rc.getForm();
logger.info("Put captchacode " + c + " obtained by captcha metod \"Re Captcha\" in the form and submitted it.");
}
/* Captcha END */
if (password) {
passCode = handlePassword(passCode, DLForm, downloadLink);
}
if (wait) waitTime(timeBefore, downloadLink);
br.submitForm(DLForm);
logger.info("Submitted DLForm");
doSomething();
checkErrors(downloadLink, true, passCode);
dllink = getDllink();
if (dllink == null) {
logger.warning("Final downloadlink (String is \"dllink\") regex didn't match!");
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
}
logger.info("Final downloadlink = " + dllink + " starting the download...");
dl = jd.plugins.BrowserAdapter.openDownload(br, downloadLink, dllink, resumable, maxchunks);
if (dl.getConnection().getContentType().contains("html")) {
logger.warning("The final dllink seems not to be a file!");
br.followConnection();
checkServerErrors();
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
if (passCode != null) {
downloadLink.setProperty("pass", passCode);
}
dl.startDownload();
}
// Removed fake messages which can kill the plugin
public void doSomething() throws NumberFormatException, PluginException {
BRBEFORE = br.toString();
ArrayList<String> someStuff = new ArrayList<String>();
ArrayList<String> regexStuff = new ArrayList<String>();
regexStuff.add("<\\!(\\-\\-.*?\\-\\-)>");
regexStuff.add("(display: none;\">.*?</div>)");
regexStuff.add("(visibility:hidden>.*?<)");
for (String aRegex : regexStuff) {
String lolz[] = br.getRegex(aRegex).getColumn(0);
if (lolz != null) {
for (String dingdang : lolz) {
someStuff.add(dingdang);
}
}
}
for (String fun : someStuff) {
BRBEFORE = BRBEFORE.replace(fun, "");
}
}
// XfileSharingProBasic Version 2.1.1.4, added 1 filesize regex, added 1 fnf
// message, deactivated waittime for reCaptcha handling
@Override
public String getAGBLink() {
return COOKIE_HOST + "/tos.html";
}
public String getDllink() {
String dllink = br.getRedirectLocation();
if (dllink == null) {
dllink = new Regex(BRBEFORE, "dotted #bbb;padding.*?<a href=\"(.*?)\"").getMatch(0);
if (dllink == null) {
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, "Download: <a href=\"(.*?)\"").getMatch(0);
if (dllink == null) {
String cryptedScripts[] = br.getRegex("p}\\((.*?)\\.split\\('\\|'\\)").getColumn(0);
if (cryptedScripts != null && cryptedScripts.length != 0) {
for (String crypted : cryptedScripts) {
dllink = decodeDownloadLink(crypted);
if (dllink != null) break;
}
}
}
}
}
}
return dllink;
}
@Override
public int getMaxSimultanFreeDownloadNum() {
return 1;
}
@Override
public void handleFree(DownloadLink downloadLink) throws Exception, PluginException {
requestFileInformation(downloadLink);
doFree(downloadLink, true, -2);
}
public String handlePassword(String passCode, Form pwform, DownloadLink thelink) throws IOException, PluginException {
if (thelink.getStringProperty("pass", null) == null) {
passCode = Plugin.getUserInput("Password?", thelink);
} else {
/* gespeicherten PassCode holen */
passCode = thelink.getStringProperty("pass", null);
}
pwform.put("password", passCode);
logger.info("Put password \"" + passCode + "\" entered by user in the DLForm.");
return passCode;
}
// do not add @Override here to keep 0.* compatibility
public boolean hasAutoCaptcha() {
return true;
}
// do not add @Override here to keep 0.* compatibility
public boolean hasCaptcha() {
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 (BRBEFORE.contains("No such file") || BRBEFORE.contains("No such user exist") || BRBEFORE.contains("File not found") || BRBEFORE.contains(">File Not Found<") || BRBEFORE.contains(">The file was removed by administrator<")) {
logger.warning("file is 99,99% offline, throwing \"file not found\" now...");
throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
}
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);
}
}
}
}
}
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 = new Regex(BRBEFORE, "Size: <font color=\"red\">\\((.*?)\\)</font>").getMatch(0);
}
}
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.setFinalFileName(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() {
}
@Override
public void resetDownloadlink(DownloadLink link) {
}
private void waitTime(long timeBefore, DownloadLink downloadLink) throws PluginException {
int passedTime = (int) ((System.currentTimeMillis() - timeBefore) / 1000) - 1;
// Ticket Time
String ttt = new Regex(BRBEFORE, "countdown\">.*?(\\d+).*?</span>").getMatch(0);
if (ttt == null) ttt = new Regex(BRBEFORE, "id=\"countdown_str\".*?<span id=\".*?\">.*?(\\d+).*?</span").getMatch(0);
if (ttt != null) {
int tt = Integer.parseInt(ttt);
tt -= passedTime;
logger.info("Waittime detected, waiting " + ttt + " - " + passedTime + " seconds from now on...");
if (tt > 0) sleep(tt * 1001l, downloadLink);
}
}
}

View File

@ -339,7 +339,7 @@ public class Q4ShareCom extends PluginForHost {
br.setCookie(COOKIE_HOST, "lang", "english");
br.getPage(link.getDownloadURL());
doSomething();
if (brbefore.contains("No such file") || brbefore.contains("No such user exist") || brbefore.contains("File not found")) {
if (brbefore.contains("The file you were looking for could not be found") || brbefore.contains("File Not Found")) {
logger.warning("file is 99,99% offline, throwing \"file not found\" now...");
throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
}

View File

@ -101,21 +101,9 @@ public class SendMyWayCom extends PluginForHost {
link.getLinkStatus().setStatusText(JDL.L("plugins.hoster.xfilesharingprobasic.undermaintenance", MAINTENANCEUSERTEXT));
return AvailableStatus.TRUE;
}
String filename = new Regex(correctedBR, "You have requested.*?https?://(www\\.)?" + COOKIE_HOST.replaceAll("https?://", "") + "/[a-z0-9]{12}/(.*?)</font>").getMatch(1);
String filename = new Regex(correctedBR, "<p class=\"file\\-name\" ><a href=\"http://(www\\.)?sendmyway\\.com/[a-z0-9]{12}\" style=\"text\\-decoration:none;color: #FFFFFF;\">([^<>\"]*?)</a></p>").getMatch(1);
if (filename == null) {
filename = new Regex(correctedBR, "fname\"( type=\"hidden\")? value=\"(.*?)\"").getMatch(1);
if (filename == null) {
filename = new Regex(correctedBR, "<h2>Download File(.*?)</h2>").getMatch(0);
if (filename == null) {
filename = new Regex(correctedBR, "Filename:</b></td><td[ ]{0,2}>(.*?)</td>").getMatch(0);
if (filename == null) {
filename = new Regex(correctedBR, "Filename.*?nowrap.*?>(.*?)</td").getMatch(0);
if (filename == null) {
filename = new Regex(correctedBR, "File Name.*?nowrap>(.*?)</td").getMatch(0);
}
}
}
}
filename = new Regex(correctedBR, "<b>share:</b>\\&nbsp;\\&nbsp;\\&nbsp;\\&nbsp;([^<>\"]*?)<br/>").getMatch(0);
}
String filesize = new Regex(correctedBR, "\\(([0-9]+ bytes)\\)").getMatch(0);
if (filesize == null) {
@ -581,7 +569,11 @@ public class SendMyWayCom extends PluginForHost {
br.getPage(COOKIE_HOST + "/?op=my_account");
doSomething();
if (!new Regex(correctedBR, "(Premium\\-Account expire|Upgrade to premium|>Renew premium<)").matches()) throw new PluginException(LinkStatus.ERROR_PREMIUM, PluginException.VALUE_ID_PREMIUM_DISABLE);
if (!new Regex(correctedBR, "(Premium\\-Account expire|>Renew premium<)").matches()) {account.setProperty("nopremium", true); } else { account.setProperty("nopremium", false); }
if (!new Regex(correctedBR, "(Premium\\-Account expire|>Renew premium<)").matches()) {
account.setProperty("nopremium", true);
} else {
account.setProperty("nopremium", false);
}
/** Save cookies */
final HashMap<String, String> cookies = new HashMap<String, String>();
final Cookies add = this.br.getCookies(COOKIE_HOST);

View File

@ -93,13 +93,14 @@ public class ShareUploadNet extends PluginForHost {
// Note that there are links which always show this error, must be a
// bug!
if (br.containsHTML("The allowed bandwidth assigned to your IP is used up")) throw new PluginException(LinkStatus.ERROR_IP_BLOCKED);
if (br.containsHTML("The allowed download sessions assigned to your IP is used up")) throw new PluginException(LinkStatus.ERROR_IP_BLOCKED, "Too many simultan dls", 5 * 60 * 1000l);
final String finalLink = findLink();
if (finalLink == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
int wait = 60;
final String waittime = br.getRegex("countdown\\((\\d+)\\);").getMatch(0);
if (waittime != null) wait = Integer.parseInt(waittime);
sleep(wait * 1001l, downloadLink);
dl = jd.plugins.BrowserAdapter.openDownload(br, downloadLink, finalLink, true, 1);
dl = jd.plugins.BrowserAdapter.openDownload(br, downloadLink, finalLink, false, 1);
if (dl.getConnection().getContentType().contains("html")) {
br.followConnection();
@ -139,7 +140,7 @@ public class ShareUploadNet extends PluginForHost {
@Override
public int getMaxSimultanFreeDownloadNum() {
return 1;
return -1;
}
}

View File

@ -1,101 +0,0 @@
// jDownloader - Downloadmanager
// Copyright (C) 2010 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.hoster;
import jd.PluginWrapper;
import jd.plugins.DownloadLink;
import jd.plugins.DownloadLink.AvailableStatus;
import jd.plugins.HostPlugin;
import jd.plugins.LinkStatus;
import jd.plugins.PluginException;
import jd.plugins.PluginForHost;
/**
* @author typek_pb
*/
@HostPlugin(revision = "$Revision$", interfaceVersion = 2, names = { "tangle.com" }, urls = { "http://[\\w\\.]*?tangle\\.com/view_video\\?viewkey=[a-zA-Z0-9]+" }, flags = { 0 })
public class TangleCom extends PluginForHost {
private String dlink = null;
public TangleCom(PluginWrapper wrapper) {
super(wrapper);
}
@Override
public String getAGBLink() {
return "http://www.tangle.com/support/legal";
}
@Override
public int getMaxSimultanFreeDownloadNum() {
return -1;
}
@Override
public void handleFree(DownloadLink link) throws Exception {
requestFileInformation(link);
if (dlink == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
dl = jd.plugins.BrowserAdapter.openDownload(br, link, dlink, true, 0);
if (dl.getConnection().getContentType().contains("html")) {
dl.getConnection().disconnect();
throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
}
dl.startDownload();
}
@Override
public AvailableStatus requestFileInformation(DownloadLink link) throws Exception {
br.getPage(link.getDownloadURL());
String filename = br.getRegex("<title>(.*?) - posted by .*? - tangle.com</title>").getMatch(0);
if (null == filename || filename.trim().length() == 0) throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
String descLink = br.getRegex("flashvars.playlistPath = '(.*?)'").getMatch(0);
if (null == descLink || descLink.trim().length() == 0) throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
br.getPage(descLink);
dlink = br.getRegex("<filelocation>(.*?)</filelocation>").getMatch(0);
if (null == dlink || dlink.trim().length() == 0) throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
filename = filename.trim();
link.setFinalFileName(filename + ".flv");
br.setFollowRedirects(true);
try {
if (!br.openGetConnection(dlink).getContentType().contains("html")) {
link.setDownloadSize(br.getHttpConnection().getLongContentLength());
br.getHttpConnection().disconnect();
return AvailableStatus.TRUE;
}
} finally {
if (br.getHttpConnection() != null) br.getHttpConnection().disconnect();
}
throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
}
@Override
public void reset() {
}
@Override
public void resetDownloadlink(DownloadLink link) {
}
@Override
public void resetPluginGlobals() {
}
}

View File

@ -75,7 +75,8 @@ public class VimeoCom extends PluginForHost {
try {
if (ret != null && ret.size() > 0) {
/*
* we make sure only one result is in ret, thats the case for svn/next major version
* we make sure only one result is in ret, thats the case for
* svn/next major version
*/
DownloadLink sourceLink = ret.get(0);
String ID = new Regex(sourceLink.getDownloadURL(), ".com/(\\d+)").getMatch(0);
@ -89,7 +90,8 @@ public class VimeoCom extends PluginForHost {
if (title == null) title = br.getRegex("<meta property=\"og:title\" content=\"([^<>\"]*?)\">").getMatch(0);
if (br.containsHTML("iconify_down_b")) {
/*
* little pause needed so the next call does not return trash
* little pause needed so the next call does not return
* trash
*/
Thread.sleep(1000);
br.getHeaders().put("X-Requested-With", "XMLHttpRequest");
@ -160,7 +162,8 @@ public class VimeoCom extends PluginForHost {
}
}
/*
* only replace original found links by new ones, when we have some
* only replace original found links by new ones,
* when we have some
*/
if (fp != null) {
fp.addLinks(newRet);
@ -197,7 +200,8 @@ public class VimeoCom extends PluginForHost {
br.followConnection();
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
// Set the final filename here because downloads via account have other extensions
// Set the final filename here because downloads via account have other
// extensions
downloadLink.setFinalFileName(downloadLink.getName());
downloadLink.setProperty("LASTTYPE", "FREE");
dl.startDownload();

View File

@ -44,13 +44,14 @@ public class XHamsterCom extends PluginForHost {
String dllink = null;
String server = br.getRegex("\\'srv\\': \\'(.*?)\\'").getMatch(0);
String file = br.getRegex("\\'file\\': \\'(.*?)\\'").getMatch(0);
if (server != null && file != null) {
if (server == null || file == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
if (file.startsWith("http")) {
// Examplelink (ID): 968106
dllink = file;
} else {
// Examplelink (ID): 986043
dllink = server + "/key=" + file;
} else {
dllink = file;
}
if (dllink == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
return Encoding.htmlDecode(dllink);
}

View File

@ -1,458 +0,0 @@
// jDownloader - Downloadmanager
// Copyright (C) 2012 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.hoster;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.SortedMap;
import java.util.TreeMap;
import java.util.regex.Pattern;
import jd.PluginWrapper;
import jd.config.Property;
import jd.http.Browser;
import jd.http.URLConnectionAdapter;
import jd.nutils.encoding.Encoding;
import jd.parser.Regex;
import jd.parser.html.Form;
import jd.parser.html.HTMLParser;
import jd.plugins.DownloadLink;
import jd.plugins.DownloadLink.AvailableStatus;
import jd.plugins.HostPlugin;
import jd.plugins.LinkStatus;
import jd.plugins.Plugin;
import jd.plugins.PluginException;
import jd.plugins.PluginForHost;
import jd.utils.JDUtilities;
import jd.utils.locale.JDL;
import org.appwork.utils.formatter.SizeFormatter;
@HostPlugin(revision = "$Revision$", interfaceVersion = 2, names = { "xxlupload.com" }, urls = { "https?://(www\\.)?xxlupload\\.com/[a-z0-9]{12}" }, flags = { 0 })
public class XxlUploadCom extends PluginForHost {
private String correctedBR = "";
private static final String PASSWORDTEXT = "(<br><b>Password:</b> <input|<br><b>Passwort:</b> <input)";
private static final String COOKIE_HOST = "http://xxlupload.com";
private static final String MAINTENANCE = ">This server is in maintenance mode";
private static final String MAINTENANCEUSERTEXT = "This server is under Maintenance";
private static final String ALLWAIT_SHORT = "Waiting till new downloads can be started";
// DEV NOTES
// XfileSharingProBasic Version 2.5.2.4
// mods: null
// free: 20 chunks * 5
// premium:
// protocol: no https
// captchatype: null
// other: httpd redirects ://xxlupload > ://www.xxlupload
@Override
public void correctDownloadLink(DownloadLink link) {
link.setUrlDownload(link.getDownloadURL().replace("https://", "http://").replace("://xxlupload", "://www.xxlupload"));
}
@Override
public String getAGBLink() {
return COOKIE_HOST + "/tos.html";
}
public XxlUploadCom(PluginWrapper wrapper) {
super(wrapper);
// this.enablePremium(COOKIE_HOST + "/premium.html");
}
// do not add @Override here to keep 0.* compatibility
public boolean hasAutoCaptcha() {
return true;
}
// do not add @Override here to keep 0.* compatibility
public boolean hasCaptcha() {
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 (new Regex(correctedBR, Pattern.compile("(No such file|>File Not Found<|>The file was removed by|Reason (of|for) deletion:\n)", Pattern.CASE_INSENSITIVE)).matches()) throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
if (correctedBR.contains(MAINTENANCE)) {
link.getLinkStatus().setStatusText(JDL.L("plugins.hoster.xfilesharingprobasic.undermaintenance", MAINTENANCEUSERTEXT));
return AvailableStatus.TRUE;
}
String filename = new Regex(correctedBR, "You have requested.*?https?://(www\\.)?" + COOKIE_HOST.replaceAll("https?://", "") + "/[A-Za-z0-9]{12}/(.*?)</font>").getMatch(1);
if (filename == null) {
filename = new Regex(correctedBR, "fname\"( type=\"hidden\")? value=\"(.*?)\"").getMatch(1);
if (filename == null) {
filename = new Regex(correctedBR, "<h2>Download File(.*?)</h2>").getMatch(0);
if (filename == null) {
filename = new Regex(correctedBR, "(?i)(File)?name ?:? ?(<[^>]+> ?)+?([^<>\"\\']+)").getMatch(2);
}
}
}
String filesize = new Regex(correctedBR, "\\(([0-9]+ bytes)\\)").getMatch(0);
if (filesize == null) {
filesize = new Regex(correctedBR, "</font>[ ]+\\(([^<>\"\\'/]+)\\)(.*?)</font>").getMatch(0);
if (filesize == null) {
filesize = new Regex(correctedBR, "(?i)([\\d\\.]+ ?(GB|MB))").getMatch(0);
}
}
if (filename == null || filename.equals("")) {
if (correctedBR.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.setFinalFileName(filename.trim());
if (filesize != null && !filesize.equals("")) link.setDownloadSize(SizeFormatter.getSize(filesize));
return AvailableStatus.TRUE;
}
@Override
public void handleFree(DownloadLink downloadLink) throws Exception, PluginException {
requestFileInformation(downloadLink);
doFree(downloadLink, true, 0, true);
}
public void doFree(DownloadLink downloadLink, boolean resumable, int maxchunks, boolean getLinkWithoutLogin) throws Exception, PluginException {
String passCode = null;
String md5hash = new Regex(correctedBR, "<b>MD5.*?</b>.*?nowrap>(.*?)<").getMatch(0);
if (md5hash != null) {
md5hash = md5hash.trim();
logger.info("Found md5hash: " + md5hash);
downloadLink.setMD5Hash(md5hash);
}
String dllink = null;
if (getLinkWithoutLogin)
dllink = downloadLink.getStringProperty("freelink");
else
dllink = downloadLink.getStringProperty("freelink2");
if (dllink != null) {
try {
Browser br2 = br.cloneBrowser();
URLConnectionAdapter con = br2.openGetConnection(dllink);
if (con.getContentType().contains("html") || con.getLongContentLength() == -1) {
if (getLinkWithoutLogin)
downloadLink.setProperty("freelink", Property.NULL);
else
downloadLink.setProperty("freelink2", Property.NULL);
dllink = null;
}
con.disconnect();
} catch (Exception e) {
if (getLinkWithoutLogin)
downloadLink.setProperty("freelink", Property.NULL);
else
downloadLink.setProperty("freelink2", Property.NULL);
dllink = null;
}
}
/**
* Video links can already be found here, if a link is found here we can
* skip wait times and captchas
*/
if (dllink == null) {
checkErrors(downloadLink, false, passCode);
if (correctedBR.contains("\"download1\"")) {
br.postPage(downloadLink.getDownloadURL(), "op=download1&usr_login=&id=" + new Regex(downloadLink.getDownloadURL(), COOKIE_HOST.replaceAll("https?://", "") + "/" + "([A-Za-z0-9]{12})").getMatch(0) + "&fname=" + Encoding.urlEncode(downloadLink.getName()) + "&referer=&method_free=Free+Download");
doSomething();
checkErrors(downloadLink, false, passCode);
}
dllink = getDllink();
}
if (dllink == null) {
Form dlForm = br.getFormbyProperty("name", "F1");
if (dlForm == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
dlForm.remove(null);
final long timeBefore = System.currentTimeMillis();
boolean password = false;
boolean skipWaittime = false;
if (new Regex(correctedBR, PASSWORDTEXT).matches()) {
password = true;
logger.info("The downloadlink seems to be password protected.");
}
/* Captcha START */
if (correctedBR.contains(";background:#ccc;text-align")) {
logger.info("Detected captcha method \"plaintext captchas\" for this host");
/** Captcha method by ManiacMansion */
String[][] letters = new Regex(Encoding.htmlDecode(br.toString()), "<span style=\\'position:absolute;padding\\-left:(\\d+)px;padding\\-top:\\d+px;\\'>(\\d)</span>").getMatches();
if (letters == null || letters.length == 0) {
logger.warning("plaintext captchahandling broken!");
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
SortedMap<Integer, String> capMap = new TreeMap<Integer, String>();
for (String[] letter : letters) {
capMap.put(Integer.parseInt(letter[0]), letter[1]);
}
StringBuilder code = new StringBuilder();
for (String value : capMap.values()) {
code.append(value);
}
dlForm.put("code", code.toString());
logger.info("Put captchacode " + code.toString() + " obtained by captcha metod \"plaintext captchas\" in the form.");
} else if (correctedBR.contains("/captchas/")) {
logger.info("Detected captcha method \"Standard captcha\" for this host");
String[] sitelinks = HTMLParser.getHttpLinks(br.toString(), null);
String captchaurl = null;
if (sitelinks == null || sitelinks.length == 0) {
logger.warning("Standard captcha captchahandling broken!");
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
for (String link : sitelinks) {
if (link.contains("/captchas/")) {
captchaurl = link;
break;
}
}
if (captchaurl == null) {
logger.warning("Standard captcha captchahandling broken!");
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
String code = getCaptchaCode("xfilesharingprobasic", captchaurl, downloadLink);
dlForm.put("code", code);
logger.info("Put captchacode " + code + " obtained by captcha metod \"Standard captcha\" in the form.");
} else if (new Regex(correctedBR, "(api\\.recaptcha\\.net|google\\.com/recaptcha/api/)").matches()) {
logger.info("Detected captcha method \"Re Captcha\" for this host");
PluginForHost recplug = JDUtilities.getPluginForHost("DirectHTTP");
jd.plugins.hoster.DirectHTTP.Recaptcha rc = ((DirectHTTP) recplug).getReCaptcha(br);
rc.setForm(dlForm);
String id = this.br.getRegex("\\?k=([A-Za-z0-9%_\\+\\- ]+)\"").getMatch(0);
rc.setId(id);
rc.load();
File cf = rc.downloadCaptcha(getLocalCaptchaFile());
String c = getCaptchaCode(cf, downloadLink);
Form rcform = rc.getForm();
rcform.put("recaptcha_challenge_field", rc.getChallenge());
rcform.put("recaptcha_response_field", Encoding.urlEncode(c));
logger.info("Put captchacode " + c + " obtained by captcha metod \"Re Captcha\" in the form and submitted it.");
dlForm = rc.getForm();
/** wait time is often skippable for reCaptcha handling */
// skipWaittime = true;
}
/* Captcha END */
if (password) passCode = handlePassword(passCode, dlForm, downloadLink);
if (!skipWaittime) waitTime(timeBefore, downloadLink);
br.submitForm(dlForm);
logger.info("Submitted DLForm");
doSomething();
checkErrors(downloadLink, true, passCode);
dllink = getDllink();
if (dllink == null) {
logger.warning("Final downloadlink (String is \"dllink\") regex didn't match!");
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
}
logger.info("Final downloadlink = " + dllink + " starting the download...");
dl = jd.plugins.BrowserAdapter.openDownload(br, downloadLink, dllink, resumable, maxchunks);
if (dl.getConnection().getContentType().contains("html")) {
logger.warning("The final dllink seems not to be a file!");
br.followConnection();
doSomething();
checkServerErrors();
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
if (getLinkWithoutLogin)
downloadLink.setProperty("freelink", dllink);
else
downloadLink.setProperty("freelink2", dllink);
if (passCode != null) downloadLink.setProperty("pass", passCode);
dl.startDownload();
}
@Override
public int getMaxSimultanFreeDownloadNum() {
return 5;
}
/** This removes fake messages which can kill the plugin */
public void doSomething() throws NumberFormatException, PluginException {
correctedBR = br.toString();
ArrayList<String> someStuff = new ArrayList<String>();
ArrayList<String> regexStuff = new ArrayList<String>();
regexStuff.add("<\\!(\\-\\-.*?\\-\\-)>");
regexStuff.add("(display: none;\">.*?</div>)");
regexStuff.add("(visibility:hidden>.*?<)");
for (String aRegex : regexStuff) {
String lolz[] = br.getRegex(aRegex).getColumn(0);
if (lolz != null) {
for (String dingdang : lolz) {
someStuff.add(dingdang);
}
}
}
for (String fun : someStuff) {
correctedBR = correctedBR.replace(fun, "");
}
}
public String getDllink() {
String dllink = br.getRedirectLocation();
if (dllink == null) {
dllink = new Regex(correctedBR, "dotted #bbb;padding.*?<a href=\"(.*?)\"").getMatch(0);
if (dllink == null) {
dllink = new Regex(correctedBR, "This (direct link|download link) will be available for your IP.*?href=\"(http.*?)\"").getMatch(1);
if (dllink == null) {
dllink = new Regex(correctedBR, "Download: <a href=\"(.*?)\"").getMatch(0);
if (dllink == null) {
String cryptedScripts[] = br.getRegex("p\\}\\((.*?)\\.split\\('\\|'\\)").getColumn(0);
if (cryptedScripts != null && cryptedScripts.length != 0) {
for (String crypted : cryptedScripts) {
dllink = decodeDownloadLink(crypted);
if (dllink != null) break;
}
}
}
}
}
}
return dllink;
}
public void checkErrors(DownloadLink theLink, boolean checkAll, String passCode) throws NumberFormatException, PluginException {
if (checkAll) {
if (new Regex(correctedBR, PASSWORDTEXT).matches() || correctedBR.contains("Wrong password")) {
logger.warning("Wrong password, the entered password \"" + passCode + "\" is wrong, retrying...");
throw new PluginException(LinkStatus.ERROR_RETRY, "Wrong password entered");
}
if (correctedBR.contains("Wrong captcha")) {
logger.warning("Wrong captcha or wrong password!");
throw new PluginException(LinkStatus.ERROR_CAPTCHA);
}
if (correctedBR.contains("\">Skipped countdown<")) throw new PluginException(LinkStatus.ERROR_FATAL, "Fatal countdown error (countdown skipped)");
}
/** Wait time reconnect handling */
if (new Regex(correctedBR, "(You have reached the download\\-limit|You have to wait)").matches()) {
String tmphrs = new Regex(correctedBR, "\\s+(\\d+)\\s+hours?").getMatch(0);
if (tmphrs == null) tmphrs = new Regex(correctedBR, "You have to wait.*?\\s+(\\d+)\\s+hours?").getMatch(0);
String tmpmin = new Regex(correctedBR, "\\s+(\\d+)\\s+minutes?").getMatch(0);
if (tmpmin == null) tmpmin = new Regex(correctedBR, "You have to wait.*?\\s+(\\d+)\\s+minutes?").getMatch(0);
String tmpsec = new Regex(correctedBR, "\\s+(\\d+)\\s+seconds?").getMatch(0);
String tmpdays = new Regex(correctedBR, "\\s+(\\d+)\\s+days?").getMatch(0);
if (tmphrs == null && tmpmin == null && tmpsec == null && tmpdays == null) {
logger.info("Waittime regexes seem to be broken");
throw new PluginException(LinkStatus.ERROR_IP_BLOCKED, null, 60 * 60 * 1000l);
} else {
int minutes = 0, seconds = 0, hours = 0, days = 0;
if (tmphrs != null) hours = Integer.parseInt(tmphrs);
if (tmpmin != null) minutes = Integer.parseInt(tmpmin);
if (tmpsec != null) seconds = Integer.parseInt(tmpsec);
if (tmpdays != null) days = Integer.parseInt(tmpdays);
int waittime = ((days * 24 * 3600) + (3600 * hours) + (60 * minutes) + seconds + 1) * 1000;
logger.info("Detected waittime #2, waiting " + waittime + "milliseconds");
/** Not enough wait time to reconnect->Wait and try again */
if (waittime < 180000) { throw new PluginException(LinkStatus.ERROR_HOSTER_TEMPORARILY_UNAVAILABLE, JDL.L("plugins.hoster.xfilesharingprobasic.allwait", ALLWAIT_SHORT), waittime); }
throw new PluginException(LinkStatus.ERROR_IP_BLOCKED, null, waittime);
}
}
if (correctedBR.contains("You're using all download slots for IP")) { throw new PluginException(LinkStatus.ERROR_IP_BLOCKED, null, 10 * 60 * 1001l); }
if (correctedBR.contains("Error happened when generating Download Link")) throw new PluginException(LinkStatus.ERROR_TEMPORARILY_UNAVAILABLE, "Server error!", 10 * 60 * 1000l);
/** Error handling for only-premium links */
if (new Regex(correctedBR, "( can download files up to |Upgrade your account to download bigger files|>Upgrade your account to download larger files|>The file You requested reached max downloads limit for Free Users|Please Buy Premium To download this file<|This file reached max downloads limit)").matches()) {
String filesizelimit = new Regex(correctedBR, "You can download files up to(.*?)only").getMatch(0);
if (filesizelimit != null) {
filesizelimit = filesizelimit.trim();
logger.warning("As free user you can download files up to " + filesizelimit + " only");
throw new PluginException(LinkStatus.ERROR_FATAL, "Free users can only download files up to " + filesizelimit);
} else {
logger.warning("Only downloadable via premium");
throw new PluginException(LinkStatus.ERROR_FATAL, "Only downloadable via premium or registered");
}
}
if (correctedBR.contains(MAINTENANCE)) throw new PluginException(LinkStatus.ERROR_TEMPORARILY_UNAVAILABLE, JDL.L("plugins.hoster.xfilesharingprobasic.undermaintenance", MAINTENANCEUSERTEXT), 2 * 60 * 60 * 1000l);
}
public void checkServerErrors() throws NumberFormatException, PluginException {
if (new Regex(correctedBR, Pattern.compile("No file", Pattern.CASE_INSENSITIVE)).matches()) throw new PluginException(LinkStatus.ERROR_FATAL, "Server error");
if (new Regex(correctedBR, "(File Not Found|<h1>404 Not Found</h1>)").matches()) {
logger.warning("Server says link offline, please recheck that!");
throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
}
}
private String decodeDownloadLink(String s) {
String decoded = null;
try {
Regex params = new Regex(s, "\\'(.*?[^\\\\])\\',(\\d+),(\\d+),\\'(.*?)\\'");
String p = params.getMatch(0).replaceAll("\\\\", "");
int a = Integer.parseInt(params.getMatch(1));
int c = Integer.parseInt(params.getMatch(2));
String[] k = params.getMatch(3).split("\\|");
while (c != 0) {
c--;
if (k[c].length() != 0) p = p.replaceAll("\\b" + Integer.toString(c, a) + "\\b", k[c]);
}
decoded = p;
} catch (Exception e) {
}
String finallink = null;
if (decoded != null) {
finallink = new Regex(decoded, "name=\"src\"value=\"(.*?)\"").getMatch(0);
if (finallink == null) {
finallink = new Regex(decoded, "type=\"video/divx\"src=\"(.*?)\"").getMatch(0);
if (finallink == null) {
finallink = new Regex(decoded, "\\.addVariable\\(\\'file\\',\\'(http://.*?)\\'\\)").getMatch(0);
}
}
}
return finallink;
}
public String handlePassword(String passCode, Form pwform, DownloadLink thelink) throws IOException, PluginException {
passCode = thelink.getStringProperty("pass", null);
if (passCode == null) passCode = Plugin.getUserInput("Password?", thelink);
pwform.put("password", passCode);
logger.info("Put password \"" + passCode + "\" entered by user in the DLForm.");
return Encoding.urlEncode(passCode);
}
@Override
public void reset() {
}
@Override
public void resetDownloadlink(DownloadLink link) {
}
private void waitTime(long timeBefore, DownloadLink downloadLink) throws PluginException {
int passedTime = (int) ((System.currentTimeMillis() - timeBefore) / 1000) - 1;
/** Ticket Time */
final String ttt = new Regex(correctedBR, "id=\"countdown_str\">[^<>\"]+<span id=\"[^<>\"]+\"( class=\"[^<>\"]+\")?>([\n ]+)?(\\d+)([\n ]+)?</span>").getMatch(2);
if (ttt != null) {
int tt = Integer.parseInt(ttt);
tt -= passedTime;
logger.info("Waittime detected, waiting " + ttt + " - " + passedTime + " seconds from now on...");
if (tt > 0) sleep(tt * 1000l, downloadLink);
}
}
}