@Override
 public void handleFree(DownloadLink downloadLink) throws Exception, PluginException {
   br.setFollowRedirects(true);
   br.getHeaders().put("User-Agent", "QuickTime/7.2 (qtver=7.2;os=Windows NT 5.1Service Pack 3)");
   br.getHeaders().put("Referer", downloadLink.getStringProperty("Referer"));
   br.getHeaders().put("Accept", null);
   br.getHeaders().put("Accept-Language", null);
   br.getHeaders().put("Accept-Charset", null);
   br.getHeaders().put("Pragma", null);
   br.getHeaders().put("Connection", null);
   String dllink = downloadLink.getDownloadURL();
   dl = jd.plugins.BrowserAdapter.openDownload(br, downloadLink, dllink, true, 0);
   long test = dl.getConnection().getLongContentLength();
   if (test < 512000) {
     br.followConnection();
     dllink = br.getRegex("(https?://[^\r\n\\s]+\\.mov)").getMatch(0);
     if (dllink != null) {
       dl = jd.plugins.BrowserAdapter.openDownload(br, downloadLink, dllink, true, 0);
       test = dl.getConnection().getLongContentLength();
       if (dl.getConnection().getContentType().contains("video/quicktime") && test < 512000) {
         br.followConnection();
         throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
       }
     } else {
       throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
     }
   }
   dl.startDownload();
 }
Example #2
0
 @Override
 public void handleFree(final DownloadLink downloadLink) throws Exception, PluginException {
   requestFileInformation(downloadLink);
   // file: "http://data9.5sing.com/T1zbhLB4xT1R47IVrK.mp3"
   String dllink = br.getRegex("file: \"(http://[^<>\"]*?)\"").getMatch(0);
   if (dllink == null) {
     dllink = br.getRegex("(\"|\')(http://data\\d+?\\.5sing\\.com/[^<>\"]*?)(\"|\')").getMatch(1);
     if (dllink == null) {
       String down =
           br.getRegex("down\"><a href=\"(http://[a-z]+\\.5sing\\.com/down/\\d+)\"").getMatch(0);
       if (down != null) {
         br.getPage(down);
         dllink =
             br.getRegex("(\"|\')(http://data\\d+?\\.5sing\\.com/[^<>\"]*?)(\"|\')").getMatch(1);
       }
     }
   }
   if (dllink == null) {
     throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
   }
   dl = jd.plugins.BrowserAdapter.openDownload(br, downloadLink, dllink, true, 0);
   if (dl.getConnection().getContentType().contains("html")) {
     br.followConnection();
     throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
   }
   dl.startDownload();
 }
Example #3
0
 @Override
 public void handlePremium(final DownloadLink downloadLink, final Account account)
     throws Exception {
   requestFileInformation(downloadLink);
   login(account, false);
   br.setFollowRedirects(false);
   getPage(this.br, downloadLink.getDownloadURL());
   if (account.getBooleanProperty("free", false)) {
     doFree(downloadLink);
   } else {
     if (br.containsHTML(FILENOTFOUND)) {
       throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
     }
     String url = br.getRedirectLocation();
     if (url == null) {
       throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
     }
     /* limited easyshare to max 5 chunks cause too much can create issues */
     dl = jd.plugins.BrowserAdapter.openDownload(br, downloadLink, url, true, -5);
     if (!dl.getConnection().isContentDisposition()) {
       br.followConnection();
       throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
     }
     dl.startDownload();
   }
 }
Example #4
0
 @Override
 public void handleFree(final DownloadLink downloadLink) throws Exception, PluginException {
   requestFileInformation(downloadLink);
   /* Access real link here in case we used the oembed API above */
   if (use_oembed_api) {
     br.getPage(downloadLink.getDownloadURL());
   }
   /* Prefer downloadlink --> Higher quality version */
   String dllink =
       br.getRegex("\"(http://(www\\.)?music\\.audiomack\\.com/tracks/[^<>\"]*?)\"").getMatch(0);
   if (dllink == null) {
     String apilink;
     if (downloadLink.getDownloadURL().matches(TYPE_API)) {
       apilink = downloadLink.getDownloadURL();
     } else {
       apilink = br.getRegex("\"(http://(www\\.)?audiomack\\.com/api/[^<>\"]*?)\"").getMatch(0);
       if (apilink == null) {
         throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
       }
     }
     br.getPage(apilink);
     dllink = br.getRegex("\"url\":\"(http[^<>\"]*?)\"").getMatch(0);
     if (dllink == null) {
       throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
     }
     dllink = dllink.replace("\\", "");
   }
   dl = jd.plugins.BrowserAdapter.openDownload(br, downloadLink, dllink, true, 0);
   if (dl.getConnection().getContentType().contains("html")) {
     br.followConnection();
     throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
   }
   dl.startDownload();
 }
Example #5
0
 @Override
 public void handleFree(final DownloadLink downloadLink) throws Exception, PluginException {
   requestFileInformation(downloadLink);
   String dllink = null;
   if (downloadLink.getDownloadURL().matches(SPACELINK)) {
     final String[] dllinks =
         br.getRegex(
                 "\"(http://[a-z0-9\\-]+\\.qiannao\\.com:\\d+/servlet/FileDownload[^<>\"]*?)\"")
             .getColumn(0);
     if (dllinks == null || dllinks.length == 0)
       throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
     for (final String testDllink : dllinks) {
       if (!linkOk(downloadLink, testDllink)) continue;
       dllink = testDllink;
       break;
     }
   } else {
     final String[] dllinks =
         br.getRegex("\"(http://[a-z0-9\\-]+\\.qiannao\\.com/downfile/[^<>\"]*?)\"").getColumn(0);
     if (dllinks == null || dllinks.length == 0)
       throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
     for (final String testDllink : dllinks) {
       if (!linkOk(downloadLink, testDllink)) continue;
       dllink = testDllink;
       break;
     }
   }
   if (dllink == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
   dl = jd.plugins.BrowserAdapter.openDownload(br, downloadLink, dllink, true, 0);
   if (dl.getConnection().getContentType().contains("html")) {
     br.followConnection();
     throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
   }
   dl.startDownload();
 }
 @Override
 public void handleFree(DownloadLink link) throws Exception {
   this.requestFileInformation(link);
   br.setDebug(true);
   String postCode = br.getRegex("name=\"code\" value=\"(.*?)\"").getMatch(0);
   if (postCode == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
   // Ticket Time
   String ttt = "10";
   ttt = br.getRegex("var time_wait = (.*?);").getMatch(0);
   int tt = Integer.parseInt(ttt);
   sleep(tt * 1001, link);
   br.postPage(link.getDownloadURL(), "code=" + Encoding.urlEncode(postCode));
   String server = br.getRegex("hostname\" value=\"(.*?)\"").getMatch(0);
   String hash = br.getRegex("hash\" value=\"(.*?)\"").getMatch(0);
   String filename = br.getRegex("filename\" value=\"(.*?)\"").getMatch(0);
   if (server == null || hash == null || filename == null)
     throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
   String dllink = "http://" + server + "/get/" + hash + "/" + filename;
   dl = BrowserAdapter.openDownload(br, link, dllink, true, 0);
   if (dl.getConnection().getContentType().contains("html")) {
     br.followConnection();
     throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
   }
   dl.startDownload();
 }
Example #7
0
  @Override
  public void handleFree(final DownloadLink downloadLink) throws Exception {
    requestFileInformation(downloadLink);
    String dllink = br.getRegex("data-url=\"(.*?)\"").getMatch(0);
    if (dllink == null) {
      dllink =
          br.getRegex("\"(http://v\\-ec\\.slutload\\-media\\.com/.*?\\.flv\\?.*?)\"").getMatch(0);
    }
    if (dllink == null) {
      /**
       * Some videos are officially not available but still work when embedded in other sites, lets
       * try to download those too
       */
      br.getPage(
          "http://emb.slutload.com/xplayerconfig/"
              + new Regex(downloadLink.getDownloadURL(), "([A-Za-z0-9]+)$").getMatch(0)
              + ".css");

      dllink = br.getRegex("\\&ec_seek=;URL: (http://[^<>\"]+);type:").getMatch(0);
      if (dllink == null) {
        throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
      }
    }
    dllink = HTMLEntities.unhtmlentities(dllink);
    dl = jd.plugins.BrowserAdapter.openDownload(br, downloadLink, dllink, true, 0);
    if (dl.getConnection().getContentType().contains("html")) {
      br.followConnection();
      throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
    }
    dl.startDownload();
  }
Example #8
0
 @Override
 public void handleFree(DownloadLink downloadLink) throws Exception, PluginException {
   requestFileInformation(downloadLink);
   String fileID =
       new Regex(downloadLink.getDownloadURL(), "filebrella\\.com/download/(.+)").getMatch(0);
   if (!br.containsHTML(CAPTCHATEXT) || fileID == null)
     throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
   for (int i = 0; i <= 3; i++) {
     String postLink =
         "http://www.filebrella.com/xml/captchaSubmit.php?code="
             + getCaptchaCode("http://www.filebrella.com/images/verification.php", downloadLink)
             + "&fid="
             + fileID
             + "&reqID=%6s"
             + 100000
             + new Random().nextInt(900000);
     br.postPage(postLink, "");
     if (br.containsHTML(CAPTCHAFAILED)) continue;
     break;
   }
   if (br.containsHTML(CAPTCHAFAILED)) throw new PluginException(LinkStatus.ERROR_CAPTCHA);
   String dllink = br.getRegex("link=\"(http.*?)\"").getMatch(0);
   if (dllink == null)
     dllink =
         br.getRegex("\"(http://download\\d+\\.filebrella\\.com:\\d+/[a-z0-9]+/[a-z0-9]+/.*?)\"")
             .getMatch(0);
   if (dllink == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
   dl = jd.plugins.BrowserAdapter.openDownload(br, downloadLink, dllink, true, 0);
   if (dl.getConnection().getContentType().contains("html")) {
     br.followConnection();
     throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
   }
   dl.startDownload();
 }
  @Override
  public void handleFree(final DownloadLink downloadLink) throws Exception {
    final LinkStatus linkStatus = downloadLink.getLinkStatus();

    this.dl =
        jd.plugins.BrowserAdapter.openDownload(
            this.br, downloadLink, downloadLink.getDownloadURL());
    URLConnectionAdapter urlConnection = this.dl.connect();
    if (urlConnection.getLongContentLength() == 0) {
      this.br.followConnection();
      linkStatus.addStatus(LinkStatus.ERROR_PLUGIN_DEFECT);
      return;
    }

    if (this.dl.startDownload()) {
      if (downloadLink.getProperty("convertto") != null) {
        final DestinationFormat convertTo =
            DestinationFormat.valueOf(downloadLink.getProperty("convertto").toString());
        final DestinationFormat inType = DestinationFormat.VIDEOFLV;
        /* to load the TbCm plugin */
        JDUtilities.getPluginForDecrypt("youtube.com");
        if (!TbCm.ConvertFile(downloadLink, inType, convertTo)) {
          Plugin.logger.severe("Video-Convert failed!");
        }
      }
    }
  }
Example #10
0
 private void doDownload(DownloadLink downloadLink) throws Exception {
   if (br.containsHTML(LIMITREACHED)) {
     throw new PluginException(LinkStatus.ERROR_IP_BLOCKED);
   }
   if (br.containsHTML(COUNTRYBLOCK)) {
     throw new PluginException(LinkStatus.ERROR_FATAL, COUNTRYBLOCKUSERTEXT);
   }
   if (br.containsHTML(ONLYFORREGISTEREDUSERS)) {
     throw new PluginException(LinkStatus.ERROR_FATAL, ONLYFORREGISTEREDUSERSTEXT);
   }
   if (downloadLink.getDownloadURL().matches(TYPE_IMAGE) || br.getURL().matches(TYPE_IMAGE)) {
   } else {
     getDownloadUrl(downloadLink);
   }
   if (DLLINK == null) {
     throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
   }
   int maxchunks = -2;
   // Videos have chunk-limits!
   if (br.containsHTML(VIDEOPLAYER)) {
     maxchunks = 1;
   }
   br.getHeaders().put("Accept-Charset", null);
   dl = jd.plugins.BrowserAdapter.openDownload(br, downloadLink, DLLINK, true, maxchunks);
   if (dl.getConnection().getContentType().contains("html")) {
     br.followConnection();
     throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
   }
   dl.startDownload();
   try {
     localProxy(false);
   } catch (final Throwable e) {
     /* does not exist in 09581 */
   }
 }
Example #11
0
 @Override
 public void handleFree(DownloadLink downloadLink) throws Exception, PluginException {
     requestFileInformation(downloadLink);
     final String hash = br.getRegex("\"hash_c\":\"([a-z0-9]+)\"").getMatch(0);
     String dllink = br.getRegex("\"return dl_me\\(this\\);\" href=\"(http://.*?)\"").getMatch(0);
     if (dllink == null) dllink = br.getRegex("\"(http://ng\\-st\\.esnips\\.com/dl_serve\\.php\\?file_id=userfolders/esnips/central/[a-z0-9\\-/]+\\&ts=\\d+)\"").getMatch(0);
     if (dllink == null || hash == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
     dllink = Encoding.htmlDecode(dllink) + "&hash=" + hash;
     dl = jd.plugins.BrowserAdapter.openDownload(br, downloadLink, dllink, false, 1);
     if (dl.getConnection().getContentType().contains("html")) {
         br.followConnection();
         throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
     }
     /** Server sends us internal filenames, we want nice filenames */
     final String tempFname = getFileNameFromHeader(dl.getConnection());
     String ext = tempFname.substring(tempFname.lastIndexOf("."));
     if (downloadLink.getFinalFileName() == null) {
         if (ext == null || ext.length() > 5) {
             downloadLink.setFinalFileName(tempFname);
         } else {
             downloadLink.setFinalFileName(downloadLink.getName() + ext);
         }
     }
     dl.startDownload();
 }
Example #12
0
 @Override
 public void handleFree(DownloadLink downloadLink) throws Exception, PluginException {
   requestFileInformation(downloadLink);
   String getLink = br.getRegex(GETLINKREGEX).getMatch(0);
   if (getLink == null) getLink = br.getRegex(GETLINKREGEX2).getMatch(0);
   if (getLink == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
   // waittime
   String ttt = br.getRegex("var time = (\\d+);").getMatch(0);
   int tt = 20;
   if (ttt != null) tt = Integer.parseInt(ttt);
   if (tt > 240) {
     // 10 Minutes reconnect-waittime is not enough, let's wait one
     // hour
     throw new PluginException(LinkStatus.ERROR_IP_BLOCKED, 60 * 60 * 1000l);
   }
   sleep(tt * 1001l, downloadLink);
   dl =
       jd.plugins.BrowserAdapter.openDownload(
           br, downloadLink, getLink, "task=download", false, 1);
   if (dl.getConnection().getContentType().contains("html")) {
     br.followConnection();
     if (br.containsHTML(
         "(files per hour for free users\\.</div>|>Los usuarios de Cuenta Gratis pueden descargar)"))
       throw new PluginException(LinkStatus.ERROR_IP_BLOCKED, 60 * 60 * 1001l);
     final String unknownError = br.getRegex("class=\"error\">(.*?)\"").getMatch(0);
     if (unknownError != null) logger.warning("Unknown error occured: " + unknownError);
     throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
   }
   dl.startDownload();
 }
Example #13
0
 @Override
 public void handleFree(DownloadLink downloadLink) throws Exception {
   requestFileInformation(downloadLink);
   dl =
       jd.plugins.BrowserAdapter.openDownload(
           br,
           downloadLink,
           "http://www.fileshaker.com/download/do_download",
           "key=" + new Regex(downloadLink.getDownloadURL(), "fileshaker\\.com/(.*?)").getMatch(0),
           false,
           1);
   if (dl.getConnection().getResponseCode() != 200 && dl.getConnection().getResponseCode() != 206
       || dl.getConnection().getContentType().contains("html")) {
     br.followConnection();
     // This should never happen
     if (br.containsHTML(">Log in to your Account<"))
       throw new PluginException(
           LinkStatus.ERROR_TEMPORARILY_UNAVAILABLE,
           "Too many simultan downloads",
           5 * 60 * 1000l);
     dl.getConnection().disconnect();
     throw new PluginException(LinkStatus.ERROR_TEMPORARILY_UNAVAILABLE, 5 * 60 * 1000l);
   }
   dl.startDownload();
 }
Example #14
0
 @SuppressWarnings("deprecation")
 private void doFree(
     final DownloadLink downloadLink,
     final boolean resumable,
     final int maxchunks,
     final String directlinkproperty)
     throws Exception, PluginException {
   final String first_url = this.br.getURL();
   // String dllink = checkDirectLink(downloadLink, directlinkproperty);
   String dllink = null;
   if (dllink == null) {
     final String fid =
         downloadLink
             .getDownloadURL()
             .substring(downloadLink.getDownloadURL().lastIndexOf("/") + 1);
     this.br.getHeaders().put("X-Requested-With", "XMLHttpRequest");
     this.br.postPage("/file/api/getDownloadServer/" + fid, "");
     dllink = getJson("server");
     if (dllink == null) {
       throw new PluginException(
           LinkStatus.ERROR_TEMPORARILY_UNAVAILABLE, "Unknown server error", 10 * 60 * 1000l);
     }
   }
   this.br.getHeaders().put("Referer", first_url);
   dl = jd.plugins.BrowserAdapter.openDownload(br, downloadLink, dllink, resumable, maxchunks);
   if (dl.getConnection().getContentType().contains("html")) {
     br.followConnection();
     throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
   }
   downloadLink.setProperty(directlinkproperty, dllink);
   dl.startDownload();
 }
Example #15
0
 @Override
 public void handlePremium(DownloadLink link, Account account) throws Exception {
   requestFileInformation(link);
   login(account);
   br.setFollowRedirects(false);
   br.getPage(link.getDownloadURL());
   if (nopremium) {
     doFree(link);
   } else {
     String dllink = br.getRedirectLocation();
     if (dllink == null) {
       Form DLForm = br.getFormBySubmitvalue("Download");
       if (DLForm == null) {
         DLForm = br.getForm(0);
       }
       if (DLForm == null) {
         throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
       }
       br.submitForm(DLForm);
       dllink = br.getRedirectLocation();
     }
     if (dllink == null) {
       throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
     }
     logger.info("Final downloadlink = " + dllink + " starting the download...");
     jd.plugins.BrowserAdapter.openDownload(br, link, dllink, true, 0);
     if (!(dl.getConnection().isContentDisposition())) {
       br.followConnection();
       throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
     }
     dl.startDownload();
   }
 }
Example #16
0
 @Override
 public void handlePremium(DownloadLink link, Account account) throws Exception {
   String passCode = null;
   requestFileInformation(link);
   login(account, false);
   String dllink = null;
   if (account.getBooleanProperty("nopremium")) {
     br.getPage(link.getDownloadURL());
     doSomething();
     doFree(link, true, 0, false);
   } else {
     dllink = link.getStringProperty("premlink");
     if (dllink != null) {
       try {
         Browser br2 = br.cloneBrowser();
         URLConnectionAdapter con = br2.openGetConnection(dllink);
         if (con.getContentType().contains("html") || con.getLongContentLength() == -1) {
           link.setProperty("premlink", Property.NULL);
           dllink = null;
         }
         con.disconnect();
       } catch (Exception e) {
         dllink = null;
       }
     }
     if (dllink == null) {
       br.getPage(link.getDownloadURL());
       doSomething();
       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);
         br.submitForm(DLForm);
         doSomething();
         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();
       doSomething();
       checkServerErrors();
       throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
     }
     if (passCode != null) link.setProperty("pass", passCode);
     link.setProperty("premlink", dllink);
     dl.startDownload();
   }
 }
Example #17
0
 @Override
 public void handleFree(final DownloadLink downloadLink) throws Exception, PluginException {
   requestFileInformation(downloadLink);
   String dllink = checkDirectLink(downloadLink, "directlink");
   if (dllink == null) {
     br.getHeaders().put("X-Requested-With", "XMLHttpRequest");
     br.getHeaders().put("Accept", "application/json, text/javascript, */*; q=0.01");
     br.postPage(br.getURL(), "action=free_download");
     if ("oversize".equals(getJson("status"))) {
       try {
         throw new PluginException(
             LinkStatus.ERROR_PREMIUM, PluginException.VALUE_ID_PREMIUM_ONLY);
       } catch (final Throwable e) {
         if (e instanceof PluginException) {
           throw (PluginException) e;
         }
       }
       throw new PluginException(
           LinkStatus.ERROR_FATAL, "This file can only be downloaded by premium users");
     }
     final String code =
         getCaptchaCode(
             "http://wushare.com/captcha?id=" + System.currentTimeMillis(), downloadLink);
     br.postPage(br.getURL(), "action=get_download_link&captcha_response_field=" + code);
     if (br.containsHTML("\"error_captcha\"")) {
       try {
         invalidateLastChallengeResponse();
       } catch (final Throwable e) {
       }
       throw new PluginException(LinkStatus.ERROR_CAPTCHA);
     }
     try {
       validateLastChallengeResponse();
     } catch (final Throwable e) {
     }
     final String waitSeconds =
         br.getRegex("\"status\": \"waiting\", \"time\": (\\d+)").getMatch(0);
     if (waitSeconds != null) {
       throw new PluginException(LinkStatus.ERROR_IP_BLOCKED, Long.parseLong(waitSeconds) * 1001l);
     }
     dllink = br.getRegex("\"link\": \"(http://[^<>\"]*?)\"").getMatch(0);
     if (dllink == null) {
       throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
     }
   }
   dl = jd.plugins.BrowserAdapter.openDownload(br, downloadLink, dllink, true, 1);
   if (dl.getConnection().getContentType().contains("html")) {
     br.followConnection();
     if (br.toString().equals("free members do not allows parallel downloads!")) {
       throw new PluginException(
           LinkStatus.ERROR_IP_BLOCKED,
           "Your IP has been reported as still downloading",
           10 * 60 * 1000l);
     }
     throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
   }
   downloadLink.setProperty("directlink", dllink);
   dl.startDownload();
 }
 @Override
 public void handleFree(DownloadLink link) throws Exception {
   requestFileInformation(link);
   dl = jd.plugins.BrowserAdapter.openDownload(br, link, url, true, 0);
   if (dl.startDownload()) {
     this.postprocess(link);
   }
 }
Example #19
0
 @Override
 public void handleFree(final DownloadLink downloadLink) throws Exception, PluginException {
   requestFileInformation(downloadLink);
   String dllink = checkDirectLink(downloadLink, "directlink");
   if (dllink == null) {
     dllink = this.br.getRegex("(https?://[^<>\"]+/get/[^<>\"]+)").getMatch(0);
     if (dllink == null) {
       /* 2016-10-24 */
       dllink = this.br.getRegex("Core\\.InitializeStream\\s*?\\(\\'([^<>\"]+)\\'").getMatch(0);
       if (dllink != null) {
         dllink = Encoding.Base64Decode(dllink);
         dllink = Encoding.unescape(dllink);
         dllink = new Regex(dllink, "(https?://[^<>\"]+/get/[^<>\"]+)").getMatch(0);
       }
     }
     if (dllink == null) {
       final String hash =
           br.getRegex("type=\"hidden\" name=\"hash\" value=\"([^<>\"]*?)\"").getMatch(0);
       final String expires =
           br.getRegex("type=\"hidden\" name=\"expires\" value=\"([^<>\"]*?)\"").getMatch(0);
       final String timestamp =
           br.getRegex("type=\"hidden\" name=\"timestamp\" value=\"([^<>\"]*?)\"").getMatch(0);
       if (hash == null || timestamp == null) {
         throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
       }
       String postData = "hash=" + hash + "&timestamp=" + timestamp;
       if (expires != null) {
         postData += "&expires=" + expires;
       }
       br.postPage(br.getURL(), postData);
       dllink =
           br.getRegex("class=\"stream\\-content\" data\\-url=\"(http[^<>\"]*?)\"").getMatch(0);
       if (dllink == null) {
         throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
       }
     }
   }
   try {
     final Browser brc = br.cloneBrowser();
     brc.getHeaders().put("Accept", "*/*");
     brc.getHeaders().put("X-Requested-With", "XMLHttpRequest");
     brc.getHeaders().put("", "");
     brc.postPage(
         "http://" + domain + "/request",
         "action=view&abs=false&hash="
             + new Regex(downloadLink.getDownloadURL(), "([a-z0-9]+)$").getMatch(0));
   } catch (final Throwable e) {
   }
   dl = jd.plugins.BrowserAdapter.openDownload(br, downloadLink, dllink, true, 1);
   if (dl.getConnection().getContentType().contains("html")) {
     br.followConnection();
     throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
   }
   downloadLink.setProperty("directlink", dllink);
   dl.startDownload();
 }
Example #20
0
 @Override
 public void handleFree(DownloadLink link) throws Exception {
   this.setBrowserExclusive();
   dl = jd.plugins.BrowserAdapter.openDownload(br, link, link.getDownloadURL(), true, 0);
   if (dl.getConnection().getContentType().contains("html")) {
     dl.getConnection().disconnect();
     throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
   }
   dl.startDownload();
 }
Example #21
0
 @Override
 public void handleFree(DownloadLink downloadLink) throws Exception {
   requestFileInformation(downloadLink);
   dl = jd.plugins.BrowserAdapter.openDownload(br, downloadLink, DLLINK, true, 0);
   if (dl.getConnection().getContentType().contains("html")) {
     br.followConnection();
     throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
   }
   dl.startDownload();
 }
Example #22
0
  @SuppressWarnings("deprecation")
  private void handleDL(final Account account, final DownloadLink link, final String dllink)
      throws Exception {
    /* we want to follow redirects in final stage */
    br.setFollowRedirects(true);
    boolean resume = account.getBooleanProperty("resume", defaultRESUME);
    int maxChunks = account.getIntegerProperty("account_maxchunks", defaultMAXCHUNKS);
    /* Then check if we got an individual host limit. */
    if (hostMaxchunksMap != null) {
      final String thishost = link.getHost();
      synchronized (hostMaxchunksMap) {
        if (hostMaxchunksMap.containsKey(thishost)) {
          maxChunks = hostMaxchunksMap.get(thishost);
        }
      }
    }

    if (hostResumeMap != null) {
      final String thishost = link.getHost();
      synchronized (hostResumeMap) {
        if (hostResumeMap.containsKey(thishost)) {
          resume = hostResumeMap.get(thishost);
        }
      }
    }
    if (link.getBooleanProperty(NORESUME, false)) {
      resume = false;
    }
    if (!resume) {
      maxChunks = 1;
    }
    link.setProperty(NICE_HOSTproperty + "directlink", dllink);
    dl = jd.plugins.BrowserAdapter.openDownload(br, link, dllink, resume, maxChunks);
    if (dl.getConnection().getResponseCode() == 416) {
      logger.info("Resume impossible, disabling it for the next try");
      link.setChunksProgress(null);
      link.setProperty(JetDebridCom.NORESUME, Boolean.valueOf(true));
      throw new PluginException(LinkStatus.ERROR_RETRY);
    }
    if (dl.getConnection().getContentType().contains("html")
        || dl.getConnection().getContentType().contains("json")) {
      br.followConnection();
      updatestatuscode();
      handleAPIErrors(this.br);
      handleErrorRetries("unknowndlerror", 10, 5 * 60 * 1000l);
    }
    try {
      controlSlot(+1);
      this.dl.startDownload();
    } finally {
      // remove usedHost slot from hostMap
      // remove download slot
      controlSlot(-1);
    }
  }
Example #23
0
 @Override
 public void handleFree(final DownloadLink downloadLink) throws Exception {
   requestFileInformation(downloadLink);
   jd.plugins.BrowserAdapter.openDownload(br, downloadLink, finalURL, true, 0);
   if (dl.getConnection().getContentType().contains("html")) {
     logger.warning("The final dllink seems not to be a file!");
     br.followConnection();
     throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
   }
   dl.startDownload();
 }
Example #24
0
  @Override
  public void handleFree(final DownloadLink downloadLink) throws Exception, PluginException {
    requestFileInformation(downloadLink);
    String dllink = this.checkDirectLink(downloadLink, "cache");
    if (dllink == null) {
      final Form f = br.getForm(0);
      InputField i = null;
      for (final InputField inputfield : f.getInputFields()) {
        if ("trackvalue".equals(inputfield.getKey())
            && inputfield.getValue().equals(downloadLink.getStringProperty("iFilename", null))) {
          i = inputfield;
          break;
        }
      }
      // lets remove all other files execpt the one we want, they are all prechecked.
      while (f.getInputField("trackvalue") != null) {
        f.remove("trackvalue");
      }
      // add the one we want
      f.addInputField(i);
      if (f != null && f.hasInputFieldByName("securityCode")) {
        // has captcha
        final String captcha =
            new Regex(br.getURL(), "https?://(?:www\\.)?oshoworld\\.com/[^/]+/").getMatch(-1)
                + "CAPTCHA/CAPTCHA_image.asp";
        final String code = this.getCaptchaCode(captcha, downloadLink);
        f.put("securityCode", Encoding.urlEncode(code));
      }
      br.setFollowRedirects(false);
      br.submitForm(f);
      // redirect show show correct.
      // they come in the form of
      // http://www.oshoarchive.com/ow-english/download.php?id=T1NITy1UaGVfQXJ0X29mX0R5aW5nXzEwLm1wMw
      // the id = base64 iFilename, if we knew the /ow-english/ (for english section) was static we
      // could theoretically bypass
      // captcha..

      dllink = br.getRedirectLocation();
      if (dllink == null) {
        throw new PluginException(LinkStatus.ERROR_CAPTCHA);
      }
    }
    dl = jd.plugins.BrowserAdapter.openDownload(br, downloadLink, dllink, false, 1);
    if (dl.getConnection().getContentType().contains("html")) {
      if (dl.getConnection().getResponseCode() == 404) {
        throw new PluginException(
            LinkStatus.ERROR_TEMPORARILY_UNAVAILABLE, "Server error 404", 30 * 60 * 1000l);
      }
      br.followConnection();
      throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
    }
    downloadLink.setProperty("cache", dllink);
    dl.startDownload();
  }
Example #25
0
 @SuppressWarnings("deprecation")
 @Override
 public void handlePremium(final DownloadLink link, final Account account) throws Exception {
   requestFileInformation(link);
   login(account, false);
   if (account.getType() == AccountType.FREE) {
     if (!available_CHECK_OVER_INFO_PAGE) {
       br.getPage(link.getDownloadURL());
     }
     doFree(link, account_FREE_RESUME, account_FREE_MAXCHUNKS, "free_acc_directlink");
   } else {
     String dllink = link.getDownloadURL();
     dl =
         jd.plugins.BrowserAdapter.openDownload(
             br, link, dllink, account_PREMIUM_RESUME, account_PREMIUM_MAXCHUNKS);
     checkResponseCodeErrors(dl.getConnection());
     if (!dl.getConnection().isContentDisposition()) {
       logger.warning("The final dllink seems not to be a file, checking for errors...");
       br.followConnection();
       handleErrors();
       logger.info("Found no errors, let's see if we can find the dllink now...");
       handlePassword(link);
       dllink = this.getDllink();
       if (dllink == null) {
         handleErrors();
         throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
       }
       dl =
           jd.plugins.BrowserAdapter.openDownload(
               br, link, dllink, account_PREMIUM_RESUME, account_PREMIUM_MAXCHUNKS);
       checkResponseCodeErrors(dl.getConnection());
     }
     if (!dl.getConnection().isContentDisposition()) {
       logger.warning("The final dllink seems not to be a file!");
       br.followConnection();
       handleErrors();
       throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
     }
     dl.startDownload();
   }
 }
Example #26
0
 @Override
 public void handlePremium(final DownloadLink downloadLink, final Account account)
     throws Exception {
   passCode = downloadLink.getStringProperty("pass");
   requestFileInformation(downloadLink);
   login(account, false);
   if (account.getBooleanProperty("nopremium")) {
     requestFileInformation(downloadLink);
     doFree(downloadLink, false, 1, "freelink2");
   } else {
     String dllink = checkDirectLink(downloadLink, "premlink");
     if (dllink == null) {
       br.setFollowRedirects(false);
       getPage(downloadLink.getDownloadURL());
       dllink = getDllink();
       if (dllink == null) {
         Form dlform = br.getFormbyProperty("name", "F1");
         if (dlform != null && new Regex(correctedBR, PASSWORDTEXT).matches()) {
           passCode = handlePassword(dlform, downloadLink);
         }
         checkErrors(downloadLink, true);
         if (dlform == null) {
           throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
         }
         sendForm(dlform);
         checkErrors(downloadLink, true);
         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, true, 0);
     if (dl.getConnection().getContentType().contains("html")) {
       if (dl.getConnection().getResponseCode() == 503) {
         throw new PluginException(
             LinkStatus.ERROR_HOSTER_TEMPORARILY_UNAVAILABLE,
             "Connection limit reached, please contact our support!",
             5 * 60 * 1000l);
       }
       logger.warning("The final dllink seems not to be a file!");
       br.followConnection();
       correctBR();
       checkServerErrors();
       throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
     }
     fixFilename(downloadLink);
     downloadLink.setProperty("premlink", dllink);
     dl.startDownload();
   }
 }
Example #27
0
 public void handleFree(DownloadLink downloadLink) throws Exception {
   // requestFileInformation(downloadLink);
   dl =
       jd.plugins.BrowserAdapter.openDownload(
           br, downloadLink, downloadLink.getDownloadURL(), true, 1);
   if (dl.getConnection().getContentType().contains("html")) {
     logger.warning("the dllink doesn't seem to be a file, following the connection...");
     br.followConnection();
     throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
   }
   dl.startDownload();
 }
Example #28
0
 @Override
 public void handleFree(final DownloadLink downloadLink) throws Exception {
   DLLINK = convertRtmpUrlToHttpUrl(downloadLink.getDownloadURL());
   if (DLLINK == null) {
     throw new PluginException(LinkStatus.ERROR_FATAL, "Download not possible");
   }
   dl = jd.plugins.BrowserAdapter.openDownload(br, downloadLink, DLLINK, true, 0);
   if (dl.getConnection().getContentType().contains("html")) {
     br.followConnection();
     throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
   }
   dl.startDownload();
 }
 @Override
 public void handleFree(DownloadLink downloadLink) throws Exception, PluginException {
   requestFileInformation(downloadLink);
   final String dllink =
       br.getRegex("(http://download\\.yourupload\\.com/[a-f0-9]{32}[^\"]+)").getMatch(0);
   if (dllink == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
   dl = jd.plugins.BrowserAdapter.openDownload(br, downloadLink, dllink, false, 1);
   if (dl.getConnection().getContentType().contains("html")) {
     br.followConnection();
     throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
   }
   dl.startDownload();
 }
Example #30
0
 @Override
 public void handleFree(DownloadLink downloadLink) throws Exception, PluginException {
   requestFileInformation(downloadLink);
   String dllink = br.getRegex("file: \"(/[^<>\"]*?)\"").getMatch(0);
   if (dllink == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
   dllink = "http://spankbang.com" + dllink;
   dl = jd.plugins.BrowserAdapter.openDownload(br, downloadLink, dllink, true, 0);
   if (dl.getConnection().getContentType().contains("html")) {
     br.followConnection();
     throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
   }
   dl.startDownload();
 }