- new hoster: biggerupload.com

- deleted hoster: qsave.info
- updated services info in 6giga.coms' jacinfo (-rapidshark.pl -6giga.com -qsave.info)
- 6giga.com: changed captcha method, other fixes
- fixed tickettime, minor fixes: enterupload.com, 6giga.com, only4files.com, fileuploadshark.com, xshareware.com, sharearound.com, savefile.ro, pixelhit.com, bagruj.cz
minor changes: rapidshark.pl, usershare.net

git-svn-id: svn://svn.jdownloader.org/jdownloader/trunk@6218 ebf7c1c2-ba36-0410-9fe8-c592906822b4
This commit is contained in:
ManiacMansion 2009-06-14 22:41:37 +00:00
parent a731b05aee
commit 4ecd28c465
15 changed files with 151 additions and 146 deletions

View File

@ -1,4 +1,4 @@
<jDownloader> <jDownloader>
<method name="Base-Method for many hosters" author="ManiacMansion" services="6giga.com;bagruj.cz;enterupload.com;filelobster.com;fileuploadshark.com;only4files.com;pixelhit.com;qsave.info;rapidshark.pl;savefile.ro;sharearound.com;xshareware.com"/> <method name="Base-Method for many hosters" author="ManiacMansion" services="bagruj.cz;enterupload.com;filelobster.com;fileuploadshark.com;only4files.com;pixelhit.com;savefile.ro;sharearound.com;xshareware.com"/>
<format type="jpg" letterNum="4"/> <format type="jpg" letterNum="4"/>
</jDownloader> </jDownloader>

View File

@ -592,11 +592,11 @@ public class JDInit {
new HostPluginWrapper("Only4files.com", "OnlyFourFilesCom", "http://[\\w\\.]*?only4files\\.com/[\\w]+/.*"); new HostPluginWrapper("Only4files.com", "OnlyFourFilesCom", "http://[\\w\\.]*?only4files\\.com/[\\w]+/.*");
new HostPluginWrapper("Fileuploadshark.com", "FileuploadsharkCom", "http://[\\w\\.]*?fileuploadshark\\.com/[\\w]+/?"); new HostPluginWrapper("Fileuploadshark.com", "FileuploadsharkCom", "http://[\\w\\.]*?fileuploadshark\\.com/[\\w]+/?");
new HostPluginWrapper("Xshareware.com", "XsharewareCom", "http://[\\w\\.]*?xshareware\\.com/[\\w]+/.*"); new HostPluginWrapper("Xshareware.com", "XsharewareCom", "http://[\\w\\.]*?xshareware\\.com/[\\w]+/.*");
new HostPluginWrapper("Qsave.info", "QsaveInfo", "http://[\\w\\.]*?qsave\\.info/[\\w]+/?");
new HostPluginWrapper("Savefile.ro", "SavefileRo", "http://[\\w\\.]*?savefile\\.ro/[\\w]+/?"); new HostPluginWrapper("Savefile.ro", "SavefileRo", "http://[\\w\\.]*?savefile\\.ro/[\\w]+/?");
new HostPluginWrapper("Pixelhit.com", "PixelhitCom", "http://[\\w\\.]*?pixelhit\\.com/[\\w]+/?"); new HostPluginWrapper("Pixelhit.com", "PixelhitCom", "http://[\\w\\.]*?pixelhit\\.com/[\\w]+/?");
new HostPluginWrapper("Bagruj.cz", "BagrujCz", "http://[\\w\\.]*?bagruj\\.cz/.*"); new HostPluginWrapper("Bagruj.cz", "BagrujCz", "http://[\\w\\.]*?bagruj\\.cz/.*");
new HostPluginWrapper("Uploadline.com", "UploadlineCom", "http://[\\w\\.]*?uploadline\\.com/\\d+/.+"); new HostPluginWrapper("Uploadline.com", "UploadlineCom", "http://[\\w\\.]*?uploadline\\.com/\\d+/.+");
new HostPluginWrapper("Biggerupload.com", "BiggeruploadCom", "http://[\\w\\.]*?biggerupload\\.com/[\\w]+/?.*");
new HostPluginWrapper("Ziddu.com", "ZidduCom", "http://[\\w\\.]*?ziddu\\.com/((download/\\d+/.*?\\.html)|(download\\.php\\?uid=[\\w%]+)|downloadfile/\\d+/.*?\\.html)"); new HostPluginWrapper("Ziddu.com", "ZidduCom", "http://[\\w\\.]*?ziddu\\.com/((download/\\d+/.*?\\.html)|(download\\.php\\?uid=[\\w%]+)|downloadfile/\\d+/.*?\\.html)");
// new HostPluginWrapper("FilesDump.com", "FilesDumpCom", // new HostPluginWrapper("FilesDump.com", "FilesDumpCom",
// "http://.*?filesdump\\.com/file/[a-f0-9]+/.*?"); // "http://.*?filesdump\\.com/file/[a-f0-9]+/.*?");

View File

@ -64,7 +64,8 @@ public class BagrujCz extends PluginForHost {
form.put("password", password); form.put("password", password);
} }
// Ticket Time // Ticket Time
this.sleep(15000, downloadLink); int tt = Integer.parseInt(br.getRegex("countdown\">(\\d+)</span>").getMatch(0));
sleep(tt * 1001, downloadLink);
br.submitForm(form); br.submitForm(form);
URLConnectionAdapter con2 = br.getHttpConnection(); URLConnectionAdapter con2 = br.getHttpConnection();
String dllink = br.getRedirectLocation(); String dllink = br.getRedirectLocation();
@ -72,6 +73,7 @@ public class BagrujCz extends PluginForHost {
String error = br.getRegex("class=\"err\">(.*?)</font>").getMatch(0); String error = br.getRegex("class=\"err\">(.*?)</font>").getMatch(0);
if (error != null) { if (error != null) {
logger.warning(error); logger.warning(error);
con2.disconnect();
if (error.equalsIgnoreCase("Wrong captcha") || error.equalsIgnoreCase("Expired session")) { if (error.equalsIgnoreCase("Wrong captcha") || error.equalsIgnoreCase("Expired session")) {
throw new PluginException(LinkStatus.ERROR_CAPTCHA); throw new PluginException(LinkStatus.ERROR_CAPTCHA);
} else { } else {
@ -80,7 +82,8 @@ public class BagrujCz extends PluginForHost {
} }
if (br.containsHTML("Odkaz ke stažení vygenerován")) dllink = br.getRegex("padding:7px;\">\\s+<a\\s+href=\"(.*?)\">").getMatch(0); if (br.containsHTML("Odkaz ke stažení vygenerován")) dllink = br.getRegex("padding:7px;\">\\s+<a\\s+href=\"(.*?)\">").getMatch(0);
} }
dl = br.openDownload(downloadLink, dllink); if (dllink == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFEKT);
dl = br.openDownload(downloadLink, dllink, false, 1);
dl.startDownload(); dl.startDownload();
} }
} }

View File

@ -17,7 +17,9 @@
package jd.plugins.host; package jd.plugins.host;
import java.io.IOException; import java.io.IOException;
import java.util.regex.Pattern; import java.util.Iterator;
import java.util.SortedMap;
import java.util.TreeMap;
import jd.PluginWrapper; import jd.PluginWrapper;
import jd.http.Encoding; import jd.http.Encoding;
@ -30,9 +32,9 @@ import jd.plugins.PluginException;
import jd.plugins.PluginForHost; import jd.plugins.PluginForHost;
import jd.plugins.DownloadLink.AvailableStatus; import jd.plugins.DownloadLink.AvailableStatus;
public class QsaveInfo extends PluginForHost { public class BiggeruploadCom extends PluginForHost {
public QsaveInfo(PluginWrapper wrapper) { public BiggeruploadCom(PluginWrapper wrapper) {
super(wrapper); super(wrapper);
} }
@ -41,7 +43,11 @@ public class QsaveInfo extends PluginForHost {
requestFileInformation(downloadLink); requestFileInformation(downloadLink);
br.setFollowRedirects(false); br.setFollowRedirects(false);
br.setDebug(true); br.setDebug(true);
if (br.containsHTML("You have reached")) { Form form = br.getForm(0);
form.setAction(downloadLink.getDownloadURL());
form.remove("method_premium");
br.submitForm(form);
if (br.containsHTML("You have to wait")) {
int minutes = 0, seconds = 0, hours = 0; int minutes = 0, seconds = 0, hours = 0;
String tmphrs = br.getRegex("\\s+(\\d+)\\s+hours?").getMatch(0); String tmphrs = br.getRegex("\\s+(\\d+)\\s+hours?").getMatch(0);
if (tmphrs != null) hours = Integer.parseInt(tmphrs); if (tmphrs != null) hours = Integer.parseInt(tmphrs);
@ -52,15 +58,27 @@ public class QsaveInfo extends PluginForHost {
int waittime = ((3600 * hours) + (60 * minutes) + seconds + 1) * 1000; int waittime = ((3600 * hours) + (60 * minutes) + seconds + 1) * 1000;
throw new PluginException(LinkStatus.ERROR_IP_BLOCKED, null, waittime); throw new PluginException(LinkStatus.ERROR_IP_BLOCKED, null, waittime);
} else { } else {
Form form = br.getFormbyProperty("name", "F1"); form = br.getFormbyProperty("name", "F1");
if (form == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFEKT); if (form == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFEKT);
// TODO: AntiCaptcha Method would allow simultanous connections
String captchaurl = br.getRegex(Pattern.compile("below:</b></td></tr>\\s+<tr><td>\\s+<img src=\"(.*?)\"", Pattern.DOTALL | Pattern.CASE_INSENSITIVE)).getMatch(0); /* "Captcha Method" */
String code = getCaptchaCode(captchaurl, downloadLink); String[][] letters = br.getRegex("<span style='position:absolute;padding-left:(\\d+)px;padding-top:\\d+px;'>(\\d)</span>").getMatches();
if (letters.length == 0) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFEKT);
SortedMap<Integer, String> capMap = new TreeMap<Integer, String>();
for (String[] letter : letters) {
capMap.put(Integer.parseInt(letter[0]), letter[1]);
}
String code = "";
Iterator<Integer> it = capMap.keySet().iterator();
while (it.hasNext()) {
code += capMap.get(it.next());
}
form.put("code", code); form.put("code", code);
form.setAction(downloadLink.getDownloadURL()); form.setAction(downloadLink.getDownloadURL());
// No Ticket Time // Ticket Time
// this.sleep(15000, downloadLink); int tt = Integer.parseInt(br.getRegex("countdown\">(\\d+)</span>").getMatch(0));
sleep(tt * 1001, downloadLink);
br.submitForm(form); br.submitForm(form);
URLConnectionAdapter con2 = br.getHttpConnection(); URLConnectionAdapter con2 = br.getHttpConnection();
String dllink = br.getRedirectLocation(); String dllink = br.getRedirectLocation();
@ -68,6 +86,7 @@ public class QsaveInfo extends PluginForHost {
String error = br.getRegex("class=\"err\">(.*?)</font>").getMatch(0); String error = br.getRegex("class=\"err\">(.*?)</font>").getMatch(0);
if (error != null) { if (error != null) {
logger.warning(error); logger.warning(error);
con2.disconnect();
if (error.equalsIgnoreCase("Wrong captcha") || error.equalsIgnoreCase("Expired session")) { if (error.equalsIgnoreCase("Wrong captcha") || error.equalsIgnoreCase("Expired session")) {
throw new PluginException(LinkStatus.ERROR_CAPTCHA); throw new PluginException(LinkStatus.ERROR_CAPTCHA);
} else { } else {
@ -76,34 +95,31 @@ public class QsaveInfo extends PluginForHost {
} }
if (br.containsHTML("Download Link Generated")) dllink = br.getRegex("padding:7px;\">\\s+<a\\s+href=\"(.*?)\">").getMatch(0); if (br.containsHTML("Download Link Generated")) dllink = br.getRegex("padding:7px;\">\\s+<a\\s+href=\"(.*?)\">").getMatch(0);
} }
dl = br.openDownload(downloadLink, dllink); if (dllink == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFEKT);
dl = br.openDownload(downloadLink, dllink, false, 1);
dl.startDownload(); dl.startDownload();
} }
} }
// @Override // @Override
// TODO: AntiCaptcha Method would allow simultanous connections
// if user is quick; he can enter captchas one-by-one and then server allow
// him simulatanous downloads
// that's why I left it 10.
public int getMaxSimultanFreeDownloadNum() { public int getMaxSimultanFreeDownloadNum() {
return 10; return 1;
} }
// @Override // @Override
public String getAGBLink() { public String getAGBLink() {
return "http://www.qsave.info/tos.html"; return "http://www.biggerupload.com/tos.html";
} }
// @Override // @Override
public AvailableStatus requestFileInformation(DownloadLink downloadLink) throws IOException, PluginException { public AvailableStatus requestFileInformation(DownloadLink downloadLink) throws IOException, PluginException {
this.setBrowserExclusive(); this.setBrowserExclusive();
br.setCookie("http://www.qsave.info/", "lang", "english"); br.setCookie("http://www.biggerupload.com/", "lang", "english");
br.getPage(downloadLink.getDownloadURL()); br.getPage(downloadLink.getDownloadURL());
if (br.containsHTML("No such file")) throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND); if (br.containsHTML("(No such file)|(No such user)|(Datei nicht gefunden)")) throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
String filename = Encoding.htmlDecode(br.getRegex("Filename:</b></td><td\\s+nowrap>(.*?)</td>").getMatch(0)); String filename = Encoding.htmlDecode(br.getRegex("You\\shave\\srequested\\s<font\\scolor=\"red\">http://[\\w\\.]*?biggerupload\\.com/[a-z0-9]+/(.*?)</font>").getMatch(0));
String filesize = br.getRegex("Size:</b></td><td>(.*?)\\s+<small>").getMatch(0); String filesize = br.getRegex("</font>\\s\\((.*?)\\)</font>").getMatch(0);
if (filename == null || filesize == null) throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND); if (filename == null || filesize == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFEKT);
downloadLink.setName(filename); downloadLink.setName(filename);
downloadLink.setDownloadSize(Regex.getSize(filesize)); downloadLink.setDownloadSize(Regex.getSize(filesize));
return AvailableStatus.TRUE; return AvailableStatus.TRUE;
@ -111,7 +127,7 @@ public class QsaveInfo extends PluginForHost {
// @Override // @Override
public String getVersion() { public String getVersion() {
return getVersion("$Revision$"); return getVersion("$Revision: 5713 $");
} }
// @Override // @Override

View File

@ -58,13 +58,13 @@ public class EnteruploadCom extends PluginForHost {
} else { } else {
form = br.getFormbyProperty("name", "F1"); form = br.getFormbyProperty("name", "F1");
if (form == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFEKT); if (form == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFEKT);
// TODO: AntiCaptcha Method would allow simultanous connections
String captchaurl = br.getRegex(Pattern.compile("<img src=\"(http://www.enterupload.com/captchas/.*?\\.jpg)\">", Pattern.DOTALL | Pattern.CASE_INSENSITIVE)).getMatch(0); String captchaurl = br.getRegex(Pattern.compile("<img src=\"(http://www.enterupload.com/captchas/.*?\\.jpg)\">", Pattern.DOTALL | Pattern.CASE_INSENSITIVE)).getMatch(0);
String code = getCaptchaCode(captchaurl, downloadLink); String code = getCaptchaCode(captchaurl, downloadLink);
form.put("code", code); form.put("code", code);
form.setAction(downloadLink.getDownloadURL()); form.setAction(downloadLink.getDownloadURL());
// Ticket Time // Ticket Time
this.sleep(40500, downloadLink); int tt = Integer.parseInt(br.getRegex("countdown\">(\\d+)</span>").getMatch(0));
sleep(tt * 1001, downloadLink);
br.submitForm(form); br.submitForm(form);
String dllink = br.getRedirectLocation(); String dllink = br.getRedirectLocation();
@ -72,26 +72,21 @@ public class EnteruploadCom extends PluginForHost {
if (error != null) { if (error != null) {
logger.warning(error); logger.warning(error);
if (error.equalsIgnoreCase("Wrong captcha") || error.equalsIgnoreCase("Expired session")) { if (error.equalsIgnoreCase("Wrong captcha") || error.equalsIgnoreCase("Expired session")) {
throw new PluginException(LinkStatus.ERROR_CAPTCHA); throw new PluginException(LinkStatus.ERROR_CAPTCHA);
} else { } else {
throw new PluginException(LinkStatus.ERROR_TEMPORARILY_UNAVAILABLE, error, 10000); throw new PluginException(LinkStatus.ERROR_TEMPORARILY_UNAVAILABLE, error, 10000);
} }
} }
if (br.containsHTML("Download Link Generated")) dllink = br.getRegex("padding:7px;\">\\s+<a\\s+href=\"(.*?)\">").getMatch(0); if (br.containsHTML("Download Link Generated")) dllink = br.getRegex("padding:7px;\">\\s+<a\\s+href=\"(.*?)\">").getMatch(0);
br.setFollowRedirects(true); br.setFollowRedirects(true);
dl = br.openDownload(downloadLink, dllink); if (dllink == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFEKT);
dl = br.openDownload(downloadLink, dllink, false, 1);
dl.startDownload(); dl.startDownload();
} }
} }
// @Override // @Override
// TODO: AntiCaptcha Method would allow simultanous connections
// if user is quick; he can enter captchas one-by-one and then server allow
// him simulatanous downloads
// that's why I left it 10.
public int getMaxSimultanFreeDownloadNum() { public int getMaxSimultanFreeDownloadNum() {
return 10; return 10;
} }

View File

@ -54,13 +54,13 @@ public class FileuploadsharkCom extends PluginForHost {
} else { } else {
Form form = br.getFormbyProperty("name", "F1"); Form form = br.getFormbyProperty("name", "F1");
if (form == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFEKT); if (form == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFEKT);
// TODO: AntiCaptcha Method would allow simultanous connections
String captchaurl = br.getRegex(Pattern.compile("below:</b></td></tr>\\s+<tr><td><img src=\"(.*?)\"", Pattern.DOTALL | Pattern.CASE_INSENSITIVE)).getMatch(0); String captchaurl = br.getRegex(Pattern.compile("below:</b></td></tr>\\s+<tr><td><img src=\"(.*?)\"", Pattern.DOTALL | Pattern.CASE_INSENSITIVE)).getMatch(0);
String code = getCaptchaCode(captchaurl, downloadLink); String code = getCaptchaCode(captchaurl, downloadLink);
form.put("code", code); form.put("code", code);
form.setAction(downloadLink.getDownloadURL()); form.setAction(downloadLink.getDownloadURL());
// Ticket Time // Ticket Time
this.sleep(15000, downloadLink); int tt = Integer.parseInt(br.getRegex("countdown\">(\\d+)</span>").getMatch(0));
sleep(tt * 1001, downloadLink);
br.submitForm(form); br.submitForm(form);
URLConnectionAdapter con2 = br.getHttpConnection(); URLConnectionAdapter con2 = br.getHttpConnection();
String dllink = br.getRedirectLocation(); String dllink = br.getRedirectLocation();
@ -68,6 +68,7 @@ public class FileuploadsharkCom extends PluginForHost {
String error = br.getRegex("class=\"err\">(.*?)</font>").getMatch(0); String error = br.getRegex("class=\"err\">(.*?)</font>").getMatch(0);
if (error != null) { if (error != null) {
logger.warning(error); logger.warning(error);
con2.disconnect();
if (error.equalsIgnoreCase("Wrong captcha") || error.equalsIgnoreCase("Download session expired")) { if (error.equalsIgnoreCase("Wrong captcha") || error.equalsIgnoreCase("Download session expired")) {
throw new PluginException(LinkStatus.ERROR_CAPTCHA); throw new PluginException(LinkStatus.ERROR_CAPTCHA);
} else { } else {
@ -76,16 +77,13 @@ public class FileuploadsharkCom extends PluginForHost {
} }
if (br.containsHTML("Download Link Generated")) dllink = br.getRegex("padding:7px;\">\\s+<a\\s+href=\"(.*?)\">").getMatch(0); if (br.containsHTML("Download Link Generated")) dllink = br.getRegex("padding:7px;\">\\s+<a\\s+href=\"(.*?)\">").getMatch(0);
} }
dl = br.openDownload(downloadLink, dllink); if (dllink == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFEKT);
dl = br.openDownload(downloadLink, dllink, false, 1);
dl.startDownload(); dl.startDownload();
} }
} }
// @Override // @Override
// TODO: AntiCaptcha Method would allow simultanous connections
// if user is quick; he can enter captchas one-by-one and then server allow
// him simulatanous downloads
// that's why I left it 10.
public int getMaxSimultanFreeDownloadNum() { public int getMaxSimultanFreeDownloadNum() {
return 10; return 10;
} }

View File

@ -54,39 +54,31 @@ public class OnlyFourFilesCom extends PluginForHost {
} else { } else {
Form form = br.getFormbyProperty("name", "F1"); Form form = br.getFormbyProperty("name", "F1");
if (form == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFEKT); if (form == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFEKT);
// TODO: AntiCaptcha Method would allow simultanous connections
String captchaurl = br.getRegex(Pattern.compile("code:</b></td></tr>\\s+<tr><td><img src=\"(.*?)\"", Pattern.DOTALL | Pattern.CASE_INSENSITIVE)).getMatch(0); String captchaurl = br.getRegex(Pattern.compile("code:</b></td></tr>\\s+<tr><td><img src=\"(.*?)\"", Pattern.DOTALL | Pattern.CASE_INSENSITIVE)).getMatch(0);
String code = getCaptchaCode(captchaurl, downloadLink); String code = getCaptchaCode(captchaurl, downloadLink);
form.put("code", code); form.put("code", code);
form.setAction("http://only4files.com/");
// Ticket Time // Ticket Time
this.sleep(15000, downloadLink); int tt = Integer.parseInt(br.getRegex("countdown\">(\\d+)</span>").getMatch(0));
// br.submitForm(form); sleep(tt * 1001, downloadLink);
URLConnectionAdapter con2 = br.getHttpConnection(); URLConnectionAdapter con2 = br.getHttpConnection();
// String dllink = br.getRedirectLocation();
if (con2.getContentType().contains("html")) { if (con2.getContentType().contains("html")) {
String error = br.getRegex("class=\"err\">(.*?)</font>").getMatch(0); String error = br.getRegex("class=\"err\">(.*?)</font>").getMatch(0);
if (error != null) { if (error != null) {
logger.warning(error); logger.warning(error);
con2.disconnect();
if (error.equalsIgnoreCase("Wrong captcha") || error.equalsIgnoreCase("Download session expired")) { if (error.equalsIgnoreCase("Wrong captcha") || error.equalsIgnoreCase("Download session expired")) {
throw new PluginException(LinkStatus.ERROR_CAPTCHA); throw new PluginException(LinkStatus.ERROR_CAPTCHA);
} else { } else {
throw new PluginException(LinkStatus.ERROR_TEMPORARILY_UNAVAILABLE, error, 10000); throw new PluginException(LinkStatus.ERROR_TEMPORARILY_UNAVAILABLE, error, 10000);
} }
} }
// if (br.containsHTML("Download Link Generated")) dllink =
// br.getRegex("padding:7px;\">\\s+<a\\s+href=\"(.*?)\">").getMatch(0);
} }
dl = br.openDownload(downloadLink, form); dl = br.openDownload(downloadLink, form, false, 1);
dl.startDownload(); dl.startDownload();
} }
} }
// @Override // @Override
// TODO: AntiCaptcha Method would allow simultanous connections
// if user is quick; he can enter captchas one-by-one and then server allow
// him simulatanous downloads
// that's why I left it 10.
public int getMaxSimultanFreeDownloadNum() { public int getMaxSimultanFreeDownloadNum() {
return 10; return 10;
} }

View File

@ -54,13 +54,13 @@ public class PixelhitCom extends PluginForHost {
} else { } else {
Form form = br.getFormbyProperty("name", "F1"); Form form = br.getFormbyProperty("name", "F1");
if (form == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFEKT); if (form == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFEKT);
// TODO: AntiCaptcha Method would allow simultanous connections
String captchaurl = br.getRegex(Pattern.compile("below:</b></td></tr>\\s+<tr><td><img src=\"(.*?)\"", Pattern.DOTALL | Pattern.CASE_INSENSITIVE)).getMatch(0); String captchaurl = br.getRegex(Pattern.compile("below:</b></td></tr>\\s+<tr><td><img src=\"(.*?)\"", Pattern.DOTALL | Pattern.CASE_INSENSITIVE)).getMatch(0);
String code = getCaptchaCode(captchaurl, downloadLink); String code = getCaptchaCode(captchaurl, downloadLink);
form.put("code", code); form.put("code", code);
form.setAction(downloadLink.getDownloadURL()); form.setAction(downloadLink.getDownloadURL());
// Ticket Time // Ticket Time
this.sleep(30000, downloadLink); int tt = Integer.parseInt(br.getRegex("countdown\">(\\d+)</span>").getMatch(0));
sleep(tt * 1001, downloadLink);
br.submitForm(form); br.submitForm(form);
URLConnectionAdapter con2 = br.getHttpConnection(); URLConnectionAdapter con2 = br.getHttpConnection();
String dllink = br.getRedirectLocation(); String dllink = br.getRedirectLocation();
@ -68,6 +68,7 @@ public class PixelhitCom extends PluginForHost {
String error = br.getRegex("class=\"err\">(.*?)</font>").getMatch(0); String error = br.getRegex("class=\"err\">(.*?)</font>").getMatch(0);
if (error != null) { if (error != null) {
logger.warning(error); logger.warning(error);
con2.disconnect();
if (error.equalsIgnoreCase("Wrong captcha") || error.equalsIgnoreCase("Expired session")) { if (error.equalsIgnoreCase("Wrong captcha") || error.equalsIgnoreCase("Expired session")) {
throw new PluginException(LinkStatus.ERROR_CAPTCHA); throw new PluginException(LinkStatus.ERROR_CAPTCHA);
} else { } else {
@ -76,16 +77,13 @@ public class PixelhitCom extends PluginForHost {
} }
if (br.containsHTML("Download Link Generated")) dllink = br.getRegex("padding:7px;\">\\s+<a\\s+href=\"(.*?)\">").getMatch(0); if (br.containsHTML("Download Link Generated")) dllink = br.getRegex("padding:7px;\">\\s+<a\\s+href=\"(.*?)\">").getMatch(0);
} }
dl = br.openDownload(downloadLink, dllink); if (dllink == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFEKT);
dl = br.openDownload(downloadLink, dllink, false, 1);
dl.startDownload(); dl.startDownload();
} }
} }
// @Override // @Override
// TODO: AntiCaptcha Method would allow simultanous connections
// if user is quick; he can enter captchas one-by-one and then server allow
// him simulatanous downloads
// that's why I left it 10.
public int getMaxSimultanFreeDownloadNum() { public int getMaxSimultanFreeDownloadNum() {
return 10; return 10;
} }

View File

@ -93,6 +93,7 @@ public class RapidSharkPl extends PluginForHost {
String error = br.getRegex("class=\"err\">(.*?)</font>").getMatch(0); String error = br.getRegex("class=\"err\">(.*?)</font>").getMatch(0);
if (error != null) { if (error != null) {
logger.warning(error); logger.warning(error);
con2.disconnect();
if (error.equalsIgnoreCase("Wrong captcha") || error.equalsIgnoreCase("Expired session")) { if (error.equalsIgnoreCase("Wrong captcha") || error.equalsIgnoreCase("Expired session")) {
throw new PluginException(LinkStatus.ERROR_CAPTCHA); throw new PluginException(LinkStatus.ERROR_CAPTCHA);
} else { } else {
@ -101,6 +102,7 @@ public class RapidSharkPl extends PluginForHost {
} }
if (br.containsHTML("Download Link Generated")) dllink = br.getRegex("padding:7px;\">\\s+<a\\s+href=\"(.*?)\">").getMatch(0); if (br.containsHTML("Download Link Generated")) dllink = br.getRegex("padding:7px;\">\\s+<a\\s+href=\"(.*?)\">").getMatch(0);
} }
if (dllink == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFEKT);
dl = br.openDownload(downloadLink, dllink); dl = br.openDownload(downloadLink, dllink);
dl.startDownload(); dl.startDownload();
} }

View File

@ -54,13 +54,13 @@ public class SavefileRo extends PluginForHost {
} else { } else {
Form form = br.getFormbyProperty("name", "F1"); Form form = br.getFormbyProperty("name", "F1");
if (form == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFEKT); if (form == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFEKT);
// TODO: AntiCaptcha Method would allow simultanous connections
String captchaurl = br.getRegex(Pattern.compile("below:</div></b></td></tr>\\s+<tr><td><img src=\"(.*?)\"", Pattern.DOTALL | Pattern.CASE_INSENSITIVE)).getMatch(0); String captchaurl = br.getRegex(Pattern.compile("below:</div></b></td></tr>\\s+<tr><td><img src=\"(.*?)\"", Pattern.DOTALL | Pattern.CASE_INSENSITIVE)).getMatch(0);
String code = getCaptchaCode(captchaurl, downloadLink); String code = getCaptchaCode(captchaurl, downloadLink);
form.put("code", code); form.put("code", code);
form.setAction(downloadLink.getDownloadURL()); form.setAction(downloadLink.getDownloadURL());
// Ticket Time // Ticket Time
this.sleep(5000, downloadLink); int tt = Integer.parseInt(br.getRegex("countdown\">(\\d+)</span>").getMatch(0));
sleep(tt * 1001, downloadLink);
br.submitForm(form); br.submitForm(form);
URLConnectionAdapter con2 = br.getHttpConnection(); URLConnectionAdapter con2 = br.getHttpConnection();
String dllink = br.getRedirectLocation(); String dllink = br.getRedirectLocation();
@ -68,6 +68,7 @@ public class SavefileRo extends PluginForHost {
String error = br.getRegex("class=\"err\"\\s+color=\"#ffffff\">(.*?)</font>").getMatch(0); String error = br.getRegex("class=\"err\"\\s+color=\"#ffffff\">(.*?)</font>").getMatch(0);
if (error != null) { if (error != null) {
logger.warning(error); logger.warning(error);
con2.disconnect();
if (error.equalsIgnoreCase("Wrong captcha") || error.equalsIgnoreCase("Expired session")) { if (error.equalsIgnoreCase("Wrong captcha") || error.equalsIgnoreCase("Expired session")) {
throw new PluginException(LinkStatus.ERROR_CAPTCHA); throw new PluginException(LinkStatus.ERROR_CAPTCHA);
} else { } else {
@ -76,16 +77,13 @@ public class SavefileRo extends PluginForHost {
} }
if (br.containsHTML("Download Link Generated")) dllink = br.getRegex("Download:</font><br>\\s+<a\\s+href=\"(.*?)\"\\s+class").getMatch(0); if (br.containsHTML("Download Link Generated")) dllink = br.getRegex("Download:</font><br>\\s+<a\\s+href=\"(.*?)\"\\s+class").getMatch(0);
} }
dl = br.openDownload(downloadLink, dllink); if (dllink == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFEKT);
dl = br.openDownload(downloadLink, dllink, false, 1);
dl.startDownload(); dl.startDownload();
} }
} }
// @Override // @Override
// TODO: AntiCaptcha Method would allow simultanous connections
// if user is quick; he can enter captchas one-by-one and then server allow
// him simulatanous downloads
// that's why I left it 10.
public int getMaxSimultanFreeDownloadNum() { public int getMaxSimultanFreeDownloadNum() {
return 10; return 10;
} }

View File

@ -54,13 +54,13 @@ public class SharearoundCom extends PluginForHost {
} else { } else {
Form form = br.getFormbyProperty("name", "F1"); Form form = br.getFormbyProperty("name", "F1");
if (form == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFEKT); if (form == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFEKT);
// TODO: AntiCaptcha Method would allow simultanous connections
String captchaurl = br.getRegex(Pattern.compile("below:</b></td></tr>\\s+<tr><td><img src=\"(.*?)\"", Pattern.DOTALL | Pattern.CASE_INSENSITIVE)).getMatch(0); String captchaurl = br.getRegex(Pattern.compile("below:</b></td></tr>\\s+<tr><td><img src=\"(.*?)\"", Pattern.DOTALL | Pattern.CASE_INSENSITIVE)).getMatch(0);
String code = getCaptchaCode(captchaurl, downloadLink); String code = getCaptchaCode(captchaurl, downloadLink);
form.put("code", code); form.put("code", code);
form.setAction(downloadLink.getDownloadURL()); form.setAction(downloadLink.getDownloadURL());
// Ticket Time // Ticket Time
this.sleep(20000, downloadLink); int tt = Integer.parseInt(br.getRegex("countdown\">(\\d+)</span>").getMatch(0));
sleep(tt * 1001, downloadLink);
br.submitForm(form); br.submitForm(form);
URLConnectionAdapter con2 = br.getHttpConnection(); URLConnectionAdapter con2 = br.getHttpConnection();
String dllink = br.getRedirectLocation(); String dllink = br.getRedirectLocation();
@ -68,6 +68,7 @@ public class SharearoundCom extends PluginForHost {
String error = br.getRegex("class=\"err\">(.*?)</font>").getMatch(0); String error = br.getRegex("class=\"err\">(.*?)</font>").getMatch(0);
if (error != null) { if (error != null) {
logger.warning(error); logger.warning(error);
con2.disconnect();
if (error.equalsIgnoreCase("Wrong captcha") || error.equalsIgnoreCase("Expired session")) { if (error.equalsIgnoreCase("Wrong captcha") || error.equalsIgnoreCase("Expired session")) {
throw new PluginException(LinkStatus.ERROR_CAPTCHA); throw new PluginException(LinkStatus.ERROR_CAPTCHA);
} else { } else {
@ -76,16 +77,13 @@ public class SharearoundCom extends PluginForHost {
} }
if (br.containsHTML("Link Generated")) dllink = br.getRegex("next\\s+\\d+\\s+hours<br><br>\\s+\\s+<a\\s+href=\"(.*?)\">").getMatch(0); if (br.containsHTML("Link Generated")) dllink = br.getRegex("next\\s+\\d+\\s+hours<br><br>\\s+\\s+<a\\s+href=\"(.*?)\">").getMatch(0);
} }
dl = br.openDownload(downloadLink, dllink); if (dllink == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFEKT);
dl = br.openDownload(downloadLink, dllink, false, 1);
dl.startDownload(); dl.startDownload();
} }
} }
// @Override // @Override
// TODO: AntiCaptcha Method would allow simultanous connections
// if user is quick; he can enter captchas one-by-one and then server allow
// him simulatanous downloads
// that's why I left it 10.
public int getMaxSimultanFreeDownloadNum() { public int getMaxSimultanFreeDownloadNum() {
return 10; return 10;
} }

View File

@ -17,7 +17,9 @@
package jd.plugins.host; package jd.plugins.host;
import java.io.IOException; import java.io.IOException;
import java.util.regex.Pattern; import java.util.Iterator;
import java.util.SortedMap;
import java.util.TreeMap;
import jd.PluginWrapper; import jd.PluginWrapper;
import jd.http.Encoding; import jd.http.Encoding;
@ -40,12 +42,7 @@ public class SixGigaCom extends PluginForHost {
public void handleFree(DownloadLink downloadLink) throws Exception { public void handleFree(DownloadLink downloadLink) throws Exception {
requestFileInformation(downloadLink); requestFileInformation(downloadLink);
br.setFollowRedirects(false); br.setFollowRedirects(false);
br.setDebug(true);
Form form = br.getForm(0);
form.setAction(downloadLink.getDownloadURL());
form.remove("method_premium");
form.put("referer", Encoding.urlEncode(downloadLink.getDownloadURL()));
br.submitForm(form);
if (br.containsHTML("You have reached")) { if (br.containsHTML("You have reached")) {
int minutes = 0, seconds = 0, hours = 0; int minutes = 0, seconds = 0, hours = 0;
String tmphrs = br.getRegex("\\s+(\\d+)\\s+hours?").getMatch(0); String tmphrs = br.getRegex("\\s+(\\d+)\\s+hours?").getMatch(0);
@ -57,15 +54,25 @@ public class SixGigaCom extends PluginForHost {
int waittime = ((3600 * hours) + (60 * minutes) + seconds + 1) * 1000; int waittime = ((3600 * hours) + (60 * minutes) + seconds + 1) * 1000;
throw new PluginException(LinkStatus.ERROR_IP_BLOCKED, null, waittime); throw new PluginException(LinkStatus.ERROR_IP_BLOCKED, null, waittime);
} else { } else {
form = br.getFormbyProperty("name", "F1"); Form form = br.getFormbyProperty("name", "F1");
if (form == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFEKT); if (form == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFEKT);
// TODO: AntiCaptcha Method would allow simultanous connections /* "Captcha Method" */
String captchaurl = br.getRegex(Pattern.compile("below:</b></td></tr>\\s+<tr><td><img src=\"(.*?)\"", Pattern.DOTALL | Pattern.CASE_INSENSITIVE)).getMatch(0); String[][] letters = br.getRegex("<span style='position:absolute;padding-left:(\\d+)px;padding-top:\\d+px;'>(\\d)</span>").getMatches();
String code = getCaptchaCode(captchaurl, downloadLink); if (letters.length == 0) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFEKT);
SortedMap<Integer, String> capMap = new TreeMap<Integer, String>();
for (String[] letter : letters) {
capMap.put(Integer.parseInt(letter[0]), letter[1]);
}
String code = "";
Iterator<Integer> it = capMap.keySet().iterator();
while (it.hasNext()) {
code += capMap.get(it.next());
}
form.put("code", code); form.put("code", code);
form.setAction(downloadLink.getDownloadURL()); form.setAction(downloadLink.getDownloadURL());
// Ticket Time // Ticket Time
this.sleep(120000, downloadLink); int tt = Integer.parseInt(br.getRegex("countdown\">(\\d+)</span>").getMatch(0));
sleep(tt * 1001, downloadLink);
br.submitForm(form); br.submitForm(form);
URLConnectionAdapter con2 = br.getHttpConnection(); URLConnectionAdapter con2 = br.getHttpConnection();
String dllink = br.getRedirectLocation(); String dllink = br.getRedirectLocation();
@ -73,6 +80,7 @@ public class SixGigaCom extends PluginForHost {
String error = br.getRegex("class=\"err\">(.*?)</font>").getMatch(0); String error = br.getRegex("class=\"err\">(.*?)</font>").getMatch(0);
if (error != null) { if (error != null) {
logger.warning(error); logger.warning(error);
con2.disconnect();
if (error.equalsIgnoreCase("Wrong captcha") || error.equalsIgnoreCase("Expired session")) { if (error.equalsIgnoreCase("Wrong captcha") || error.equalsIgnoreCase("Expired session")) {
throw new PluginException(LinkStatus.ERROR_CAPTCHA); throw new PluginException(LinkStatus.ERROR_CAPTCHA);
} else { } else {
@ -81,16 +89,13 @@ public class SixGigaCom extends PluginForHost {
} }
if (br.containsHTML("Download Link Generated")) dllink = br.getRegex("padding:7px;\">\\s+<a\\s+href=\"(.*?)\">").getMatch(0); if (br.containsHTML("Download Link Generated")) dllink = br.getRegex("padding:7px;\">\\s+<a\\s+href=\"(.*?)\">").getMatch(0);
} }
dl = br.openDownload(downloadLink, dllink); if (dllink == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFEKT);
dl = br.openDownload(downloadLink, dllink, false, 1);
dl.startDownload(); dl.startDownload();
} }
} }
// @Override // @Override
// TODO: AntiCaptcha Method would allow simultanous connections
// if user is quick; he can enter captchas one-by-one and then server allow
// him simulatanous downloads
// that's why I left it 10.
public int getMaxSimultanFreeDownloadNum() { public int getMaxSimultanFreeDownloadNum() {
return 10; return 10;
} }
@ -106,8 +111,8 @@ public class SixGigaCom extends PluginForHost {
br.setCookie("http://www.6giga.com/", "lang", "english"); br.setCookie("http://www.6giga.com/", "lang", "english");
br.getPage(downloadLink.getDownloadURL()); br.getPage(downloadLink.getDownloadURL());
if (br.containsHTML("No such file")) throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND); if (br.containsHTML("No such file")) throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
String filename = Encoding.htmlDecode(br.getRegex("You\\s+have\\s+requested\\s+<font\\s+color=\"red\">http://[\\w\\.]*?6giga\\.com/[a-z0-9]+/(.*?)</font>").getMatch(0)); String filename = Encoding.htmlDecode(br.getRegex("Filename:</b></td><td\\s+nowrap>(.*?)</b>").getMatch(0));
String filesize = br.getRegex("\\s+\\((.*?)\\)</font>").getMatch(0); String filesize = br.getRegex("Size:</b></td><td>(.*?)\\s+<small>").getMatch(0);
if (filename == null || filesize == null) throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND); if (filename == null || filesize == null) throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
downloadLink.setName(filename); downloadLink.setName(filename);
downloadLink.setDownloadSize(Regex.getSize(filesize)); downloadLink.setDownloadSize(Regex.getSize(filesize));

View File

@ -69,7 +69,8 @@ public class UploadlineCom extends PluginForHost {
form = br.getFormbyProperty("name", "F1"); form = br.getFormbyProperty("name", "F1");
if (form == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFEKT); if (form == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFEKT);
form.setAction(downloadLink.getDownloadURL()); form.setAction(downloadLink.getDownloadURL());
sleep(20500, downloadLink); int tt = Integer.parseInt(br.getRegex("countdown\">(\\d+)</span>").getMatch(0));
sleep(tt * 1001, downloadLink);
br.submitForm(form); br.submitForm(form);
URLConnectionAdapter con2 = br.getHttpConnection(); URLConnectionAdapter con2 = br.getHttpConnection();
dllink = br.getRedirectLocation(); dllink = br.getRedirectLocation();

View File

@ -40,24 +40,23 @@ public class Usershare extends PluginForHost {
public void handleFree(DownloadLink link) throws Exception { public void handleFree(DownloadLink link) throws Exception {
requestFileInformation(link); requestFileInformation(link);
String linkurl = br.getRegex(".*?flashvars=.*?<a href=\"(.*?)\"><img src=\"/images/download_btn.jpg\" border=0>").getMatch(0); String linkurl = br.getRegex(".*?flashvars=.*?<a href=\"(.*?)\"><img src=\"/images/download_btn.jpg\" border=0>").getMatch(0);
if (linkurl == null) if (linkurl == null) {
{
linkurl = br.getRegex(".*?document.oncontextmenu=new Function.*?<a href=\"(.*?)\"><img src=\"/images/download_btn.jpg\" border=0>").getMatch(0); linkurl = br.getRegex(".*?document.oncontextmenu=new Function.*?<a href=\"(.*?)\"><img src=\"/images/download_btn.jpg\" border=0>").getMatch(0);
if(linkurl == null)throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFEKT); if (linkurl == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFEKT);
} }
br.setFollowRedirects(true); br.setFollowRedirects(true);
dl = br.openDownload(link, linkurl, true, -10); dl = br.openDownload(link, linkurl, true, -10);
dl.startDownload(); dl.startDownload();
} }
@Override @Override
public AvailableStatus requestFileInformation(DownloadLink parameter) throws Exception { public AvailableStatus requestFileInformation(DownloadLink parameter) throws Exception {
this.setBrowserExclusive(); this.setBrowserExclusive();
br.getPage(parameter.getDownloadURL()); br.getPage(parameter.getDownloadURL());
if(br.containsHTML("No such user exist") || br.containsHTML("File Not Found")) throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND); if (br.containsHTML("No such user exist") || br.containsHTML("File Not Found")) throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
String filename = br.getRegex("<title>(.*?)</title>").getMatch(0); String filename = br.getRegex("<title>(.*?)</title>").getMatch(0);
String filesize = br.getRegex("Size:</b></td><td>(.*?)<small>").getMatch(0); String filesize = br.getRegex("Size:</b></td><td>(.*?)<small>").getMatch(0);
if (filename == null || filesize == null) throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND); if (filename == null || filesize == null) throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
parameter.setName(filename.trim()); parameter.setName(filename.trim());
parameter.setDownloadSize(Regex.getSize(filesize.replaceAll(",", "\\."))); parameter.setDownloadSize(Regex.getSize(filesize.replaceAll(",", "\\.")));
@ -67,20 +66,20 @@ public class Usershare extends PluginForHost {
@Override @Override
public void reset() { public void reset() {
// TODO Auto-generated method stub // TODO Auto-generated method stub
} }
@Override @Override
public void resetDownloadlink(DownloadLink link) { public void resetDownloadlink(DownloadLink link) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
} }
@Override @Override
public String getVersion() { public String getVersion() {
return getVersion("$Revision$"); return getVersion("$Revision$");
} }
@Override @Override
public int getMaxSimultanFreeDownloadNum() { public int getMaxSimultanFreeDownloadNum() {
return 20; return 20;

View File

@ -41,51 +41,39 @@ public class XsharewareCom extends PluginForHost {
requestFileInformation(downloadLink); requestFileInformation(downloadLink);
br.setFollowRedirects(false); br.setFollowRedirects(false);
br.setDebug(true); br.setDebug(true);
if (br.containsHTML("You have reached")) {
int minutes = 0, seconds = 0, hours = 0; Form form = br.getFormbyProperty("name", "F1");
String tmphrs = br.getRegex("\\s+(\\d+)\\s+hours?").getMatch(0); if (form == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFEKT);
if (tmphrs != null) hours = Integer.parseInt(tmphrs); String captchaurl = br.getRegex(Pattern.compile("below:</b></td></tr>\\s+<tr><td><img src=\"(.*?)\"", Pattern.DOTALL | Pattern.CASE_INSENSITIVE)).getMatch(0);
String tmpmin = br.getRegex("\\s+(\\d+)\\s+minutes?").getMatch(0); String code = getCaptchaCode(captchaurl, downloadLink);
if (tmpmin != null) minutes = Integer.parseInt(tmpmin); form.put("code", code);
String tmpsec = br.getRegex("\\s+(\\d+)\\s+seconds?").getMatch(0); form.setAction(downloadLink.getDownloadURL());
if (tmpsec != null) seconds = Integer.parseInt(tmpsec); // Ticket Time
int waittime = ((3600 * hours) + (60 * minutes) + seconds + 1) * 1000; int tt = Integer.parseInt(br.getRegex("countdown\">(\\d+)</span>").getMatch(0));
throw new PluginException(LinkStatus.ERROR_IP_BLOCKED, null, waittime); sleep(tt * 1001, downloadLink);
} else { br.submitForm(form);
Form form = br.getFormbyProperty("name", "F1"); URLConnectionAdapter con2 = br.getHttpConnection();
if (form == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFEKT); String dllink = br.getRedirectLocation();
// TODO: AntiCaptcha Method would allow simultanous connections if (con2.getContentType().contains("html")) {
String captchaurl = br.getRegex(Pattern.compile("below:</b></td></tr>\\s+<tr><td><img src=\"(.*?)\"", Pattern.DOTALL | Pattern.CASE_INSENSITIVE)).getMatch(0); String error = br.getRegex("class=\"err\">(.*?)</font>").getMatch(0);
String code = getCaptchaCode(captchaurl, downloadLink); if (error != null) {
form.put("code", code); logger.warning(error);
form.setAction(downloadLink.getDownloadURL()); con2.disconnect();
// Ticket Time if (error.equalsIgnoreCase("Wrong captcha") || error.equalsIgnoreCase("Expired session")) {
this.sleep(60000, downloadLink); throw new PluginException(LinkStatus.ERROR_CAPTCHA);
br.submitForm(form); } else {
URLConnectionAdapter con2 = br.getHttpConnection(); throw new PluginException(LinkStatus.ERROR_TEMPORARILY_UNAVAILABLE, error, 10000);
String dllink = br.getRedirectLocation();
if (con2.getContentType().contains("html")) {
String error = br.getRegex("class=\"err\">(.*?)</font>").getMatch(0);
if (error != null) {
logger.warning(error);
if (error.equalsIgnoreCase("Wrong captcha") || error.equalsIgnoreCase("Expired session")) {
throw new PluginException(LinkStatus.ERROR_CAPTCHA);
} else {
throw new PluginException(LinkStatus.ERROR_TEMPORARILY_UNAVAILABLE, error, 10000);
}
} }
if (br.containsHTML("Link Generated")) dllink = br.getRegex("next\\s+\\d+\\s+hours<br><br>\\s+\\s+<a\\s+href=\"(.*?)\">").getMatch(0);
} }
dl = br.openDownload(downloadLink, dllink); if (br.containsHTML("Link Generated")) dllink = br.getRegex("next\\s+\\d+\\s+hours<br><br>\\s+\\s+<a\\s+href=\"(.*?)\">").getMatch(0);
dl.startDownload();
} }
if (dllink == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFEKT);
dl = br.openDownload(downloadLink, dllink, false, 1);
dl.startDownload();
} }
// @Override // @Override
// TODO: AntiCaptcha Method would allow simultanous connections
// if user is quick; he can enter captchas one-by-one and then server allow
// him simulatanous downloads
// that's why I left it 10.
public int getMaxSimultanFreeDownloadNum() { public int getMaxSimultanFreeDownloadNum() {
return 10; return 10;
} }
@ -99,6 +87,18 @@ public class XsharewareCom extends PluginForHost {
public AvailableStatus requestFileInformation(DownloadLink downloadLink) throws IOException, PluginException { public AvailableStatus requestFileInformation(DownloadLink downloadLink) throws IOException, PluginException {
this.setBrowserExclusive(); this.setBrowserExclusive();
br.getPage(downloadLink.getDownloadURL()); br.getPage(downloadLink.getDownloadURL());
if (br.containsHTML("You have reached")) {
int minutes = 0, seconds = 0, hours = 0;
String tmphrs = br.getRegex("\\s+(\\d+)\\s+hours?").getMatch(0);
if (tmphrs != null) hours = Integer.parseInt(tmphrs);
String tmpmin = br.getRegex("\\s+(\\d+)\\s+minutes?").getMatch(0);
if (tmpmin != null) minutes = Integer.parseInt(tmpmin);
String tmpsec = br.getRegex("\\s+(\\d+)\\s+seconds?").getMatch(0);
if (tmpsec != null) seconds = Integer.parseInt(tmpsec);
int waittime = ((3600 * hours) + (60 * minutes) + seconds + 1) * 1000;
logger.warning("Your IP was blocked for some minutes. Try it later again or do a reconnect");
throw new PluginException(LinkStatus.ERROR_IP_BLOCKED, null, waittime);
}
if (br.containsHTML("No such file")) throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND); if (br.containsHTML("No such file")) throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
String filename = Encoding.htmlDecode(br.getRegex("File\\s+Name:\\s+<b>(.*?)</b>").getMatch(0)); String filename = Encoding.htmlDecode(br.getRegex("File\\s+Name:\\s+<b>(.*?)</b>").getMatch(0));
String filesize = br.getRegex("File\\s+Size:\\s+(.*?)<br>").getMatch(0); String filesize = br.getRegex("File\\s+Size:\\s+(.*?)<br>").getMatch(0);