Ejemplo n.º 1
0
  public ArrayList<DownloadLink> decryptIt(CryptedLink param, ProgressController progress)
      throws Exception {
    synchronized (LOCK) {
      ArrayList<DownloadLink> decryptedLinks = new ArrayList<DownloadLink>();
      String parameter = param.toString();
      br.getPage(parameter);
      String waittime = br.getRegex("<p>Du musst noch (\\d+) Sekunden warten bis du").getMatch(0);
      if (waittime != null) {
        int wait = Integer.parseInt(waittime);
        if (wait > 80) {
          logger.warning(wait + " Sekunden Wartezeit: Limit erreicht!");
          logger.warning(br.toString());
          return null;
        }
        sleep(wait * 1001l, param);
      }
      for (int i = 0; i <= 5; i++) {
        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, param);
        rc.setCode(c);
        if (br.containsHTML("(api.recaptcha.net|Das war leider Falsch)")) continue;
        if (br.containsHTML("das Falsche Captcha eingegeben")) {
          sleep(60 * 1001l, param);
          br.getHeaders().put("User-Agent", RandomUserAgent.generate());
          br.getPage(parameter);
          continue;
        }
        break;
      }
      if (br.containsHTML(
          "(api.recaptcha.net|Das war leider Falsch|das Falsche Captcha eingegeben)"))
        throw new DecrypterException(DecrypterException.CAPTCHA);
      String links[] = br.getRegex("<a href=\"(http.*?)\" target=\"_blank\" onclick=").getColumn(0);
      if (links == null || links.length == 0) {
        logger.warning("First LdTTemp regex failed, trying the second one...");
        links = HTMLParser.getHttpLinks(br.toString(), "");
      }
      if (links.length == 0) return null;
      for (String finallink : links) {
        if (!finallink.contains("iload.to")
            && !finallink.contains("lof.cc")
            && !finallink.endsWith(".gif")
            && !finallink.endsWith(".swf")) decryptedLinks.add(createDownloadlink(finallink));
      }

      return decryptedLinks;
    }
  }
Ejemplo n.º 2
0
  public void doFree(DownloadLink downloadLink) throws Exception, PluginException {
    String passCode = null;
    boolean resumable = true;
    int maxchunks = 0;
    // If the filesize regex above doesn't match you can copy this part into
    // the available status (and delete it here)
    Form freeform = br.getFormBySubmitvalue("Kostenloser+Download");
    if (freeform == null) {
      freeform = br.getFormBySubmitvalue("Free+Download");
      if (freeform == null) {
        freeform = br.getFormbyKey("download1");
      }
    }
    if (freeform != null) {
      freeform.remove("method_premium");
      br.submitForm(freeform);
      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);
    Form DLForm = br.getFormbyProperty("name", "F1");
    if (DLForm == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
    // 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) {
      logger.info("Waittime detected, waiting " + ttt + " seconds from now on...");
      int tt = Integer.parseInt(ttt);
      sleep(tt * 1001, downloadLink);
    }
    boolean password = false;
    boolean recaptcha = false;
    if (brbefore.contains(PASSWORDTEXT0) || brbefore.contains(PASSWORDTEXT1)) {
      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 (brbefore.contains("api.recaptcha.net")) {
      // Some hosters also got commentfields with captchas, therefore is
      // the !br.contains...check Exampleplugin:
      // FileGigaCom
      logger.info("Detected captcha method \"Re Captcha\" for this host");
      PluginForHost recplug = JDUtilities.getPluginForHost("DirectHTTP");
      jd.plugins.hoster.DirectHTTP.Recaptcha rc = ((DirectHTTP) recplug).getReCaptcha(br);
      rc.parse();
      rc.load();
      File cf = rc.downloadCaptcha(getLocalCaptchaFile());
      String c = getCaptchaCode(cf, downloadLink);
      if (password) {
        passCode = handlePassword(passCode, rc.getForm(), downloadLink);
      }
      recaptcha = true;
      rc.setCode(c);
      logger.info(
          "Put captchacode "
              + c
              + " obtained by captcha metod \"Re Captcha\" in the form and submitted it.");
    }
    /* Captcha END */

    // If the hoster uses Re Captcha the form has already been sent before
    // here so here it's checked. Most hosters don't use Re Captcha so
    // usually recaptcha is false
    if (!recaptcha) {
      if (password) {
        passCode = handlePassword(passCode, DLForm, downloadLink);
      }
      dl = jd.plugins.BrowserAdapter.openDownload(br, downloadLink, DLForm, resumable, maxchunks);
      logger.info("Submitted DLForm");
    }
    if (dl.getConnection().getContentType().contains("html")) {
      br.followConnection();
      logger.info("followed connection...");
      doSomething();
      checkErrors(downloadLink, true, passCode);
      String dllink = getDllink();
      if (dllink == null) {
        logger.warning("Final downloadlink (String is \"dllink\") regex didn't match!");
        throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
      }
      logger.info("Final downloadlink = " + dllink + " starting the download...");
      dl = jd.plugins.BrowserAdapter.openDownload(br, downloadLink, dllink, resumable, maxchunks);
      if (dl.getConnection().getContentType().contains("html")) {
        logger.warning("The final dllink seems not to be a file!");
        br.followConnection();
        checkServerErrors();
        throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
      }
    }
    if (passCode != null) {
      downloadLink.setProperty("pass", passCode);
    }
    dl.startDownload();
  }
Ejemplo n.º 3
0
  @Override
  public void handleFree(DownloadLink downloadLink) throws Exception, PluginException {
    boolean resumable = false;
    int maxchunks = 1;
    requestFileInformation(downloadLink);
    // If the filesize regex above doesn't match you can copy this part into
    // the available status (and delete it here)
    Form freeform = br.getFormBySubmitvalue("Kostenloser+Download");
    if (freeform == null) {
      freeform = br.getFormBySubmitvalue("Free+Download");
      if (freeform == null) {
        freeform = br.getFormbyKey("download1");
      }
    }
    if (freeform != null) br.submitForm(freeform);
    /* Errorhandling START */
    // Handling for only-premium links
    if (br.containsHTML(
        "(You can download files up to.*?only|Upgrade your account to download bigger files)")) {
      String filesizelimit = br.getRegex("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");
      }
    }
    if (br.containsHTML("This file reached max downloads")) {
      throw new PluginException(LinkStatus.ERROR_FATAL, "This file reached max downloads");
    }
    if (br.containsHTML("You have to wait")) {
      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.info("Detected waittime #1, waiting " + waittime + "milliseconds");
      throw new PluginException(LinkStatus.ERROR_IP_BLOCKED, null, waittime);
    }
    if (br.containsHTML("You have reached the download-limit")) {
      String tmphrs = br.getRegex("\\s+(\\d+)\\s+hours?").getMatch(0);
      String tmpmin = br.getRegex("\\s+(\\d+)\\s+minutes?").getMatch(0);
      String tmpsec = br.getRegex("\\s+(\\d+)\\s+seconds?").getMatch(0);
      if (tmphrs == null && tmpmin == null && tmpsec == null) {
        throw new PluginException(LinkStatus.ERROR_IP_BLOCKED, null, 60 * 60 * 1000l);
      } else {
        int minutes = 0, seconds = 0, hours = 0;
        if (tmphrs != null) hours = Integer.parseInt(tmphrs);
        if (tmpmin != null) minutes = Integer.parseInt(tmpmin);
        if (tmpsec != null) seconds = Integer.parseInt(tmpsec);
        int waittime = ((3600 * hours) + (60 * minutes) + seconds + 1) * 1000;
        logger.info("Detected waittime #2, waiting " + waittime + "milliseconds");
        throw new PluginException(LinkStatus.ERROR_IP_BLOCKED, null, waittime);
      }
    }
    /* Errorhandling END */
    String md5hash = br.getRegex("<b>MD5.*?</b>.*?nowrap>(.*?)<").getMatch(0);
    if (md5hash != null) {
      md5hash = md5hash.trim();
      logger.info("Found md5hash: " + md5hash);
      downloadLink.setMD5Hash(md5hash);
    }
    br.setFollowRedirects(false);
    Form DLForm = br.getFormbyProperty("name", "F1");
    if (DLForm == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
    // Ticket Time
    String ttt = br.getRegex("countdown\">.*?(\\d+).*?</span>").getMatch(0);
    if (ttt != null) {
      logger.info("Waittime detected, waiting " + ttt.trim() + " seconds from now on...");
      int tt = Integer.parseInt(ttt);
      sleep(tt * 1001, downloadLink);
    }
    String passCode = null;
    boolean password = false;
    boolean recaptcha = false;
    if (br.containsHTML("(<b>Passwort:</b>|<b>Password:</b>)")) {
      password = true;
      logger.info("The downloadlink seems to be password protected.");
    }

    /* Captcha START */
    if (br.containsHTML("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 (br.containsHTML("/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 (br.containsHTML("api.recaptcha.net")
        && !br.containsHTML(
            "api\\.recaptcha\\.net.*?<Textarea.*?<input type=\"submit\" value.*?</Form>")) {
      // Some hosters also got commentfields with captchas, therefore is
      // the !br.contains...check Exampleplugin:
      // FileGigaCom
      logger.info("Detected captcha method \"Re Captcha\" for this host");
      PluginForHost recplug = JDUtilities.getPluginForHost("DirectHTTP");
      jd.plugins.hoster.DirectHTTP.Recaptcha rc = ((DirectHTTP) recplug).getReCaptcha(br);
      rc.parse();
      rc.load();
      File cf = rc.downloadCaptcha(getLocalCaptchaFile());
      String c = getCaptchaCode(cf, downloadLink);
      if (password == true) {
        if (downloadLink.getStringProperty("pass", null) == null) {
          passCode = getUserInput(null, downloadLink);
        } else {
          /* gespeicherten PassCode holen */
          passCode = downloadLink.getStringProperty("pass", null);
        }
        rc.getForm().put("password", passCode);
        logger.info("Put password \"" + passCode + "\" entered by user in the DLForm.");
        password = false;
      }
      recaptcha = true;
      rc.setCode(c);
      logger.info(
          "Put captchacode "
              + c
              + " obtained by captcha metod \"Re Captcha\" in the form and submitted it.");
    }
    /* Captcha END */

    // If the hoster uses Re Captcha the form has already been sent before
    // here so here it's checked. Most hosters don't use Re Captcha so
    // usually recaptcha is false
    if (recaptcha == false) {
      if (password == true) {
        if (downloadLink.getStringProperty("pass", null) == null) {
          passCode = getUserInput(null, downloadLink);
        } else {
          /* gespeicherten PassCode holen */
          passCode = downloadLink.getStringProperty("pass", null);
        }
        DLForm.put("password", passCode);
        logger.info("Put password \"" + passCode + "\" entered by user in the DLForm.");
      }
      jd.plugins.BrowserAdapter.openDownload(br, downloadLink, DLForm, resumable, maxchunks);
      logger.info("Submitted DLForm");
    }
    boolean error = false;
    try {
      if (dl.getConnection().getContentType().contains("html")) {
        error = true;
      }
    } catch (Exception e) {
      error = true;
    }
    if (br.getRedirectLocation() != null || error == true) {
      br.followConnection();
      logger.info("followed connection...");
      String dllink = br.getRedirectLocation();
      if (dllink == null) {
        if (br.containsHTML("You have to wait")) {
          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.info("Detected waittime #1, waiting " + waittime + "milliseconds");
          throw new PluginException(LinkStatus.ERROR_IP_BLOCKED, null, waittime);
        }
        if (br.containsHTML("You have reached the download-limit")) {
          String tmphrs = br.getRegex("\\s+(\\d+)\\s+hours?").getMatch(0);
          String tmpmin = br.getRegex("\\s+(\\d+)\\s+minutes?").getMatch(0);
          String tmpsec = br.getRegex("\\s+(\\d+)\\s+seconds?").getMatch(0);
          if (tmphrs == null && tmpmin == null && tmpsec == null) {
            throw new PluginException(LinkStatus.ERROR_IP_BLOCKED, null, 60 * 60 * 1000l);
          } else {
            int minutes = 0, seconds = 0, hours = 0;
            if (tmphrs != null) hours = Integer.parseInt(tmphrs);
            if (tmpmin != null) minutes = Integer.parseInt(tmpmin);
            if (tmpsec != null) seconds = Integer.parseInt(tmpsec);
            int waittime = ((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 (br.containsHTML("You're using all download slots for IP"))
          throw new PluginException(LinkStatus.ERROR_IP_BLOCKED, null, 10 * 60 * 1001l);
        if (br.containsHTML("(<b>Passwort:</b>|<b>Password:</b>|Wrong password)")) {
          logger.warning(
              "Wrong password, the entered password \"" + passCode + "\" is wrong, retrying...");
          downloadLink.setProperty("pass", null);
          throw new PluginException(LinkStatus.ERROR_RETRY);
        }
        if (br.containsHTML("Wrong captcha")) {
          logger.warning("Wrong captcha or wrong password!");
          throw new PluginException(LinkStatus.ERROR_CAPTCHA);
        }
        if (dllink == null) {
          dllink = br.getRegex("dotted #bbb;padding.*?<a href=\"(.*?)\"").getMatch(0);
          if (dllink == null) {
            dllink =
                br.getRegex("This direct link will be available for your IP.*?href=\"(http.*?)\"")
                    .getMatch(0);
            if (dllink == null) {
              // This was for fileop.com, maybe also works for
              // others!
              dllink = br.getRegex("Download: <a href=\"(.*?)\"").getMatch(0);
            }
          }
        }
      }
      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...");
      jd.plugins.BrowserAdapter.openDownload(br, downloadLink, dllink, resumable, maxchunks);
    }
    if (passCode != null) {
      downloadLink.setProperty("pass", passCode);
    }
    boolean error2 = false;
    try {
      if (dl.getConnection().getContentType().contains("html")) {
        error2 = true;
      }
    } catch (Exception e) {
      error2 = true;
    }
    if (error2 == true) {
      logger.warning("The final dllink seems not to be a file!");
      br.followConnection();
      if (br.containsHTML("File Not Found")) {
        logger.warning("Server says link offline, please recheck that!");
        throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
      }
      throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
    }
    dl.startDownload();
  }
Ejemplo n.º 4
0
  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("(\"This link does not exist\\.\"|ERROR - this link does not exist)"))
      throw new DecrypterException(
          JDL.L(
              "plugins.decrypt.errormsg.unavailable",
              "Perhaps wrong URL or the download is not available anymore."));
    if (br.containsHTML(">Not yet checked</span>")) throw new DecrypterException("Not yet checked");
    if (br.containsHTML("To use reCAPTCHA you must get an API key from"))
      throw new DecrypterException("Server error, please contact the safelinking.net support!");
    if (!parameter.contains("/d/")) {
      Form capForm = new Form();
      capForm.put("post-protect", "1");
      capForm.setMethod(MethodType.POST);
      capForm.setAction(parameter);
      for (int i = 0; i <= 5; i++) {
        if (br.containsHTML(PASSWORDPROTECTEDTEXT)) {
          capForm.put("link-password", getUserInput(null, param));
        }
        if (br.containsHTML(RECAPTCHATEXT)) {
          PluginForHost recplug = JDUtilities.getPluginForHost("DirectHTTP");
          jd.plugins.hoster.DirectHTTP.Recaptcha rc = ((DirectHTTP) recplug).getReCaptcha(br);
          rc.parse();
          rc.load();
          File cf = rc.downloadCaptcha(getLocalCaptchaFile());
          capForm.put("recaptcha_challenge_field", rc.getChallenge());
          capForm.put("recaptcha_response_field", getCaptchaCode(cf, param));
        } else if (br.getRegex(CAPTCHAREGEX1).getMatch(0) != null) {
          capForm.put(
              "securimage_response_field",
              getCaptchaCode(br.getRegex(CAPTCHAREGEX1).getMatch(0), param));
        } else if (br.getRegex(CAPTCHAREGEX2).getMatch(0) != null) {
          capForm.put(
              "3dcaptcha_response_field",
              getCaptchaCode(br.getRegex(CAPTCHAREGEX2).getMatch(0), param));
        } else if (br.containsHTML(CAPTCHATEXT3)) {
          Browser xmlbrowser = br.cloneBrowser();
          xmlbrowser.getPage("http://safelinking.net/includes/captcha_factory/fancycaptcha.php");
          capForm.put("fancy-captcha", xmlbrowser.toString().trim());
        }
        br.submitForm(capForm);
        if (br.containsHTML(RECAPTCHATEXT)
            || br.getRegex(CAPTCHAREGEX1).getMatch(0) != null
            || br.getRegex(CAPTCHAREGEX2).getMatch(0) != null
            || br.containsHTML(PASSWORDPROTECTEDTEXT)) continue;
        if (br.containsHTML(CAPTCHATEXT3)) {
          logger.warning("Captcha3 captchahandling failed for link: " + parameter);
          return null;
        }
        break;
      }
      if (br.containsHTML(RECAPTCHATEXT)
          || br.getRegex(CAPTCHAREGEX1).getMatch(0) != null
          || br.getRegex(CAPTCHAREGEX2).getMatch(0) != null)
        throw new DecrypterException(DecrypterException.CAPTCHA);
      if (br.containsHTML(PASSWORDPROTECTEDTEXT))
        throw new DecrypterException(DecrypterException.PASSWORD);
      if (br.containsHTML(">All links are dead\\.<"))
        throw new DecrypterException(
            JDL.L(
                "plugins.decrypt.errormsg.unavailable",
                "Perhaps wrong URL or the download is not available anymore."));
      // container handling (if no containers found, use webprotection
      if (br.containsHTML("\\.dlc")) {
        decryptedLinks = loadcontainer(".dlc", param);
        if (decryptedLinks != null && decryptedLinks.size() > 0) return decryptedLinks;
      }

      if (br.containsHTML("\\.rsdf")) {
        decryptedLinks = loadcontainer(".rsdf", param);
        if (decryptedLinks != null && decryptedLinks.size() > 0) return decryptedLinks;
      }

      if (br.containsHTML("\\.ccf")) {
        decryptedLinks = loadcontainer(".ccf", param);
        if (decryptedLinks != null && decryptedLinks.size() > 0) return decryptedLinks;
      }
      decryptedLinks = new ArrayList<DownloadLink>();
      // Webprotection decryption
      String[] links =
          br.getRegex("class=\"linked\">(http://safelinking\\.net/d/.*?)</a>").getColumn(0);
      if (links == null || links.length == 0) {
        String allLinks =
            br.getRegex("class=\"link-box\" id=\"direct-links\".*?>(.*?<a href=\".*?)</div>")
                .getMatch(0);
        if (allLinks != null) links = new Regex(allLinks, "<a href=\"(.*?)\"").getColumn(0);
        if (links == null || links.length == 0) {
          links = br.getRegex("\"(http://safelinking\\.net/d/[a-z0-9]+)\"").getColumn(0);
          if (links == null || links.length == 0) {
            links = br.getRegex("class=\"linked\">(http://.*?)</a>").getColumn(0);
          }
        }
      }
      if (links == null || links.length == 0) return null;
      progress.setRange(links.length);
      for (String link : links) {
        if (!link.contains("safelinking.net/")) {
          decryptedLinks.add(createDownloadlink(link));
        } else {
          br.getPage(link);
          String finallink = br.getRedirectLocation();
          if (finallink == null) {
            logger.warning("Decrypter broken, decryption stopped at link: " + link);
            return null;
          }
          if (!parameter.equals(finallink)) decryptedLinks.add(createDownloadlink(finallink));
        }
        progress.increase(1);
      }
    } else {
      if (br.getRedirectLocation() == null) {
        logger.warning("Error in single-link handling for link: " + parameter);
        return null;
      }
      decryptedLinks.add(createDownloadlink(br.getRedirectLocation()));
    }
    return decryptedLinks;
  }