Lol....for what it's worth, the screenshot isn't fake. I wouldn't waste my time with such a thing. As proof, my changes to the FileServe hoster plugin are below.....
Added string:
Code:
private static final String COOKIE_HOST = "**External links are only visible to Support Staff**;
Custom login method...because I didn't want to change or remove the loginAPI method:
Code:
private void login(final Browser useBr, final Account account) throws Exception {
Browser br = useBr;
if (br == null) br = new Browser();
this.setBrowserExclusive();
br.getPage(COOKIE_HOST + "/index.php");
Form loginform = br.getForm(1);
if (loginform == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
loginform.put("loginUserName", Encoding.urlEncode(account.getUser()));
loginform.put("loginUserPassword", Encoding.urlEncode(account.getPass()));
br.submitForm(loginform);
br.getPage(COOKIE_HOST + "/dashboard.php");
if (!br.containsHTML("Login Name")) throw new PluginException(LinkStatus.ERROR_PREMIUM, PluginException.VALUE_ID_PREMIUM_DISABLE);
if (br.getCookie(COOKIE_HOST, "cookie") == null)
throw new PluginException(LinkStatus.ERROR_PREMIUM, PluginException.VALUE_ID_PREMIUM_DISABLE);
else
return;
}
Modified handlePremium method:
Code:
public void handlePremium(final DownloadLink link, final Account account) throws Exception {
this.requestFileInformation(link);
this.login(br, account);
br.setFollowRedirects(false);
br.getPage(link.getDownloadURL());
String dllink = br.getRedirectLocation();
this.dl = jd.plugins.BrowserAdapter.openDownload(this.br, link, dllink, true, 0);
if (this.dl.getConnection().getResponseCode() == 404) {
this.br.followConnection();
throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
}
if (this.dl.getConnection().getContentType().contains("html")) {
this.br.followConnection();
if (this.dl.getConnection().getLongContentLength() == 0) { throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND); }
this.handleErrors(br);
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
if (link.getFinalFileName() == null) {
/* workaround for buggy server response, see #3545 */
String name = Plugin.getFileNameFromHeader(dl.getConnection());
if (name != null) {
name = name.replaceAll("\\%\\%", "%25%");
name = Encoding.htmlDecode(name);
link.setFinalFileName(name);
}
}
this.dl.startDownload();
}
Modified fetchAccountInfo method:
Code:
@Override
public AccountInfo fetchAccountInfo(final Account account) throws Exception {
final AccountInfo ai = new AccountInfo();
try {
login(br, account);
} catch (PluginException e) {
account.setValid(false);
return ai;
}
String expire = br.getRegex("Premium Until<\\/h4><\\/th>.*?<td><h5>(.*?)<\\/h5").getMatch(0);
String type = br.getRegex("Account Type<\\/h4><\\/td> <td><h5 class\\=\\\"inline\\\">(.*?) <\\/h5").getMatch(0);
account.setValid(true);
if (type != null) ai.setStatus(type);
if (!"Premium".equals(type)) {
try {
account.setMaxSimultanDownloads(1);
} catch (final Throwable e) {
/* not available in 0.9xxx */
}
account.setProperty("type", "free");
account.setValid(false);
} else {
if (expire == null) {
ai.setExpired(true);
account.setValid(false);
return ai;
} else {
ai.setValidUntil(TimeFormatter.getMilliSeconds(expire, "dd MMMM yyyy zzz", null));
ai.setStatus("Premium User");
return ai;
}
}
return ai;
}
As you can see, I did away with the API in my customization. Instead, I used the built-in browser. Also, as a plus, with these customizations, the loginAPI, getShorten, getDirectLink, parse, and decrypt methods could all be removed.