mirror of
https://github.com/mirror/jdownloader.git
synced 2025-02-18 19:32:36 +00:00
-Changed pastebin errorhandling fixes #5098
-Deleted the przeklej.pl plugins, hoster doesn't exist anymore closes #2877 -Added support for filedwon closes #5032 git-svn-id: svn://svn.jdownloader.org/jdownloader/trunk@17219 ebf7c1c2-ba36-0410-9fe8-c592906822b4
This commit is contained in:
parent
985595343c
commit
93981b8bc5
@ -788,4 +788,6 @@ jd/plugins/hoster/MegaShareVnnVn.class
|
||||
jd/plugins/hoster/HolderFileCom.class
|
||||
jd/plugins/decrypter/NwsrlD.class
|
||||
jd/plugins/hoster/AllSharesGe.class
|
||||
jd/plugins/hoster/AllDrivesGe.class
|
||||
jd/plugins/hoster/AllDrivesGe.class
|
||||
jd/plugins/hoster/PrzeklejPl.class
|
||||
jd/plugins/decrypter/PrzeklejPlFolder.class
|
@ -50,7 +50,10 @@ public class PasteBinCom extends PluginForDecrypt {
|
||||
if (plaintxt == null) return null;
|
||||
// Find all those links
|
||||
String[] links = HTMLParser.getHttpLinks(plaintxt, "");
|
||||
if (links == null || links.length == 0) return null;
|
||||
if (links == null || links.length == 0) {
|
||||
logger.info("Found no links in link: " + parameter);
|
||||
return decryptedLinks;
|
||||
}
|
||||
logger.info("Found " + links.length + " links in total.");
|
||||
for (String dl : links)
|
||||
if (!dl.contains(parameter) && !new Regex(dl, "http://(www\\.)?pastebin\\.com/(raw.*?=)?[0-9A-Za-z]+").matches()) decryptedLinks.add(createDownloadlink(dl));
|
||||
|
@ -1,54 +0,0 @@
|
||||
// jDownloader - Downloadmanager
|
||||
// Copyright (C) 2009 JD-Team support@jdownloader.org
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
package jd.plugins.decrypter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import jd.PluginWrapper;
|
||||
import jd.controlling.ProgressController;
|
||||
import jd.parser.Regex;
|
||||
import jd.plugins.CryptedLink;
|
||||
import jd.plugins.DecrypterException;
|
||||
import jd.plugins.DecrypterPlugin;
|
||||
import jd.plugins.DownloadLink;
|
||||
import jd.plugins.FilePackage;
|
||||
import jd.plugins.PluginForDecrypt;
|
||||
import jd.utils.locale.JDL;
|
||||
|
||||
@DecrypterPlugin(revision = "$Revision$", interfaceVersion = 2, names = { "przeklej.pl" }, urls = { "http://[\\w\\.]*?przeklej\\.pl/folder/.*?-\\d+" }, flags = { 0 })
|
||||
public class PrzeklejPlFolder extends PluginForDecrypt {
|
||||
|
||||
public PrzeklejPlFolder(PluginWrapper wrapper) {
|
||||
super(wrapper);
|
||||
}
|
||||
|
||||
public ArrayList<DownloadLink> decryptIt(CryptedLink param, ProgressController progress) throws Exception {
|
||||
ArrayList<DownloadLink> decryptedLinks = new ArrayList<DownloadLink>();
|
||||
String parameter = param.toString();
|
||||
br.getPage(parameter);
|
||||
if (br.containsHTML("Folder nie istnieje\\!")) throw new DecrypterException(JDL.L("plugins.decrypt.errormsg.unavailable", "Perhaps wrong URL or the download is not available anymore."));
|
||||
String[] links = br.getRegex("<input class=\"txt\" type=\"text\" value=\"(.*?)\"").getColumn(0);
|
||||
if (links == null || links.length == 0) links = br.getRegex("\"(http://www\\.przeklej\\.pl/plik/.*?)\"").getColumn(0);
|
||||
if (links == null || links.length == 0) return null;
|
||||
for (String dl : links)
|
||||
if (!this.canHandle(dl)) decryptedLinks.add(createDownloadlink(dl));
|
||||
FilePackage fp = FilePackage.getInstance();
|
||||
fp.setName(new Regex(parameter, "przeklej\\.pl/folder/(.*?)-\\d+").getMatch(0));
|
||||
fp.addLinks(decryptedLinks);
|
||||
return decryptedLinks;
|
||||
}
|
||||
}
|
521
src/jd/plugins/hoster/FileDwonCom.java
Normal file
521
src/jd/plugins/hoster/FileDwonCom.java
Normal file
@ -0,0 +1,521 @@
|
||||
//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.concurrent.atomic.AtomicInteger;
|
||||
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 = { "filedwon.com" }, urls = { "https?://(www\\.)?filedwon\\.com/[a-z0-9]{12}" }, flags = { 0 })
|
||||
public class FileDwonCom extends PluginForHost {
|
||||
|
||||
private String correctedBR = "";
|
||||
private static final String PASSWORDTEXT = "<br><b>Passwor(d|t):</b> <input";
|
||||
private final String COOKIE_HOST = "http://filedwon.com";
|
||||
private static final String MAINTENANCE = ">This server is in maintenance mode";
|
||||
private static final String MAINTENANCEUSERTEXT = JDL.L("hoster.xfilesharingprobasic.errors.undermaintenance", "This server is under Maintenance");
|
||||
private static final String ALLWAIT_SHORT = JDL.L("hoster.xfilesharingprobasic.errors.waitingfordownloads", "Waiting till new downloads can be started");
|
||||
private static final String PREMIUMONLY1 = JDL.L("hoster.xfilesharingprobasic.errors.premiumonly1", "Max downloadable filesize for free users:");
|
||||
private static final String PREMIUMONLY2 = JDL.L("hoster.xfilesharingprobasic.errors.premiumonly2", "Only downloadable via premium or registered");
|
||||
// note: can not be negative -x or 0 .:. [1-*]
|
||||
private static AtomicInteger totalMaxSimultanFreeDownload = new AtomicInteger(20);
|
||||
// don't touch
|
||||
private static AtomicInteger maxFree = new AtomicInteger(1);
|
||||
|
||||
// DEV NOTES
|
||||
// XfileSharingProBasic Version 2.5.6.4-raz
|
||||
// mods: none
|
||||
// non account: 20 * 20
|
||||
// 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 FileDwonCom(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;
|
||||
}
|
||||
|
||||
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,
|
||||
// "Filename:? ?(<[^>]+> ?)+?([^<>\"\\']+)").getMatch(1);
|
||||
// filename = new Regex(correctedBR,
|
||||
// "Download File:? ?(<[^>]+> ?)+?([^<>\"\\']+)").getMatch(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
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, "([\\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);
|
||||
}
|
||||
String md5hash = new Regex(correctedBR, "<b>MD5.*?</b>.*?nowrap>(.*?)<").getMatch(0);
|
||||
if (md5hash != null) link.setMD5Hash(md5hash.trim());
|
||||
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;
|
||||
// First, bring up saved final links
|
||||
String dllink = checkDirectLink(downloadLink, directlinkproperty);
|
||||
// Second, check for streaming links on the first page
|
||||
if (dllink == null) dllink = getDllink();
|
||||
// Third, continue like normal.
|
||||
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);
|
||||
// how many forms deep do you want to try.
|
||||
int repeat = 3;
|
||||
for (int i = 1; i < repeat; 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.");
|
||||
}
|
||||
// md5 can be on the subquent pages
|
||||
if (downloadLink.getMD5Hash() == null) {
|
||||
String md5hash = new Regex(correctedBR, "<b>MD5.*?</b>.*?nowrap>(.*?)<").getMatch(0);
|
||||
if (md5hash != null) downloadLink.setMD5Hash(md5hash.trim());
|
||||
}
|
||||
/* 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("<Form name=\"F1\" method=\"POST\" action=\"\"") || i == repeat)) {
|
||||
logger.warning("Final downloadlink (String is \"dllink\") regex didn't match!");
|
||||
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
|
||||
} else if (dllink == null && br.containsHTML("<Form name=\"F1\" method=\"POST\" action=\"\"")) {
|
||||
dlForm = br.getFormbyProperty("name", "F1");
|
||||
continue;
|
||||
} 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);
|
||||
try {
|
||||
// add a download slot
|
||||
controlFree(+1);
|
||||
// start the dl
|
||||
dl.startDownload();
|
||||
} finally {
|
||||
// remove download slot
|
||||
controlFree(-1);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxSimultanFreeDownloadNum() {
|
||||
return maxFree.get();
|
||||
}
|
||||
|
||||
/**
|
||||
* Prevents more than one free download from starting at a given time. One
|
||||
* step prior to dl.startDownload(), it adds a slot to maxFree which allows
|
||||
* the next singleton download to start, or at least try.
|
||||
*
|
||||
* This is needed because xfileshare(website) only throws errors after a
|
||||
* final dllink starts transferring or at a given step within pre download
|
||||
* sequence. But this template(XfileSharingProBasic) allows multiple
|
||||
* slots(when available) to commence the download sequence,
|
||||
* this.setstartintival does not resolve this issue. Which results in x(20)
|
||||
* captcha events all at once and only allows one download to start. This
|
||||
* prevents wasting peoples time and effort on captcha solving and|or
|
||||
* wasting captcha trading credits. Users will experience minimal harm to
|
||||
* downloading as slots are freed up soon as current download begins.
|
||||
*
|
||||
* @param controlFree
|
||||
* (+1|-1)
|
||||
*/
|
||||
public synchronized void controlFree(int num) {
|
||||
logger.info("maxFree was = " + maxFree.get());
|
||||
maxFree.set(Math.min(Math.max(1, maxFree.addAndGet(num)), totalMaxSimultanFreeDownload.get()));
|
||||
logger.info("maxFree now = " + maxFree.get());
|
||||
}
|
||||
|
||||
/** 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|Download File)").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, PREMIUMONLY1 + " " + filesizelimit);
|
||||
} else {
|
||||
logger.warning("Only downloadable via premium");
|
||||
throw new PluginException(LinkStatus.ERROR_FATAL, PREMIUMONLY2);
|
||||
}
|
||||
}
|
||||
if (correctedBR.contains(MAINTENANCE)) throw new PluginException(LinkStatus.ERROR_TEMPORARILY_UNAVAILABLE, 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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -34,16 +34,16 @@ import jd.plugins.PluginForHost;
|
||||
*/
|
||||
|
||||
/* Set interfaceVersion to 3 to avoid old Stable trying to load this Plugin */
|
||||
@HostPlugin(revision = "$Revision: 15297 $", interfaceVersion = 3, names = { "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\\.)?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: 15297 $", interfaceVersion = 3, names = { "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\\.)?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) {
|
||||
|
@ -1,204 +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 java.util.regex.Pattern;
|
||||
|
||||
import jd.PluginWrapper;
|
||||
import jd.http.RandomUserAgent;
|
||||
import jd.http.URLConnectionAdapter;
|
||||
import jd.nutils.encoding.Encoding;
|
||||
import jd.parser.html.Form;
|
||||
import jd.plugins.Account;
|
||||
import jd.plugins.AccountInfo;
|
||||
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.locale.JDL;
|
||||
|
||||
import org.appwork.utils.formatter.SizeFormatter;
|
||||
|
||||
@HostPlugin(revision = "$Revision$", interfaceVersion = 2, names = { "przeklej.pl" }, urls = { "http://[\\w\\.]*?przeklej\\.pl/(d/\\w+/|\\d+|plik/)[^\\s]+" }, flags = { 2 })
|
||||
public class PrzeklejPl extends PluginForHost {
|
||||
|
||||
private static final String PATTERN_PASSWORD_WRONG = "B.*?dnie podane has";
|
||||
|
||||
private static final String REGISTEREDONLY = "> możesz pobrać, jeżeli jesteś zalogowany";
|
||||
|
||||
private static final String NOFREEMESSAGE = "Only downloadable for registered users";
|
||||
|
||||
private static final String FINALLINKREGEX = "class=\"download\" href=\"(.*?)\"";
|
||||
|
||||
public PrzeklejPl(PluginWrapper wrapper) {
|
||||
super(wrapper);
|
||||
this.enablePremium("http://www.przeklej.pl/wybierz-platnosci");
|
||||
this.setStartIntervall(5000l);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void correctDownloadLink(DownloadLink link) throws Exception {
|
||||
link.setUrlDownload(link.getDownloadURL().replaceAll("_", "-"));
|
||||
}
|
||||
|
||||
public void doFree(DownloadLink downloadLink) throws Exception {
|
||||
String passCode = null;
|
||||
boolean resumable = true;
|
||||
int maxchunks = 0;
|
||||
if (!br.containsHTML("<span class=\"unbold\">Wprowad")) {
|
||||
String linkurl = br.getRegex(FINALLINKREGEX).getMatch(0);
|
||||
if (linkurl == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
|
||||
linkurl = "http://www.przeklej.pl" + linkurl;
|
||||
br.getPage(linkurl);
|
||||
linkurl = br.getRedirectLocation();
|
||||
if (linkurl == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
|
||||
br.setFollowRedirects(true);
|
||||
dl = jd.plugins.BrowserAdapter.openDownload(br, downloadLink, linkurl, resumable, maxchunks);
|
||||
handleErrors();
|
||||
dl.startDownload();
|
||||
} else {
|
||||
if (downloadLink.getStringProperty("pass", null) == null) {
|
||||
passCode = Plugin.getUserInput("Password", downloadLink);
|
||||
} else {
|
||||
passCode = downloadLink.getStringProperty("pass", null);
|
||||
}
|
||||
Form form = br.getFormbyProperty("name", "haselko");
|
||||
if (form == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
|
||||
form.put(Encoding.urlEncode("haslo[haslo]"), passCode);
|
||||
br.setFollowRedirects(true);
|
||||
URLConnectionAdapter con = br.openFormConnection(form);
|
||||
if (!con.isContentDisposition()) {
|
||||
br.followConnection();
|
||||
if (br.containsHTML(PATTERN_PASSWORD_WRONG)) {
|
||||
downloadLink.setProperty("pass", null);
|
||||
throw new PluginException(LinkStatus.ERROR_CAPTCHA);
|
||||
}
|
||||
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
|
||||
} else {
|
||||
con.disconnect();
|
||||
downloadLink.setProperty("pass", passCode);
|
||||
dl = jd.plugins.BrowserAdapter.openDownload(br, downloadLink, form, resumable, maxchunks);
|
||||
handleErrors();
|
||||
dl.startDownload();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public AccountInfo fetchAccountInfo(Account account) throws Exception {
|
||||
AccountInfo ai = new AccountInfo();
|
||||
try {
|
||||
login(account);
|
||||
} catch (PluginException e) {
|
||||
account.setValid(false);
|
||||
return ai;
|
||||
}
|
||||
ai.setStatus("Registered (free) User");
|
||||
account.setValid(true);
|
||||
return ai;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAGBLink() {
|
||||
return "http://przeklej.pl/regulamin";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxSimultanFreeDownloadNum() {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxSimultanPremiumDownloadNum() {
|
||||
return -1;
|
||||
}
|
||||
|
||||
private void handleErrors() throws Exception {
|
||||
if (dl.getConnection().getContentType().contains("html")) {
|
||||
br.followConnection();
|
||||
if (br.containsHTML("Podana strona nie istnieje")) throw new PluginException(LinkStatus.ERROR_TEMPORARILY_UNAVAILABLE, "Server error");
|
||||
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleFree(DownloadLink downloadLink) throws Exception {
|
||||
requestFileInformation(downloadLink);
|
||||
if (br.containsHTML(REGISTEREDONLY)) throw new PluginException(LinkStatus.ERROR_FATAL, JDL.L("plugins.hoster.PrzeklejPl.errors.nofreedownloadlink", NOFREEMESSAGE));
|
||||
doFree(downloadLink);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handlePremium(DownloadLink link, Account account) throws Exception {
|
||||
requestFileInformation(link);
|
||||
login(account);
|
||||
br.getPage(link.getDownloadURL());
|
||||
if (br.containsHTML("<span>Wielkość pliku przekracza Twój dostępny <strong>abonament</strong>")) throw new PluginException(LinkStatus.ERROR_TEMPORARILY_UNAVAILABLE, JDL.L("plugins.hoster.PrzeklejPl.errors.AccountDisabled", "Account ran out of traffic"), PluginException.VALUE_ID_PREMIUM_TEMP_DISABLE);
|
||||
doFree(link);
|
||||
}
|
||||
|
||||
// do not add @Override here to keep 0.* compatibility
|
||||
public boolean hasCaptcha() {
|
||||
return true;
|
||||
}
|
||||
|
||||
private void login(Account account) throws Exception {
|
||||
this.setBrowserExclusive();
|
||||
br.getHeaders().put("User-Agent", RandomUserAgent.generate());
|
||||
br.getHeaders().put("Referer", "");
|
||||
br.setCustomCharset("utf-8");
|
||||
br.postPage("http://www.przeklej.pl/loguj", "login%5Blogin%5D=" + account.getUser() + "&login%5Bpass%5D=" + account.getPass());
|
||||
if (!br.containsHTML("<html><head><meta http\\-equiv=\"refresh\" content=\"0;url=http://www\\.przeklej\\.pl/\"/></head></html>")) throw new PluginException(LinkStatus.ERROR_PREMIUM, PluginException.VALUE_ID_PREMIUM_DISABLE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AvailableStatus requestFileInformation(DownloadLink downloadLink) throws IOException, InterruptedException, PluginException {
|
||||
this.setBrowserExclusive();
|
||||
br.setCustomCharset("utf-8");
|
||||
br.getPage(downloadLink.getDownloadURL());
|
||||
if (br.containsHTML("<h1 style=\"font-size: 40px;\">Podana strona nie istnieje</h1>")) throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
|
||||
if (br.containsHTML(REGISTEREDONLY)) downloadLink.getLinkStatus().setStatusText(JDL.L("plugins.hoster.PrzeklejPl.errors.nofreedownloadlink", NOFREEMESSAGE));
|
||||
String filename = Encoding.htmlDecode(br.getRegex(Pattern.compile("<title>przeklej.pl -(.*?)\\. Wrzucaj", Pattern.CASE_INSENSITIVE)).getMatch(0));
|
||||
if (filename == null) {
|
||||
Encoding.htmlDecode(br.getRegex(Pattern.compile("title=\"Pobierz plik\">(.*?)</a>", Pattern.CASE_INSENSITIVE)).getMatch(0));
|
||||
}
|
||||
String filesize = br.getRegex(Pattern.compile("class=\"size\" style=\"font-weight: normal;\">[\t\n\r ]+\\((.*?)\\)", Pattern.CASE_INSENSITIVE)).getMatch(0);
|
||||
if (filesize == null) {
|
||||
filesize = br.getRegex(Pattern.compile("You are trying to download a <strong>(.*?)</strong> file", Pattern.CASE_INSENSITIVE)).getMatch(0);
|
||||
}
|
||||
if (filename == null || filesize == null) throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
|
||||
downloadLink.setName(filename.trim());
|
||||
downloadLink.setDownloadSize(SizeFormatter.getSize(filesize.replaceAll(",", "\\.")));
|
||||
return AvailableStatus.TRUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resetDownloadlink(DownloadLink link) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resetPluginGlobals() {
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user