-coraldrive.net: RIP

-added support for filedownloads closes #6190
-added free acc support for project-free-upload closes #6194
-hideurl.biz and minilink.us: RIP fixes #6206
-fixed uploadoz fixes #6203
-added support for multiple glumbouploads folder-pages fixes #6202
-added a decrypter for karelia closes #6205
-improved kongsifile errorhandling fixes #6208
-improved allmyvideos errorhandling fixes #6210
-movbay.org: RIP fixes #6221
-excluded invalid motherless links and improved errorhandling fixes #6220
-improved perfectgirls decrypter and found new drtuber linktype refs #6226
-added a pornrabbit decrypter to grab embedded links fixes #6228
-fixed pornhub filename bug fixes #6227

git-svn-id: svn://svn.jdownloader.org/jdownloader/trunk@18401 ebf7c1c2-ba36-0410-9fe8-c592906822b4
This commit is contained in:
psp 2012-09-05 10:47:39 +00:00
parent 11fd0ad8c1
commit abb15e887d
18 changed files with 692 additions and 805 deletions

View File

@ -898,4 +898,8 @@ jd/plugins/decrypter/XnnLnkNt.class
jd/plugins/decrypter/LnkSafeMe.class
jd/plugins/decrypter/Tchnrckrnf.class
jd/plugins/decrypter/Hdrlbz.class
jd/plugins/decrypter/TakhzenCom.class
jd/plugins/decrypter/TakhzenCom.class
jd/plugins/hoster/CoralDriveNet.class
jd/plugins/decrypter/Hdrlbz.class
jd/plugins/decrypter/MnlnkUs.class
jd/plugins/hoster/MovBayOrg.class

View File

@ -20,6 +20,7 @@ import java.util.ArrayList;
import jd.PluginWrapper;
import jd.controlling.ProgressController;
import jd.nutils.encoding.Encoding;
import jd.plugins.CryptedLink;
import jd.plugins.DecrypterPlugin;
import jd.plugins.DownloadLink;
@ -36,15 +37,27 @@ public class GlumboUploadsComFolder extends PluginForDecrypt {
public ArrayList<DownloadLink> decryptIt(CryptedLink param, ProgressController progress) throws Exception {
ArrayList<DownloadLink> decryptedLinks = new ArrayList<DownloadLink>();
ArrayList<String> pages = new ArrayList<String>();
String parameter = param.toString();
pages.add(parameter);
br.setFollowRedirects(true);
br.setCookie("http://" + HOST, "lang", "english");
br.getPage(parameter);
if (br.containsHTML("No such user exist")) return decryptedLinks;
String[] links = br.getRegex("<div class=\"link\"><a href=\"(http://(www\\.)?" + HOST + "/[a-z0-9]{12}.*?)\"").getColumn(0);
if (links == null) return null;
for (String dl : links)
decryptedLinks.add(createDownloadlink(dl));
final String[] allpages = br.getRegex(">\\d+</a><a href=\\'(\\?fld_id=\\d+\\&amp;[^<>\"/]*?page=\\d+)\\'").getColumn(0);
if (allpages != null && allpages.length != 0) {
for (final String aPage : allpages)
if (!pages.contains(aPage)) pages.add(aPage);
}
int counter = 0;
for (final String currentPage : pages) {
if (counter != 0) br.getPage("http://glumbouploads.com/" + Encoding.htmlDecode(currentPage));
final String[] links = br.getRegex("<div class=\"link\"><a href=\"(http://(www\\.)?" + HOST + "/[a-z0-9]{12}.*?)\"").getColumn(0);
if (links == null) return null;
for (String dl : links)
decryptedLinks.add(createDownloadlink(dl));
counter++;
}
return decryptedLinks;
}

View File

@ -1,59 +0,0 @@
// jDownloader - Downloadmanager
// Copyright (C) 2008 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 java.util.regex.Pattern;
import jd.PluginWrapper;
import jd.controlling.ProgressController;
import jd.plugins.CryptedLink;
import jd.plugins.DecrypterPlugin;
import jd.plugins.DownloadLink;
import jd.plugins.PluginForDecrypt;
@DecrypterPlugin(revision = "$Revision$", interfaceVersion = 2, names = { "hideurl.biz" }, urls = { "http://[\\w\\.]*?hideurl\\.biz/[\\w]+" }, flags = { 0 })
public class Hdrlbz extends PluginForDecrypt {
public Hdrlbz(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.setFollowRedirects(false);
br.getPage(parameter);
String links[] = br.getRegex(Pattern.compile("value=\".*?Download.*?\" onclick=\"openlink\\('(.*?)','.*?'\\);\"", Pattern.CASE_INSENSITIVE)).getColumn(0);
progress.setRange(links.length);
for (String element : links) {
br.getPage(element);
if (br.getRedirectLocation() != null) {
decryptedLinks.add(createDownloadlink(br.getRedirectLocation()));
} else {
String link = br.getRegex(Pattern.compile("action=\"(.*?)\"", Pattern.CASE_INSENSITIVE)).getMatch(0);
if (link != null) decryptedLinks.add(createDownloadlink(link));
}
progress.increase(1);
}
return decryptedLinks;
}
}

View File

@ -25,26 +25,30 @@ import jd.plugins.DecrypterPlugin;
import jd.plugins.DownloadLink;
import jd.plugins.PluginForDecrypt;
@DecrypterPlugin(revision = "$Revision$", interfaceVersion = 2, names = { "minilink.us" }, urls = { "http://[\\w\\.]*?minilink\\.us/[A-Zaz0-9-_]+" }, flags = { 0 })
public class MnlnkUs extends PluginForDecrypt {
@DecrypterPlugin(revision = "$Revision$", interfaceVersion = 2, names = { "disk.karelia.pro" }, urls = { "http://(www\\.)?(disk\\.karelia\\.pro/fast/[A-Za-z0-9]+|fast\\.karelia\\.pro/[A-Za-z0-9]+/[^<>\"/]*?/)" }, flags = { 0 })
public class KareliaPro extends PluginForDecrypt {
public MnlnkUs(PluginWrapper wrapper) {
public KareliaPro(PluginWrapper wrapper) {
super(wrapper);
}
// @Override
public ArrayList<DownloadLink> decryptIt(CryptedLink param, ProgressController progress) throws Exception {
ArrayList<DownloadLink> decryptedLinks = new ArrayList<DownloadLink>();
String parameter = param.toString();
br.setFollowRedirects(false);
br.getPage(parameter);
if (!br.containsHTML("Sorry, this short URL is not valid")) {
String linkurl = br.getRegex("<iframe.*?src=\"(.*?)\".*?>").getMatch(0);
if (linkurl == null) return null;
decryptedLinks.add(createDownloadlink(linkurl));
final String parameter = param.toString();
if (parameter.matches("http://(www\\.)?disk\\.karelia\\.pro/fast/[A-Za-z0-9]+")) {
br.getPage(parameter);
final String[] links = br.getRegex("18px center no\\-repeat;\">[\t\n\r ]+<a href=\"(http://disk\\.karelia\\.pro/fast/[^<>\"]*?)\"").getColumn(0);
if (links == null || links.length == 0) {
logger.warning("Decrypter broken for link: " + parameter);
return null;
}
for (String singleLink : links)
decryptedLinks.add(createDownloadlink("directhttp://" + singleLink));
} else {
decryptedLinks.add(createDownloadlink("directhttp://" + parameter.replaceAll("(/)$", "").replace("fast.karelia.pro/", "disk.karelia.pro/fast/")));
}
return decryptedLinks;
}
// @Override
}

View File

@ -28,7 +28,7 @@ import jd.plugins.DownloadLink;
import jd.plugins.FilePackage;
import jd.plugins.PluginForDecrypt;
@DecrypterPlugin(revision = "$Revision$", interfaceVersion = 2, names = { "motherless.com" }, urls = { "http://(www\\.)?(members\\.)?motherless\\.com/(g/[\\w\\-]+/[A-Z0-9]{7}|[A-Z0-9]{7,9}(/[A-Z0-9]{7})?)" }, flags = { 0 })
@DecrypterPlugin(revision = "$Revision$", interfaceVersion = 2, names = { "motherless.com" }, urls = { "http://(www\\.)?(members\\.)?motherless\\.com/(?!privacy|popular|register|premium|members|galleries|contact)(g/[\\w\\-]+/[A-Z0-9]{7}|[A-Z0-9]{7,9}(/[A-Z0-9]{7})?)" }, flags = { 0 })
public class MotherLessCom extends PluginForDecrypt {
private String fpName = null;
@ -61,7 +61,14 @@ public class MotherLessCom extends PluginForDecrypt {
// alters 'domain/(g/name/)uid' by removing all but uid
String parameter = param.toString().replaceAll("motherless\\.com/g/[\\w\\-]+/", "motherless.com/");
br.getPage(parameter);
if (br.containsHTML("Not Available") || br.containsHTML("not found") || br.containsHTML("You will be redirected to")) return decryptedLinks;
if (br.containsHTML("Not Available") || br.containsHTML("not found") || br.containsHTML("You will be redirected to") || br.containsHTML(">The page you\\'re looking for cannot be found")) {
logger.info("Link offline: " + parameter);
return decryptedLinks;
}
if (br.containsHTML("class=\"red\\-pill\\-button rounded\\-corners\\-r5\">Reply</a>")) {
logger.info("This is a forum link without any downloadable content: " + parameter);
return decryptedLinks;
}
// Common bug: It can happen that the texts that we use to differ
// between the kinds of links change so the decrypter breaks down,
// always check that first!

View File

@ -70,6 +70,12 @@ public class PerfectGirlsNet extends PluginForDecrypt {
decryptedLinks.add(createDownloadlink(externID));
return decryptedLinks;
}
// drtuber.com handling 2
externID = br.getRegex("\"(http://(www\\.)?drtuber\\.com/embed/\\d+)\"").getMatch(0);
if (externID != null) {
decryptedLinks.add(createDownloadlink(externID));
return decryptedLinks;
}
externID = br.getRegex("xhamster\\.com/xembed\\.php\\?video=(\\d+)\"").getMatch(0);
if (externID != null) {
decryptedLinks.add(createDownloadlink("http://xhamster.com/movies/" + externID + "/" + System.currentTimeMillis() + ".html"));
@ -175,7 +181,7 @@ public class PerfectGirlsNet extends PluginForDecrypt {
decryptedLinks.add(dl);
return decryptedLinks;
}
if (br.containsHTML("src=\"http://(www\\.)?dachix\\.com/flashplayer/flvplayer\\.swf\"")) {
if (br.containsHTML("src=\"http://(www\\.)?dachix\\.com/flashplayer/flvplayer\\.swf\"|\"http://(www\\.)?deviantclip\\.com/flashplayer/flvplayer\\.swf\"")) {
logger.info("Link offline: " + parameter);
return decryptedLinks;
}

View File

@ -0,0 +1,209 @@
//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 java.util.Random;
import jd.PluginWrapper;
import jd.controlling.ProgressController;
import jd.nutils.encoding.Encoding;
import jd.plugins.CryptedLink;
import jd.plugins.DecrypterPlugin;
import jd.plugins.DownloadLink;
import jd.plugins.PluginForDecrypt;
//EmbedDecrypter 0.1.1
//Mods: removed pornrabbit decrypt, added youporn.com decrypt
@DecrypterPlugin(revision = "$Revision$", interfaceVersion = 2, names = { "pornrabbit.com" }, urls = { "http://(www\\.)?pornrabbit\\.com/(\\d+/[a-z0-9_\\-]+\\.html|video/\\d+/)" }, flags = { 0 })
public class PornRabbitComDecrypter extends PluginForDecrypt {
public PornRabbitComDecrypter(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.setFollowRedirects(true);
br.getPage(parameter);
String filename = br.getRegex("<title>([^<>\"]*?) : pornrabbit\\.com</title>").getMatch(0);
if (filename == null) filename = br.getRegex(">Report this video!</a></div>[\t\n\r ]+<h1>([^<>\"]*?)</h1>").getMatch(0);
String externID = br.getRegex("xvideos\\.com/embedframe/(\\d+)\"").getMatch(0);
if (externID != null) {
decryptedLinks.add(createDownloadlink("http://www.xvideos.com/video" + externID));
return decryptedLinks;
}
externID = br.getRegex("madthumbs\\.com%2Fvideos%2Fembed_config%3Fid%3D(\\d+)").getMatch(0);
if (externID != null) {
DownloadLink dl = createDownloadlink("http://www.madthumbs.com/videos/amateur/" + new Random().nextInt(100000) + "/" + externID);
decryptedLinks.add(dl);
return decryptedLinks;
}
externID = br.getRegex("(\"|\\')(http://(www\\.)?tube8\\.com/embed/[^<>\"/]*?/[^<>\"/]*?/\\d+/?)(\"|\\')").getMatch(1);
if (externID != null) {
decryptedLinks.add(createDownloadlink(externID.replace("tube8.com/embed/", "tube8.com/")));
return decryptedLinks;
}
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("(http://(www\\.)?drtuber\\.com/player/config_embed3\\.php\\?vkey=[a-z0-9]+)").getMatch(0);
if (externID != null) {
decryptedLinks.add(createDownloadlink(externID));
return decryptedLinks;
}
// drtuber.com handling 2
externID = br.getRegex("\"(http://(www\\.)?drtuber\\.com/embed/\\d+)\"").getMatch(0);
if (externID != null) {
decryptedLinks.add(createDownloadlink(externID));
return decryptedLinks;
}
externID = br.getRegex("xhamster\\.com/xembed\\.php\\?video=(\\d+)\"").getMatch(0);
if (externID != null) {
decryptedLinks.add(createDownloadlink("http://xhamster.com/movies/" + externID + "/" + System.currentTimeMillis() + ".html"));
return decryptedLinks;
}
externID = br.getRegex("emb\\.slutload\\.com/([A-Za-z0-9]+)\"").getMatch(0);
if (externID != null) {
decryptedLinks.add(createDownloadlink("http://slutload.com/watch/" + externID));
return decryptedLinks;
}
externID = br.getRegex("pornerbros\\.com/content/(\\d+)\\.xml").getMatch(0);
if (externID != null) {
decryptedLinks.add(createDownloadlink("http://www.pornerbros.com/" + externID + "/" + System.currentTimeMillis() + ".html"));
return decryptedLinks;
}
externID = br.getRegex("hardsextube\\.com/embed/(\\d+)/\"").getMatch(0);
if (externID != null) {
decryptedLinks.add(createDownloadlink("http://www.hardsextube.com/video/" + externID + "/"));
return decryptedLinks;
}
externID = br.getRegex("player\\.tnaflix\\.com/video/(\\d+)\"").getMatch(0);
if (externID != null) {
decryptedLinks.add(createDownloadlink("http://www.tnaflix.com/cum-videos/" + System.currentTimeMillis() + "/video" + externID));
return decryptedLinks;
}
externID = br.getRegex("metacafe\\.com/fplayer/(\\d+)/").getMatch(0);
if (externID != null) {
decryptedLinks.add(createDownloadlink("http://www.metacafe.com/watch/" + externID + "/" + System.currentTimeMillis()));
return decryptedLinks;
}
externID = br.getRegex("pornhub\\.com/embed/(\\d+)").getMatch(0);
if (externID == null) externID = br.getRegex("pornhub\\.com/view_video\\.php\\?viewkey=(\\d+)").getMatch(0);
if (externID != null) {
DownloadLink dl = createDownloadlink("http://www.pornhub.com/view_video.php?viewkey=" + externID);
decryptedLinks.add(dl);
return decryptedLinks;
}
// pornhub handling number 2
externID = br.getRegex("name=\"FlashVars\" value=\"options=(http://(www\\.)?pornhub\\.com/embed_player(_v\\d+)?\\.php\\?id=\\d+)\"").getMatch(0);
if (externID != null) {
br.getPage(externID);
if (br.containsHTML("<link_url>N/A</link_url>")) {
logger.info("Link offline: " + parameter);
return decryptedLinks;
}
externID = br.getRegex("<link_url>(http://[^<>\"]*?)</link_url>").getMatch(0);
if (externID == null) {
logger.warning("Decrypter broken for link: " + parameter);
return null;
}
decryptedLinks.add(createDownloadlink(externID));
return decryptedLinks;
}
externID = br.getRegex("(\\'|\")(http://(www\\.)?myxvids\\.com/embed_code/\\d+/\\d+/myxvids_embed\\.js)(\\'|\")").getMatch(1);
if (externID != null) {
br.getPage(externID);
externID = br.getRegex("var urlAddress = \"(http://[^<>\"]*?)\";").getMatch(0);
if (externID != null) {
decryptedLinks.add(createDownloadlink(externID));
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;
}
externID = br.getRegex("<iframe src=\"http://(www\\.)?yobt\\.tv/embed/(\\d+)\\.html\"").getMatch(1);
if (externID != null) {
decryptedLinks.add(createDownloadlink("http://www.yobt.tv/content/" + externID + "/" + System.currentTimeMillis() + ".html"));
return decryptedLinks;
}
externID = br.getRegex("stileproject\\.com/embed/(\\d+)").getMatch(0);
if (externID != null) {
decryptedLinks.add(createDownloadlink("http://stileproject.com/video/" + externID));
return decryptedLinks;
}
externID = br.getRegex("book\\-mark\\.net/playerconfig/(\\d+)/").getMatch(0);
if (externID != null) {
DownloadLink dl = createDownloadlink("http://www.book-mark.net/videos/" + externID + "/x.html");
decryptedLinks.add(dl);
return decryptedLinks;
}
externID = br.getRegex("youporn\\.com/embed/(\\d+)\\'").getMatch(0);
if (externID != null) {
final DownloadLink dl = createDownloadlink("http://www.youporn.com/watch/" + externID + "/" + System.currentTimeMillis());
decryptedLinks.add(dl);
return decryptedLinks;
}
// filename needed for all IDs below here
if (filename == null) {
logger.warning("Decrypter broken for link: " + parameter);
return null;
}
filename = Encoding.htmlDecode(filename.trim());
externID = br.getRegex("shufuni\\.com/Flash/.*?flashvars=\"VideoCode=(.*?)\"").getMatch(0);
if (externID != null) {
DownloadLink dl = createDownloadlink("http://www.shufuni.com/handlers/FLVStreamingv2.ashx?videoCode=" + externID);
dl.setFinalFileName(Encoding.htmlDecode(filename.trim()));
decryptedLinks.add(dl);
return decryptedLinks;
}
externID = br.getRegex("src=\"http://videos\\.allelitepass\\.com/txc/([^<>\"/]*?)\\.swf\"").getMatch(0);
if (externID != null) {
br.getPage("http://videos.allelitepass.com/txc/player.php?video=" + Encoding.htmlDecode(externID));
externID = br.getRegex("<file>(http://[^<>\"]*?)</file>").getMatch(0);
if (externID != null) {
final DownloadLink dl = createDownloadlink("directhttp://" + externID);
dl.setFinalFileName(filename + ".flv");
decryptedLinks.add(dl);
return decryptedLinks;
}
}
// 2nd handling for tnaflix
externID = br.getRegex("tnaflix\\.com/embedding_player/player_[^<>\"]+\\.swf\".*?value=\"config=(embedding_feed\\.php\\?viewkey=[a-z0-9]+)\"").getMatch(0);
if (externID != null) {
br.getPage("http://www.tnaflix.com/embedding_player/" + externID);
externID = br.getRegex("start_thumb>http://static\\.tnaflix\\.com/thumbs/[a-z0-9\\-_]+/[a-z0-9]+_(\\d+)l\\.jpg<").getMatch(0);
if (externID != null) {
decryptedLinks.add(createDownloadlink("http://www.tnaflix.com/cum-videos/" + System.currentTimeMillis() + "/video" + externID));
return decryptedLinks;
}
}
// No extern link found->Add to hosterplugin
decryptedLinks.add(createDownloadlink(parameter.replace("pornrabbit.com/", "pornrabbitdecrypted.com/")));
return decryptedLinks;
}
}

View File

@ -28,7 +28,7 @@ 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|movdivx\\.com|filenuke\\.com|((flashstream\\.in|sharefiles4u\\.com)|xvidstage\\.com|xvidstream\\.net)|ginbig\\.com|vidbux\\.com|divxbase\\.com|queenshare\\.com|filesabc\\.com|((fiberupload|bulletupload)\\.com)|edoc\\.com|easybytez\\.com|filesabc\\.com|fileduct\\.com|henchfile\\.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|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|queenshare\\.com|filesabc\\.com|((fiberupload|bulletupload)\\.com)|edoc\\.com|easybytez\\.com|filesabc\\.com|fileduct\\.com|henchfile\\.com)/(users/[a-z0-9_]+/.+|folder/\\d+/.+)" }, flags = { 0 })
public class XFileShareProFolder extends PluginForDecrypt {
// DEV NOTES

View File

@ -55,6 +55,8 @@ public class AllMyVideosNet extends PluginForHost {
private static final String COOKIE_HOST = "http://allmyvideos.net";
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 ENCODINGVIDEO = "Video is currently being encoded";
private static final String ENCODINGVIDEOUSERTEXT = JDL.L("hoster.allmyvideosnet.videoisencoding", "Video is currently being encoded");
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");
@ -119,6 +121,10 @@ public class AllMyVideosNet extends PluginForHost {
link.getLinkStatus().setStatusText(JDL.L("plugins.hoster.xfilesharingprobasic.undermaintenance", MAINTENANCEUSERTEXT));
return AvailableStatus.TRUE;
}
if (correctedBR.contains(ENCODINGVIDEO)) {
link.getLinkStatus().setStatusText(ENCODINGVIDEOUSERTEXT);
return AvailableStatus.TRUE;
}
String[] fileInfo = new String[3];
// scan the first page
scanInfo(fileInfo);
@ -384,6 +390,7 @@ public class AllMyVideosNet extends PluginForHost {
}
}
if (correctedBR.contains(MAINTENANCE)) throw new PluginException(LinkStatus.ERROR_TEMPORARILY_UNAVAILABLE, MAINTENANCEUSERTEXT, 2 * 60 * 60 * 1000l);
if (correctedBR.contains(ENCODINGVIDEO)) throw new PluginException(LinkStatus.ERROR_TEMPORARILY_UNAVAILABLE, ENCODINGVIDEOUSERTEXT, 60 * 60 * 1000l);
}
public void checkServerErrors() throws NumberFormatException, PluginException {

View File

@ -34,7 +34,7 @@ import jd.plugins.LinkStatus;
import jd.plugins.PluginException;
import jd.plugins.PluginForHost;
@HostPlugin(revision = "$Revision$", interfaceVersion = 2, names = { "drtuber.com" }, urls = { "http://(www\\.)?drtuber\\.com/(video/\\d+|player/config_embed3\\.php\\?vkey=[a-z0-9]+)" }, flags = { 0 })
@HostPlugin(revision = "$Revision$", interfaceVersion = 2, names = { "drtuber.com" }, urls = { "http://(www\\.)?drtuber\\.com/(video/\\d+|player/config_embed3\\.php\\?vkey=[a-z0-9]+|embed/\\d+)" }, flags = { 0 })
public class DrTuberCom extends PluginForHost {
private String DLLINK = null;
@ -93,6 +93,11 @@ public class DrTuberCom extends PluginForHost {
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
downloadLink.setUrlDownload(Encoding.htmlDecode(finallink));
} else if (downloadLink.getDownloadURL().matches("http://(www\\.)?drtuber\\.com/embed/\\d+")) {
// Not yet supported
if (true) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
br.getPage(downloadLink.getDownloadURL());
br.getPage("http://www.drtuber.com/player/config_embed4.php?id_video=" + new Regex(downloadLink.getDownloadURL(), "(\\d+)$").getMatch(0) + "&t=1346839751&pkey=2a3d1b2d24db28888e4dfe83e9e02da4");
}
br.getPage(downloadLink.getDownloadURL());
if (br.containsHTML("(This video cannot be found\\.|Are you sure you typed in the correct url\\?<)") || br.getURL().contains("missing=true")) { throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND); }

View File

@ -1,26 +1,24 @@
// jDownloader - Downloadmanager
// Copyright (C) 2012 JD-Team support@jdownloader.org
//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 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.
//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/>.
//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.HashMap;
import java.util.Map;
import java.util.SortedMap;
import java.util.TreeMap;
import java.util.concurrent.atomic.AtomicInteger;
@ -29,15 +27,12 @@ import java.util.regex.Pattern;
import jd.PluginWrapper;
import jd.config.Property;
import jd.http.Browser;
import jd.http.Cookie;
import jd.http.Cookies;
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.Account;
import jd.plugins.AccountInfo;
import jd.parser.html.InputField;
import jd.plugins.DownloadLink;
import jd.plugins.DownloadLink.AvailableStatus;
import jd.plugins.HostPlugin;
@ -49,31 +44,37 @@ import jd.utils.JDUtilities;
import jd.utils.locale.JDL;
import org.appwork.utils.formatter.SizeFormatter;
import org.appwork.utils.formatter.TimeFormatter;
@HostPlugin(revision = "$Revision$", interfaceVersion = 2, names = { "coraldrive.net" }, urls = { "https?://(www\\.)?coraldrive\\.net/[a-z0-9]{12}" }, flags = { 2 })
public class CoralDriveNet extends PluginForHost {
@HostPlugin(revision = "$Revision$", interfaceVersion = 2, names = { "filedownloads.org" }, urls = { "https?://(www\\.)?filedownloads\\.org/[a-z0-9]{12}" }, flags = { 0 })
public class FileDownloadsOrg extends PluginForHost {
private String correctedBR = "";
private static final String PASSWORDTEXT = "<br><b>Passwor(d|t):</b> <input";
private static final String COOKIE_HOST = "http://coraldrive.net";
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");
private static final Object LOCK = new Object();
private static AtomicInteger maxPrem = new AtomicInteger(1);
private String correctedBR = "";
private static final String PASSWORDTEXT = "<br><b>Passwor(d|t):</b> <input";
private final String COOKIE_HOST = "http://filedownloads.org";
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.5.5-raz
/**
* Script notes: Streaming versions of this script sometimes redirect you to
* their directlinks when accessing this link + the link ID:
* http://somehoster.in/vidembed-
* */
// XfileSharingProBasic Version 2.5.6.8-raz
// mods:
// non account: 1 * 1, no resume
// free account: same as above.
// premium account: 20 * unlimited
// non account: 20 * 20
// free account: chunk * maxdl
// premium account: chunk * maxdl
// protocol: no https
// captchatype: 4dignum
// other: no redirects, costum file not found regex
// other: no redirects
@Override
public void correctDownloadLink(DownloadLink link) {
@ -85,9 +86,9 @@ public class CoralDriveNet extends PluginForHost {
return COOKIE_HOST + "/tos.html";
}
public CoralDriveNet(PluginWrapper wrapper) {
public FileDownloadsOrg(PluginWrapper wrapper) {
super(wrapper);
this.enablePremium(COOKIE_HOST + "/premium.html");
// this.enablePremium(COOKIE_HOST + "/premium.html");
}
// do not add @Override here to keep 0.* compatibility
@ -104,8 +105,6 @@ public class CoralDriveNet extends PluginForHost {
// 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");
br.setReadTimeout(3 * 60 * 1000);
br.setConnectTimeout(3 * 60 * 1000);
}
@Override
@ -114,46 +113,81 @@ public class CoralDriveNet extends PluginForHost {
br.setFollowRedirects(false);
prepBrowser();
getPage(link.getDownloadURL());
if (new Regex(correctedBR, Pattern.compile("(>Invalid or Deleted File<|>Possible causes of this error could be)", Pattern.CASE_INSENSITIVE)).matches()) throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
if (new Regex(correctedBR, "(No such file|>File Not Found<|>The file was removed by|Reason (of|for) deletion:\n)").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);
String[] fileInfo = new String[3];
// scan the first page
scanInfo(fileInfo);
// scan the second page. filesize[1] and md5hash[2] are not mission
// critical
if (fileInfo[0] == null) {
Form download1 = getFormByKey("op", "download1");
if (download1 != null) {
download1.remove("method_premium");
sendForm(download1);
scanInfo(fileInfo);
}
}
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\\.]+ ?(KB|MB|GB))").getMatch(0);
}
}
if (filename == null || filename.equals("")) {
if (correctedBR.contains("You have reached the download\\-limit")) {
if (fileInfo[0] == null || fileInfo[0].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...");
logger.warning("filename equals null, throwing \"plugin defect\"");
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));
if (fileInfo[2] != null && !fileInfo[2].equals("")) link.setMD5Hash(fileInfo[2].trim());
fileInfo[0] = fileInfo[0].replaceAll("(</b>|<b>|\\.html)", "");
link.setFinalFileName(fileInfo[0].trim());
if (fileInfo[1] != null && !fileInfo[1].equals("")) link.setDownloadSize(SizeFormatter.getSize(fileInfo[1]));
return AvailableStatus.TRUE;
}
private String[] scanInfo(String[] fileInfo) {
// standard traits from base page
if (fileInfo[0] == null) {
fileInfo[0] = new Regex(correctedBR, "You have requested.*?https?://(www\\.)?" + this.getHost() + "/[A-Za-z0-9]{12}/(.*?)</font>").getMatch(1);
if (fileInfo[0] == null) {
fileInfo[0] = new Regex(correctedBR, "fname\"( type=\"hidden\")? value=\"(.*?)\"").getMatch(1);
if (fileInfo[0] == null) {
fileInfo[0] = new Regex(correctedBR, "<h2>Download File(.*?)</h2>").getMatch(0);
if (fileInfo[0] == null) {
fileInfo[0] = new Regex(correctedBR, "Download File:? ?(<[^>]+> ?)+?([^<>\"\\']+)").getMatch(1);
// traits from download1 page below.
if (fileInfo[0] == null) {
fileInfo[0] = new Regex(correctedBR, "Filename:? ?(<[^>]+> ?)+?([^<>\"\\']+)").getMatch(1);
// next two are details from sharing box
if (fileInfo[0] == null) {
fileInfo[0] = new Regex(correctedBR, "copy\\(this\\);.+>(.+) \\- [\\d\\.]+ (KB|MB|GB)</a></textarea>[\r\n\t ]+</div>").getMatch(0);
if (fileInfo[0] == null) {
fileInfo[0] = new Regex(correctedBR, "copy\\(this\\);.+\\](.+) \\- [\\d\\.]+ (KB|MB|GB)\\[/URL\\]").getMatch(0);
}
}
}
}
}
}
}
if (fileInfo[1] == null) {
fileInfo[1] = new Regex(correctedBR, "\\(([0-9]+ bytes)\\)").getMatch(0);
if (fileInfo[1] == null) {
fileInfo[1] = new Regex(correctedBR, "</font>[ ]+\\(([^<>\"\\'/]+)\\)(.*?)</font>").getMatch(0);
if (fileInfo[1] == null) {
fileInfo[1] = new Regex(correctedBR, "([\\d\\.]+ ?(KB|MB|GB))").getMatch(0);
}
}
}
if (fileInfo[2] == null) fileInfo[2] = new Regex(correctedBR, "<b>MD5.*?</b>.*?nowrap>(.*?)<").getMatch(0);
return fileInfo;
}
@Override
public void handleFree(DownloadLink downloadLink) throws Exception, PluginException {
requestFileInformation(downloadLink);
doFree(downloadLink, false, 1, "freelink");
doFree(downloadLink, true, 0, "freelink");
}
public void doFree(DownloadLink downloadLink, boolean resumable, int maxchunks, String directlinkproperty) throws Exception, PluginException {
@ -165,8 +199,10 @@ public class CoralDriveNet extends PluginForHost {
// 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");
Form download1 = getFormByKey("op", "download1");
if (download1 != null) {
download1.remove("method_premium");
sendForm(download1);
checkErrors(downloadLink, false, passCode);
}
dllink = getDllink();
@ -174,7 +210,9 @@ public class CoralDriveNet extends PluginForHost {
if (dllink == null) {
Form dlForm = br.getFormbyProperty("name", "F1");
if (dlForm == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
for (int i = 0; i <= 3; i++) {
// 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;
@ -192,14 +230,14 @@ public class CoralDriveNet extends PluginForHost {
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();
String[][] letters = new Regex(br, "<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]);
capMap.put(Integer.parseInt(letter[0]), Encoding.htmlDecode(letter[1]));
}
StringBuilder code = new StringBuilder();
for (String value : capMap.values()) {
@ -253,12 +291,12 @@ public class CoralDriveNet extends PluginForHost {
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=\"\"")) {
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;
}
@ -274,12 +312,44 @@ public class CoralDriveNet extends PluginForHost {
}
downloadLink.setProperty(directlinkproperty, dllink);
if (passCode != null) downloadLink.setProperty("pass", passCode);
dl.startDownload();
try {
// add a download slot
controlFree(+1);
// start the dl
dl.startDownload();
} finally {
// remove download slot
controlFree(-1);
}
}
@Override
public int getMaxSimultanFreeDownloadNum() {
return 1;
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 */
@ -288,7 +358,7 @@ public class CoralDriveNet extends PluginForHost {
ArrayList<String> someStuff = new ArrayList<String>();
ArrayList<String> regexStuff = new ArrayList<String>();
regexStuff.add("<\\!(\\-\\-.*?\\-\\-)>");
regexStuff.add("(display: none;\">.*?</div>)");
regexStuff.add("(display: ?none;\">.*?</div>)");
regexStuff.add("(visibility:hidden>.*?<)");
for (String aRegex : regexStuff) {
String lolz[] = br.getRegex(aRegex).getColumn(0);
@ -312,13 +382,21 @@ public class CoralDriveNet extends PluginForHost {
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);
dllink = new Regex(correctedBR, "<a href=\"(https?://[^\"]+)\"[^>]+>(Click to Download|Download File)").getMatch(0);
// generic fail over for COOKIE_HOST on final link
// format.
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;
// dllink = new Regex(correctedBR,
// "(https?://[^/]+/cgi\\-bin/dl\\.cgi/[a-z0-9]+/[^\"\\']+)").getMatch(0);
// dllink = new Regex(correctedBR,
// "(https?://[^/]+/files/\\d+/[a-z0-9]+/[^\"\\']+)").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;
}
}
}
}
@ -357,9 +435,9 @@ public class CoralDriveNet extends PluginForHost {
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()) {
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 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);
@ -385,7 +463,7 @@ public class CoralDriveNet extends PluginForHost {
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()) {
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();
@ -467,156 +545,6 @@ public class CoralDriveNet extends PluginForHost {
return dllink;
}
@Override
public AccountInfo fetchAccountInfo(Account account) throws Exception {
AccountInfo ai = new AccountInfo();
/* reset maxPrem workaround on every fetchaccount info */
maxPrem.set(1);
try {
login(account, true);
} catch (PluginException e) {
account.setValid(false);
return ai;
}
String space = new Regex(correctedBR, "<td>Used space:</td>.*?<td.*?b>([0-9\\.]+) of [0-9\\.]+ (Mb|GB)</b>").getMatch(0);
if (space != null) ai.setUsedSpace(space.trim() + " Mb");
account.setValid(true);
String availabletraffic = new Regex(correctedBR, "Traffic available.*?:</TD><TD><b>([^<>\"\\']+)</b>").getMatch(0);
if (availabletraffic != null && !availabletraffic.contains("nlimited") && !availabletraffic.equalsIgnoreCase(" Mb")) {
ai.setTrafficLeft(SizeFormatter.getSize(availabletraffic));
} else {
ai.setUnlimitedTraffic();
}
if (account.getBooleanProperty("nopremium")) {
ai.setStatus("Registered (free) User");
try {
maxPrem.set(1);
account.setMaxSimultanDownloads(1);
account.setConcurrentUsePossible(false);
} catch (final Throwable e) {
}
} else {
String expire = new Regex(correctedBR, Pattern.compile("<td>Premium(\\-| )Account expires?:</td>.*?<td>(<b>)?(\\d{1,2} [A-Za-z]+ \\d{4})(</b>)?</td>", Pattern.CASE_INSENSITIVE)).getMatch(2);
if (expire == null) {
ai.setExpired(true);
account.setValid(false);
return ai;
} else {
expire = expire.replaceAll("(<b>|</b>)", "");
ai.setValidUntil(TimeFormatter.getMilliSeconds(expire, "dd MMMM yyyy", null));
try {
maxPrem.set(-1);
account.setMaxSimultanDownloads(-1);
account.setConcurrentUsePossible(true);
} catch (final Throwable e) {
}
}
ai.setStatus("Premium User");
}
return ai;
}
@Override
public void handlePremium(DownloadLink link, Account account) throws Exception {
String passCode = null;
requestFileInformation(link);
login(account, false);
br.setFollowRedirects(false);
String dllink = null;
if (account.getBooleanProperty("nopremium")) {
getPage(link.getDownloadURL());
doFree(link, false, 1, "freelink2");
} else {
dllink = checkDirectLink(link, "premlink");
if (dllink == null) {
getPage(link.getDownloadURL());
dllink = getDllink();
if (dllink == null) {
checkErrors(link, true, passCode);
Form dlform = br.getFormbyProperty("name", "F1");
if (dlform == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
if (new Regex(correctedBR, PASSWORDTEXT).matches()) passCode = handlePassword(passCode, dlform, link);
sendForm(dlform);
dllink = getDllink();
checkErrors(link, true, passCode);
}
}
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, link, dllink, true, 0);
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);
}
if (passCode != null) link.setProperty("pass", passCode);
link.setProperty("premlink", dllink);
dl.startDownload();
}
}
@SuppressWarnings("unchecked")
private void login(Account account, boolean force) throws Exception {
synchronized (LOCK) {
try {
/** Load cookies */
br.setCookiesExclusive(true);
final Object ret = account.getProperty("cookies", null);
boolean acmatch = Encoding.urlEncode(account.getUser()).equals(account.getStringProperty("name", Encoding.urlEncode(account.getUser())));
if (acmatch) acmatch = Encoding.urlEncode(account.getPass()).equals(account.getStringProperty("pass", Encoding.urlEncode(account.getPass())));
if (acmatch && ret != null && ret instanceof HashMap<?, ?> && !force) {
final HashMap<String, String> cookies = (HashMap<String, String>) ret;
if (account.isValid()) {
for (final Map.Entry<String, String> cookieEntry : cookies.entrySet()) {
final String key = cookieEntry.getKey();
final String value = cookieEntry.getValue();
this.br.setCookie(COOKIE_HOST, key, value);
}
return;
}
}
prepBrowser();
getPage(COOKIE_HOST + "/login.html");
Form loginform = br.getForm(0);
if (loginform == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
loginform.put("login", Encoding.urlEncode(account.getUser()));
loginform.put("password", Encoding.urlEncode(account.getPass()));
sendForm(loginform);
if (br.getCookie(COOKIE_HOST, "login") == null || br.getCookie(COOKIE_HOST, "xfss") == null) throw new PluginException(LinkStatus.ERROR_PREMIUM, PluginException.VALUE_ID_PREMIUM_DISABLE);
getPage(COOKIE_HOST + "/?op=my_account");
if (!new Regex(correctedBR, "(?i)(Premium(\\-| )Account expire|Upgrade to premium|>Renew premium<)").matches()) throw new PluginException(LinkStatus.ERROR_PREMIUM, PluginException.VALUE_ID_PREMIUM_DISABLE);
if (!new Regex(correctedBR, "(?i)(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);
for (final Cookie c : add.getCookies()) {
cookies.put(c.getKey(), c.getValue());
}
account.setProperty("name", Encoding.urlEncode(account.getUser()));
account.setProperty("pass", Encoding.urlEncode(account.getPass()));
account.setProperty("cookies", cookies);
} catch (final PluginException e) {
account.setProperty("cookies", Property.NULL);
throw e;
}
}
}
@Override
public int getMaxSimultanPremiumDownloadNum() {
/* workaround for free/premium issue on stable 09581 */
return maxPrem.get();
}
@Override
public void reset() {
}
@ -637,4 +565,28 @@ public class CoralDriveNet extends PluginForHost {
}
}
// TODO: remove this when v2 becomes stable. use br.getFormbyKey(String key,
// String value)
/**
* Returns the first form that has a 'key' that equals 'value'.
*
* @param key
* @param value
* @return
*/
private Form getFormByKey(final String key, final String value) {
Form[] workaround = br.getForms();
if (workaround != null) {
for (Form f : workaround) {
for (InputField field : f.getInputFields()) {
if (key != null && key.equals(field.getKey())) {
if (value == null && field.getValue() == null) return f;
if (value != null && value.equals(field.getValue())) return f;
}
}
}
}
return null;
}
}

View File

@ -51,6 +51,8 @@ public class KongsiFileCom extends PluginForHost {
private static final String PASSWORDTEXT = "<br><b>Passwor(d|t):</b> <input";
private final String COOKIE_HOST = "http://kongsifile.com";
private static final String MAINTENANCE = ">This server is in maintenance mode";
private static final String COUNTRYBLOCKED = ">Downloads are currently unavailable for your country";
private static final String COUNTRYBLOCKEDUSERTEXT = JDL.L("hoster.kongsifilecom.countryblocked", "Your country is blocked!");
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:");
@ -107,15 +109,20 @@ public class KongsiFileCom extends PluginForHost {
br.setFollowRedirects(false);
prepBrowser();
getPage(link.getDownloadURL());
if (new Regex(correctedBR, "(No such file|>File Not Found<|>The file was removed by|Reason (of|for) deletion:\n)").matches()) throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
if (new Regex(correctedBR, "(No such file|>File Not Found<|>The file was removed by|Reason (of|for) deletion:\n|This file was either in breach of a copyright holder or deleted by the uploader)").matches()) throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
if (correctedBR.contains(MAINTENANCE)) {
link.getLinkStatus().setStatusText(JDL.L("plugins.hoster.xfilesharingprobasic.undermaintenance", MAINTENANCEUSERTEXT));
link.getLinkStatus().setStatusText(MAINTENANCEUSERTEXT);
return AvailableStatus.TRUE;
}
if (correctedBR.contains(COUNTRYBLOCKED)) {
link.getLinkStatus().setStatusText(COUNTRYBLOCKEDUSERTEXT);
return AvailableStatus.TRUE;
}
String[] fileInfo = new String[3];
// scan the first page
scanInfo(fileInfo);
// scan the second page. filesize[1] and md5hash[2] are not mission critical
// scan the second page. filesize[1] and md5hash[2] are not mission
// critical
if (fileInfo[0] == null) {
Form download1 = getFormByKey("op", "download1");
if (download1 != null) {
@ -322,14 +329,19 @@ public class KongsiFileCom extends PluginForHost {
}
/**
* 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.
* 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.
* 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)
@ -371,10 +383,13 @@ public class KongsiFileCom extends PluginForHost {
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);
// generic fail over for COOKIE_HOST on final link format.
// generic fail over for COOKIE_HOST on final link
// format.
if (dllink == null) {
// dllink = new Regex(correctedBR, "(https?://[^/]+/cgi\\-bin/dl\\.cgi/[a-z0-9]+/[^\"\\']+)").getMatch(0);
// dllink = new Regex(correctedBR, "(https?://[^/]+/files/\\d+/[a-z0-9]+/[^\"\\']+)").getMatch(0);
// dllink = new Regex(correctedBR,
// "(https?://[^/]+/cgi\\-bin/dl\\.cgi/[a-z0-9]+/[^\"\\']+)").getMatch(0);
// dllink = new Regex(correctedBR,
// "(https?://[^/]+/files/\\d+/[a-z0-9]+/[^\"\\']+)").getMatch(0);
if (dllink == null) {
String cryptedScripts[] = new Regex(correctedBR, "p\\}\\((.*?)\\.split\\('\\|'\\)").getColumn(0);
if (cryptedScripts != null && cryptedScripts.length != 0) {
@ -460,6 +475,7 @@ public class KongsiFileCom extends PluginForHost {
}
}
if (correctedBR.contains(MAINTENANCE)) throw new PluginException(LinkStatus.ERROR_TEMPORARILY_UNAVAILABLE, MAINTENANCEUSERTEXT, 2 * 60 * 60 * 1000l);
if (correctedBR.contains(COUNTRYBLOCKED)) throw new PluginException(LinkStatus.ERROR_HOSTER_TEMPORARILY_UNAVAILABLE, COUNTRYBLOCKEDUSERTEXT, 4 * 60 * 60 * 1000l);
}
public void checkServerErrors() throws NumberFormatException, PluginException {
@ -550,7 +566,8 @@ public class KongsiFileCom extends PluginForHost {
}
}
// TODO: remove this when v2 becomes stable. use br.getFormbyKey(String key, String value)
// TODO: remove this when v2 becomes stable. use br.getFormbyKey(String key,
// String value)
/**
* Returns the first form that has a 'key' that equals 'value'.
*

View File

@ -1,437 +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 = { "movbay.org" }, urls = { "http://(www\\.)?movbay\\.org/[a-z0-9]{12}" }, flags = { 0 })
public class MovBayOrg extends PluginForHost {
private String BRBEFORE = "";
private static final String PASSWORDTEXT = "(<br><b>Password:</b> <input|<br><b>Passwort:</b> <input)";
private static final String COOKIE_HOST = "http://movbay.org";
public boolean NOPREMIUM = false;
public MovBayOrg(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 (new Regex(BRBEFORE, PASSWORDTEXT).matches() || 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 (new Regex(BRBEFORE, "( 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(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 (new Regex(BRBEFORE, "(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 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) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
long timeBefore = System.currentTimeMillis();
boolean password = false;
boolean skipWaittime = false;
if (new Regex(BRBEFORE, PASSWORDTEXT).matches()) {
password = true;
logger.info("The downloadlink seems to be password protected.");
}
/* 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 (new Regex(BRBEFORE, "(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.parse();
rc.load();
File cf = rc.downloadCaptcha(getLocalCaptchaFile());
String c = getCaptchaCode(cf, downloadLink);
waitTime(timeBefore, 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();
// waittime 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);
}
String finalfilename = new Regex(BRBEFORE, "<h3>Watch (.*?)</h3>").getMatch(0);
if (finalfilename != null) downloadLink.setFinalFileName(finalfilename);
}
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.3.0.0, added a filesize regex, don't set
// finalfilename in availablecheck
@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() {
// Hoster allows 3 connections at all
return 1;
}
@Override
public void handleFree(DownloadLink downloadLink) throws Exception, PluginException {
requestFileInformation(downloadLink);
// Hoster allows 3 connections at all
doFree(downloadLink, true, -3);
}
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 (new Regex(BRBEFORE, "(No such file|File not found|>File Not Found<|>The file was removed by|Reason (of|for) deletion:\n)").matches()) {
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://(www\\.)?" + COOKIE_HOST.replace("http://", "") + "/[a-z0-9]{12}/(.*?)</font>").getMatch(1);
if (filename == null) {
filename = new Regex(BRBEFORE, "fname\"( type=\"hidden\")? value=\"(.*?)\"").getMatch(1);
if (filename == null) {
filename = new Regex(BRBEFORE, "<h2>Download File(.*?)</h2>").getMatch(0);
if (filename == null) {
filename = new Regex(BRBEFORE, "Filename:</b></td><td[ ]{0,2}>(.*?)</td>").getMatch(0);
if (filename == null) {
filename = new Regex(BRBEFORE, "Filename.*?nowrap.*?>(.*?)</td").getMatch(0);
if (filename == null) {
filename = new Regex(BRBEFORE, "File Name.*?nowrap>(.*?)</td").getMatch(0);
if (filename == null) {
filename = new Regex(BRBEFORE, "<Title>Download (.*?)</Title>").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 (filename == null || filename.equals("")) {
if (BRBEFORE.contains("You have reached the download-limit")) {
logger.warning("Waittime detected, please reconnect to make the linkchecker work!");
return AvailableStatus.UNCHECKABLE;
}
logger.warning("The filename equals null, throwing \"plugin defect\" now...");
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
filename = filename.replaceAll("(</b>|<b>|\\.html)", "");
link.setName(filename.trim());
if (filesize != null && !filesize.equals("")) {
logger.info("Filesize found, filesize = " + filesize);
link.setDownloadSize(SizeFormatter.getSize(filesize));
}
return AvailableStatus.TRUE;
}
@Override
public void reset() {
}
@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

@ -74,8 +74,8 @@ public class PornHubCom extends PluginForHost {
br.getPage(downloadLink.getDownloadURL());
if (br.getURL().equals("http://www.pornhub.com/") || !br.containsHTML("\\.swf")) throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
dlUrl = null;
String file_name = br.getRegex("class=\"section_bar\"><h1 class=\"section_title\">([^<>/]*?)</h1>").getMatch(0);
if (file_name == null) file_name = br.getRegex("<title([^<>/]*?) \\- Pornhub\\.com</title>").getMatch(0);
String file_name = br.getRegex("class=\"section_bar\"><h1 class=\"section_title\">([^<>]*?)</h1>").getMatch(0);
if (file_name == null) file_name = br.getRegex("<title([^<>]*?) \\- Pornhub\\.com</title>").getMatch(0);
if (file_name == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
String[] linksplit = downloadLink.getDownloadURL().split("=");
final String video_id = linksplit[linksplit.length - 1];

View File

@ -29,7 +29,7 @@ import jd.plugins.LinkStatus;
import jd.plugins.PluginException;
import jd.plugins.PluginForHost;
@HostPlugin(revision = "$Revision$", interfaceVersion = 2, names = { "pornrabbit.com" }, urls = { "http://(www\\.)?pornrabbit\\.com/(\\d+/[a-z0-9_\\-]+\\.html|video/\\d+/)" }, flags = { 0 })
@HostPlugin(revision = "$Revision$", interfaceVersion = 2, names = { "pornrabbit.com" }, urls = { "http://(www\\.)?pornrabbitdecrypted\\.com/(\\d+/[a-z0-9_\\-]+\\.html|video/\\d+/)" }, flags = { 0 })
public class PornRabbitCom extends PluginForHost {
private String DLLINK = null;
@ -48,6 +48,10 @@ public class PornRabbitCom extends PluginForHost {
return -1;
}
public void correctDownloadLink(DownloadLink link) {
link.setUrlDownload(link.getDownloadURL().replace("pornrabbitdecrypted.com/", "pornrabbit.com/"));
}
@Override
public AvailableStatus requestFileInformation(DownloadLink downloadLink) throws IOException, PluginException {
this.setBrowserExclusive();

View File

@ -19,6 +19,9 @@ package jd.plugins.hoster;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.SortedMap;
import java.util.TreeMap;
import java.util.concurrent.atomic.AtomicInteger;
@ -27,11 +30,15 @@ import java.util.regex.Pattern;
import jd.PluginWrapper;
import jd.config.Property;
import jd.http.Browser;
import jd.http.Cookie;
import jd.http.Cookies;
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.Account;
import jd.plugins.AccountInfo;
import jd.plugins.DownloadLink;
import jd.plugins.DownloadLink.AvailableStatus;
import jd.plugins.HostPlugin;
@ -43,8 +50,9 @@ import jd.utils.JDUtilities;
import jd.utils.locale.JDL;
import org.appwork.utils.formatter.SizeFormatter;
import org.appwork.utils.formatter.TimeFormatter;
@HostPlugin(revision = "$Revision$", interfaceVersion = 2, names = { "project-free-upload.com" }, urls = { "https?://(www\\.)?project\\-free\\-upload\\.com/[a-z0-9]{12}" }, flags = { 0 })
@HostPlugin(revision = "$Revision$", interfaceVersion = 2, names = { "project-free-upload.com" }, urls = { "https?://(www\\.)?project\\-free\\-upload\\.com/[a-z0-9]{12}" }, flags = { 2 })
public class ProjectFreeUploadCom extends PluginForHost {
private String correctedBR = "";
@ -59,13 +67,15 @@ public class ProjectFreeUploadCom extends PluginForHost {
private static AtomicInteger totalMaxSimultanFreeDownload = new AtomicInteger(20);
// don't touch
private static AtomicInteger maxFree = new AtomicInteger(1);
private static AtomicInteger maxPrem = new AtomicInteger(1);
private static final Object LOCK = new Object();
// DEV NOTES
// XfileSharingProBasic Version 2.5.6.6-raz
// mods:
// non account: 2 * 1
// free account:
// premium account:
// free account: 2 * 2
// premium account: untested, set standard limit
// protocol: http && https
// captchatype: null
// other: no redirects
@ -77,7 +87,7 @@ public class ProjectFreeUploadCom extends PluginForHost {
public ProjectFreeUploadCom(PluginWrapper wrapper) {
super(wrapper);
// this.enablePremium(COOKIE_HOST + "/premium.html");
this.enablePremium(COOKIE_HOST + "/premium.html");
}
// do not add @Override here to keep 0.* compatibility
@ -110,7 +120,8 @@ public class ProjectFreeUploadCom extends PluginForHost {
String[] fileInfo = new String[3];
// scan the first page
scanInfo(fileInfo);
// scan the second page. filesize[1] and md5hash[2] are not mission critical
// scan the second page. filesize[1] and md5hash[2] are not mission
// critical
if (fileInfo[0] == null) {
Form download1 = getFormByKey("op", "download1");
if (download1 != null) {
@ -317,14 +328,19 @@ public class ProjectFreeUploadCom extends PluginForHost {
}
/**
* 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.
* 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.
* 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)
@ -366,10 +382,13 @@ public class ProjectFreeUploadCom extends PluginForHost {
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);
// generic fail over for COOKIE_HOST on final link format.
// generic fail over for COOKIE_HOST on final link
// format.
if (dllink == null) {
// dllink = new Regex(correctedBR, "(https?://[^/]+/cgi\\-bin/dl\\.cgi/[a-z0-9]+/[^\"\\']+)").getMatch(0);
// dllink = new Regex(correctedBR, "(https?://[^/]+/files/\\d+/[a-z0-9]+/[^\"\\']+)").getMatch(0);
// dllink = new Regex(correctedBR,
// "(https?://[^/]+/cgi\\-bin/dl\\.cgi/[a-z0-9]+/[^\"\\']+)").getMatch(0);
// dllink = new Regex(correctedBR,
// "(https?://[^/]+/files/\\d+/[a-z0-9]+/[^\"\\']+)").getMatch(0);
if (dllink == null) {
String cryptedScripts[] = new Regex(correctedBR, "p\\}\\((.*?)\\.split\\('\\|'\\)").getColumn(0);
if (cryptedScripts != null && cryptedScripts.length != 0) {
@ -525,6 +544,158 @@ public class ProjectFreeUploadCom extends PluginForHost {
return dllink;
}
@Override
public AccountInfo fetchAccountInfo(Account account) throws Exception {
AccountInfo ai = new AccountInfo();
/* reset maxPrem workaround on every fetchaccount info */
maxPrem.set(1);
try {
login(account, true);
} catch (PluginException e) {
account.setValid(false);
return ai;
}
String space[][] = new Regex(correctedBR, "<td>Used space:</td>.*?<td.*?b>([0-9\\.]+) of [0-9\\.]+ (KB|MB|GB|TB)</b>").getMatches();
if ((space != null && space.length != 0) && (space[0][0] != null && space[0][1] != null)) ai.setUsedSpace(space[0][0] + " " + space[0][1]);
account.setValid(true);
String availabletraffic = new Regex(correctedBR, "Traffic available.*?:</TD><TD><b>([^<>\"\\']+)</b>").getMatch(0);
if (availabletraffic != null && !availabletraffic.contains("nlimited") && !availabletraffic.equalsIgnoreCase(" Mb")) {
ai.setTrafficLeft(SizeFormatter.getSize(availabletraffic));
} else {
ai.setUnlimitedTraffic();
}
if (account.getBooleanProperty("nopremium")) {
ai.setStatus("Registered (free) User");
try {
maxPrem.set(2);
// free accounts can still have captcha.
totalMaxSimultanFreeDownload.set(maxPrem.get());
account.setMaxSimultanDownloads(maxPrem.get());
account.setConcurrentUsePossible(false);
} catch (final Throwable e) {
}
} else {
String expire = new Regex(correctedBR, "<td>Premium(\\-| )Account expires?:</td>.*?<td>(<b>)?(\\d{1,2} [A-Za-z]+ \\d{4})(</b>)?</td>").getMatch(2);
if (expire == null) expire = new Regex(correctedBR, "(\\d{1,2} [A-Za-z]+ \\d{4})").getMatch(0);
if (expire == null) {
ai.setExpired(true);
account.setValid(false);
return ai;
} else {
expire = expire.replaceAll("(<b>|</b>)", "");
ai.setValidUntil(TimeFormatter.getMilliSeconds(expire, "dd MMMM yyyy", Locale.ENGLISH));
try {
maxPrem.set(1);
account.setMaxSimultanDownloads(maxPrem.get());
account.setConcurrentUsePossible(true);
} catch (final Throwable e) {
}
}
ai.setStatus("Premium User");
}
return ai;
}
@SuppressWarnings("unchecked")
private void login(Account account, boolean force) throws Exception {
synchronized (LOCK) {
try {
/** Load cookies */
br.setCookiesExclusive(true);
prepBrowser();
final Object ret = account.getProperty("cookies", null);
boolean acmatch = Encoding.urlEncode(account.getUser()).equals(account.getStringProperty("name", Encoding.urlEncode(account.getUser())));
if (acmatch) acmatch = Encoding.urlEncode(account.getPass()).equals(account.getStringProperty("pass", Encoding.urlEncode(account.getPass())));
if (acmatch && ret != null && ret instanceof HashMap<?, ?> && !force) {
final HashMap<String, String> cookies = (HashMap<String, String>) ret;
if (account.isValid()) {
for (final Map.Entry<String, String> cookieEntry : cookies.entrySet()) {
final String key = cookieEntry.getKey();
final String value = cookieEntry.getValue();
this.br.setCookie(COOKIE_HOST, key, value);
}
return;
}
}
getPage(COOKIE_HOST + "/login.html");
Form loginform = br.getFormbyProperty("name", "FL");
if (loginform == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
loginform.put("login", Encoding.urlEncode(account.getUser()));
loginform.put("password", Encoding.urlEncode(account.getPass()));
sendForm(loginform);
if (br.getCookie(COOKIE_HOST, "login") == null || br.getCookie(COOKIE_HOST, "xfss") == null) throw new PluginException(LinkStatus.ERROR_PREMIUM, PluginException.VALUE_ID_PREMIUM_DISABLE);
getPage(COOKIE_HOST + "/?op=my_account");
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);
for (final Cookie c : add.getCookies()) {
cookies.put(c.getKey(), c.getValue());
}
account.setProperty("name", Encoding.urlEncode(account.getUser()));
account.setProperty("pass", Encoding.urlEncode(account.getPass()));
account.setProperty("cookies", cookies);
} catch (final PluginException e) {
account.setProperty("cookies", Property.NULL);
throw e;
}
}
}
@Override
public void handlePremium(DownloadLink link, Account account) throws Exception {
String passCode = null;
requestFileInformation(link);
login(account, false);
br.setFollowRedirects(false);
String dllink = null;
if (account.getBooleanProperty("nopremium")) {
getPage(link.getDownloadURL());
doFree(link, true, -2, "freelink2");
} else {
dllink = checkDirectLink(link, "premlink");
if (dllink == null) {
getPage(link.getDownloadURL());
dllink = getDllink();
if (dllink == null) {
checkErrors(link, true, passCode);
Form dlform = br.getFormbyProperty("name", "F1");
if (dlform == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
if (new Regex(correctedBR, PASSWORDTEXT).matches()) passCode = handlePassword(passCode, dlform, link);
sendForm(dlform);
dllink = getDllink();
checkErrors(link, true, passCode);
}
}
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, link, dllink, true, -10);
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);
}
if (passCode != null) link.setProperty("pass", passCode);
link.setProperty("premlink", dllink);
dl.startDownload();
}
}
@Override
public int getMaxSimultanPremiumDownloadNum() {
/* workaround for free/premium issue on stable 09581 */
return maxPrem.get();
}
@Override
public void reset() {
}
@ -545,7 +716,8 @@ public class ProjectFreeUploadCom extends PluginForHost {
}
}
// TODO: remove this when v2 becomes stable. use br.getFormbyKey(String key, String value)
// TODO: remove this when v2 becomes stable. use br.getFormbyKey(String key,
// String value)
/**
* Returns the first form that has a 'key' that equals 'value'.
*

View File

@ -155,26 +155,9 @@ public class UploadozCom extends PluginForHost {
private String[] scanInfo(String[] fileInfo) {
// standard traits from base page
if (fileInfo[0] == null) {
fileInfo[0] = new Regex(correctedBR, "You have requested.*?https?://(www\\.)?" + this.getHost() + "/[A-Za-z0-9]{12}/(.*?)</font>").getMatch(1);
fileInfo[0] = new Regex(correctedBR, "<h3>Download File : ([^<>\"]*?)\\&nbsp; <small>").getMatch(0);
if (fileInfo[0] == null) {
fileInfo[0] = new Regex(correctedBR, "fname\"( type=\"hidden\")? value=\"(.*?)\"").getMatch(1);
if (fileInfo[0] == null) {
fileInfo[0] = new Regex(correctedBR, "<h2>Download File(.*?)</h2>").getMatch(0);
if (fileInfo[0] == null) {
fileInfo[0] = new Regex(correctedBR, "Download File:? ?(<[^>]+> ?)+?([^<>\"\\']+)").getMatch(1);
// traits from download1 page below.
if (fileInfo[0] == null) {
fileInfo[0] = new Regex(correctedBR, "Filename:? ?(<[^>]+> ?)+?([^<>\"\\']+)").getMatch(1);
// next two are details from sharing box
if (fileInfo[0] == null) {
fileInfo[0] = new Regex(correctedBR, "copy\\(this\\);.+>(.+) \\- [\\d\\.]+ (KB|MB|GB)</a></textarea>[\r\n\t ]+</div>").getMatch(0);
if (fileInfo[0] == null) {
fileInfo[0] = new Regex(correctedBR, "copy\\(this\\);.+\\](.+) \\- [\\d\\.]+ (KB|MB|GB)\\[/URL\\]").getMatch(0);
}
}
}
}
}
fileInfo[0] = new Regex(correctedBR, "cols=24 rows=3 onFocus=\"copy\\(this\\);\">http://(www\\.)?uploadoz\\.com/[a-z0-9]{12}/([^<>\"]*?)\\.html</textarea>").getMatch(1);
}
}
if (fileInfo[1] == null) {

View File

@ -125,7 +125,7 @@ public class XFileSharingProBasic extends PluginForHost {
getPage(link.getDownloadURL());
if (new Regex(correctedBR, "(No such file|>File Not Found<|>The file was removed by|Reason (of|for) deletion:\n)").matches()) throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
if (correctedBR.contains(MAINTENANCE)) {
link.getLinkStatus().setStatusText(JDL.L("plugins.hoster.xfilesharingprobasic.undermaintenance", MAINTENANCEUSERTEXT));
link.getLinkStatus().setStatusText(MAINTENANCEUSERTEXT);
return AvailableStatus.TRUE;
}
String[] fileInfo = new String[3];