Exemple #1
0
 public ArrayList<DownloadLink> decryptIt(CryptedLink param, ProgressController progress)
     throws Exception {
   ArrayList<DownloadLink> decryptedLinks = new ArrayList<DownloadLink>();
   String parameter = param.toString();
   br.setFollowRedirects(true);
   br.getPage(parameter);
   final String artist =
       br.getRegex("<title>Автор ([^<>\"/]*?) и его композиции</title>").getMatch(0);
   String[][] fileInfo =
       br.getRegex(
               "class=\"track artist_img_left\"><a href=\"(/pages/\\d+/\\d+\\.shtml)\">([^<>/\"]*?)</a></td><td class=\"date\">\\d{2}\\.\\d{2}\\.\\d{2}</td><td class=\"bitrate\">[0-9\t\n\r ]+</td><td class=\"size\">(\\d+(\\.\\d+)?)</td>")
           .getMatches();
   if (fileInfo == null || fileInfo.length == 0) {
     if (br.containsHTML(">Нет информации<")) {
       logger.info("Link offline: " + parameter);
       return decryptedLinks;
     }
     logger.warning("Decrypter broken for link: " + parameter);
     return null;
   }
   for (String[] file : fileInfo) {
     final DownloadLink dl = createDownloadlink("http://zaycev.net" + file[0]);
     dl.setFinalFileName(Encoding.htmlDecode(file[1].trim()) + ".mp3");
     dl.setDownloadSize(SizeFormatter.getSize(file[2] + " MB"));
     dl.setAvailable(true);
     decryptedLinks.add(dl);
   }
   if (artist != null) {
     FilePackage fp = FilePackage.getInstance();
     fp.setName(Encoding.htmlDecode(artist.trim()));
     fp.addLinks(decryptedLinks);
   }
   return decryptedLinks;
 }
Exemple #2
0
 @Override
 public AvailableStatus requestFileInformation(final DownloadLink downloadLink)
     throws IOException, PluginException {
   this.setBrowserExclusive();
   br.setFollowRedirects(true);
   br.getPage(downloadLink.getDownloadURL());
   if (br.getURL().contains("errorid="))
     throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
   String filename = br.getRegex("property=\"og:title\" content=\"([^<>\"]*?)\"").getMatch(0);
   if (filename == null)
     filename =
         br.getRegex("<title>([^<>\"]*?) Listen \\& Download \\- ZippyTune</title>").getMatch(0);
   DLLINK = "https://www.zippytune.com/audiostream/" + getFid(downloadLink) + ".mp3";
   if (filename == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
   DLLINK = Encoding.htmlDecode(DLLINK);
   filename = filename.trim();
   final String ext = ".mp3";
   downloadLink.setFinalFileName(Encoding.htmlDecode(filename) + ext);
   final Browser br2 = br.cloneBrowser();
   // In case the link redirects to the finallink
   br2.setFollowRedirects(true);
   URLConnectionAdapter con = null;
   try {
     con = br2.openGetConnection(DLLINK);
     if (!con.getContentType().contains("html"))
       downloadLink.setDownloadSize(con.getLongContentLength());
     else throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
     return AvailableStatus.TRUE;
   } finally {
     try {
       con.disconnect();
     } catch (Throwable e) {
     }
   }
 }
 @Override
 public AvailableStatus requestFileInformation(final DownloadLink link)
     throws IOException, PluginException {
   this.setBrowserExclusive();
   br.setFollowRedirects(false);
   br.getPage(link.getDownloadURL());
   if (br.containsHTML(ONLYREGISTEREDUSERTEXT)) {
     link.getLinkStatus()
         .setStatusText(JDL.L("plugins.hoster.datpiffcom.only4premium", ONLYREGISTEREDUSERTEXT));
     return AvailableStatus.TRUE;
   }
   if (br.containsHTML(
       "(>Download Unavailable<|>A zip file has not yet been generated<|>Mixtape Not Found<|has been removed<)"))
     throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
   String filename = null;
   if (br.containsHTML(CURRENTLYUNAVAILABLE)) {
     filename = br.getRegex("<title>([^<>\"]*?) \\- Mixtapes @ DatPiff\\.com</title>").getMatch(0);
     if (filename == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
     link.setName(Encoding.htmlDecode(filename.trim()));
     link.getLinkStatus().setStatusText(CURRENTLYUNAVAILABLETEXT);
     return AvailableStatus.TRUE;
   }
   filename = br.getRegex("<title>Download Mixtape \\&quot;(.*?)\\&quot;</title>").getMatch(0);
   if (filename == null)
     filename = br.getRegex("<span>Download Mixtape<em>(.*?)</em></span>").getMatch(0);
   if (filename == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
   if (!link.getDownloadURL().contains(".php?id=")) {
     logger.warning("downID not found, link is broken!");
     throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
   }
   link.setName(Encoding.htmlDecode(filename.trim()));
   return AvailableStatus.TRUE;
 }
Exemple #4
0
 @Override
 public AvailableStatus requestFileInformation(final DownloadLink link)
     throws IOException, PluginException {
   this.setBrowserExclusive();
   br.setFollowRedirects(true);
   br.getPage(link.getDownloadURL());
   if (br.getURL().contains("FileNotFind") || br.getURL().contains("5sing.com/404.htm")) {
     throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
   }
   String extension = br.getRegex("(<em>)?格式:(</em>)?([^<>\"]*?)(<|&)").getMatch(2);
   if (extension == null && br.containsHTML("<em>演唱:</em>")) {
     extension = "mp3";
   }
   final String filename = br.getRegex("var SongName[^<>\"\t\n\r]*= \"([^<>\"]*?)\"").getMatch(0);
   final String fileid = br.getRegex("var SongID[^<>\"\t\n\r]*= ([^<>\"]*?);").getMatch(0);
   final String stype = br.getRegex("var SongType[^<>\"\t\n\r]*= \"([^<>\"]*?)\";").getMatch(0);
   String filesize = br.getRegex("(<em>)?大小:(</em>)?([^<>\"]*?)(<|\")").getMatch(2);
   if (filename == null || extension == null) {
     throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
   }
   link.setFinalFileName(
       stype
           + "-"
           + Encoding.htmlDecode(filename.trim())
           + "-"
           + fileid
           + "."
           + Encoding.htmlDecode(extension.trim()));
   if (filesize != null) {
     link.setDownloadSize(SizeFormatter.getSize(filesize + "b"));
   }
   return AvailableStatus.TRUE;
 }
Exemple #5
0
 @Override
 public AvailableStatus requestFileInformation(final DownloadLink downloadLink)
     throws IOException, PluginException {
   this.setBrowserExclusive();
   br.setFollowRedirects(true);
   br.getPage(downloadLink.getDownloadURL() + "?hd");
   if (br.getHttpConnection().getResponseCode() == 404 || !br.containsHTML("new SWFObject")) {
     throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
   }
   final String date = br.getRegex("<div class=\"sub\">[\t\n\r ]+([^<>\"/]*?) /").getMatch(0);
   final String xml = br.getRegex("\"(/video/playlist/\\d+(/(hd|sd))?\\.xml)\"").getMatch(0);
   if (xml == null || date == null) {
     throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
   }
   br.getPage("http://www.gamer.nl" + xml);
   String filename = br.getRegex("<title>([^<>]*?)</title>").getMatch(0);
   DLLINK = br.getRegex("<media:content url=\"(https?://[^<>\"]*?)\" />").getMatch(0);
   if (filename == null || DLLINK == null) {
     throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
   }
   DLLINK = Encoding.htmlDecode(DLLINK);
   filename = Encoding.htmlDecode(filename);
   filename = filename.trim();
   filename = encodeUnicode(filename);
   String ext = DLLINK.substring(DLLINK.lastIndexOf("."));
   if (ext == null || ext.length() > 5) {
     ext = ".mp4";
   }
   if (this.getPluginConfig().getBooleanProperty(DATE_IN_FILENAME, false)) {
     filename = encodeUnicode(date) + "_" + filename + ext;
   } else {
     filename = filename + ext;
   }
   if (this.getPluginConfig().getBooleanProperty(FID_IN_FILENAME, false)) {
     filename = new Regex(downloadLink.getDownloadURL(), "(\\d+)$").getMatch(0) + "_" + filename;
   }
   downloadLink.setFinalFileName(filename);
   final Browser br2 = br.cloneBrowser();
   // In case the link redirects to the finallink
   br2.setFollowRedirects(true);
   URLConnectionAdapter con = null;
   try {
     try {
       con = br2.openGetConnection(DLLINK);
     } catch (final BrowserException e) {
       throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
     }
     if (!con.getContentType().contains("html")) {
       downloadLink.setDownloadSize(con.getLongContentLength());
     } else {
       throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
     }
     return AvailableStatus.TRUE;
   } finally {
     try {
       con.disconnect();
     } catch (final Throwable e) {
     }
   }
 }
Exemple #6
0
 /** Other way to get direct downloadlinks: http://www.moviesand.com/emconfig/ +videoID */
 @SuppressWarnings("deprecation")
 @Override
 public AvailableStatus requestFileInformation(final DownloadLink downloadLink)
     throws IOException, PluginException {
   this.setBrowserExclusive();
   br.setFollowRedirects(true);
   br.getPage(downloadLink.getDownloadURL());
   if (br.getURL().equals("http://www.moviesand.com/404.php")
       || br.containsHTML("Page Not Found<")) {
     throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
   }
   String filename =
       br.getRegex("<title>MoviesAnd \\- ([^<>\"]*?) \\- Better than YouPorn and RedTube</title>")
           .getMatch(0);
   if (filename == null) {
     filename =
         br.getRegex("itemprop=\"title\" style=\"color: #46A5F1;\">([^<>\"]*?)</span>")
             .getMatch(0);
   }
   DLLINK =
       br.getRegex("\\'(?:file|video)\\'[\t\n\r ]*?:[\t\n\r ]*?\\'(http[^<>\"]*?)\\'").getMatch(0);
   if (DLLINK == null) {
     DLLINK =
         br.getRegex("(?:file|url):[\t\n\r ]*?(?:\"|\\')(http[^<>\"]*?)(?:\"|\\')").getMatch(0);
   }
   if (DLLINK == null) {
     DLLINK =
         br.getRegex(
                 "<source src=\"(https?://[^<>\"]*?)\" type=(?:\"|\\')video/(?:mp4|flv)(?:\"|\\')")
             .getMatch(0);
   }
   if (filename == null || DLLINK == null) {
     throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
   }
   DLLINK = Encoding.htmlDecode(DLLINK);
   filename = filename.trim();
   String ext = DLLINK.substring(DLLINK.lastIndexOf("."));
   if (ext == null || ext.length() > 5) {
     ext = ".flv";
   }
   downloadLink.setFinalFileName(Encoding.htmlDecode(filename) + ext);
   Browser br2 = br.cloneBrowser();
   // In case the link redirects to the finallink
   br2.setFollowRedirects(true);
   URLConnectionAdapter con = null;
   try {
     con = br2.openGetConnection(DLLINK);
     if (!con.getContentType().contains("html")) {
       downloadLink.setDownloadSize(con.getLongContentLength());
     } else {
       throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
     }
     return AvailableStatus.TRUE;
   } finally {
     try {
       con.disconnect();
     } catch (Throwable e) {
     }
   }
 }
Exemple #7
0
 @Override
 public AvailableStatus requestFileInformation(final DownloadLink downloadLink)
     throws IOException, PluginException {
   setBrowserExclusive();
   br.setFollowRedirects(true);
   br.getPage(downloadLink.getDownloadURL());
   // Offline1
   if (br.containsHTML(
       "(This page cannot be found|Are you sure you typed in the correct url|<title>Most Recent Videos \\- Free Sex Adult Videos \\- NuVid\\.com</title>|This video was not found)")) {
     throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
   }
   // Offline2
   if (br.containsHTML("This video was deleted\\.")) {
     throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
   }
   String filename = br.getRegex("<h3>([^<>\"]*?)</h3>").getMatch(0);
   if (filename == null) {
     filename = br.getRegex("<title>([^<>\"]*?) - Free P**n \\& Sex Video").getMatch(0);
   }
   final String linkPart =
       br.getRegex(
               "\\'http://www\\.nuvid\\.com(/player_config/\\?(check_speed=.%26)?t=.*?)\\'\\);")
           .getMatch(0);
   if (filename == null || linkPart == null) {
     logger.info("filename = " + filename + "; linkPart = " + linkPart);
     throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
   }
   getDllink(linkPart);
   if (dllink == null && br.containsHTML("Invalid video key")) {
     throw new PluginException(LinkStatus.ERROR_FATAL, "Plugin outdated, key has changed!");
   }
   if (filename == null || dllink == null) {
     throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
   }
   dllink = Encoding.htmlDecode(dllink);
   filename = filename.trim();
   final String ext = getFileNameExtensionFromString(dllink, ".flv");
   downloadLink.setFinalFileName(Encoding.htmlDecode(filename) + ext);
   final Browser br2 = br.cloneBrowser();
   // In case the link redirects to the finallink
   br2.setFollowRedirects(true);
   URLConnectionAdapter con = null;
   try {
     con = br2.openGetConnection(dllink);
     if (!con.getContentType().contains("html")) {
       downloadLink.setDownloadSize(con.getLongContentLength());
     } else {
       throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
     }
     return AvailableStatus.TRUE;
   } finally {
     try {
       con.disconnect();
     } catch (final Throwable e) {
     }
   }
 }
 public ArrayList<DownloadLink> decryptIt(CryptedLink param, ProgressController progress)
     throws Exception {
   ArrayList<DownloadLink> decryptedLinks = new ArrayList<DownloadLink>();
   String parameter = param.toString();
   br.setFollowRedirects(true);
   // Test if we already hav a direct link here
   URLConnectionAdapter con = br.openGetConnection(parameter);
   if (con.getContentType().contains("html")) {
     br.followConnection();
     if (br.containsHTML(
         "(Error 404|The page you were looking for cannot be found|could not be found or is not available)"))
       throw new DecrypterException(
           JDL.L(
               "plugins.decrypt.errormsg.unavailable",
               "Perhaps wrong URL or the download is not available anymore."));
     String link = null;
     if (parameter.contains("/files/extras/")
         || parameter.contains("prdownloads.sourceforge.net")) {
       link = br.getRegex("Please use this <a href=\"(.*?)\"").getMatch(0);
       if (link == null)
         link =
             br.getRegex(
                     "\"(http://downloads\\.sourceforge\\.net/project/.*?/extras/.*?/.*?use_mirror=.*?)\"")
                 .getMatch(0);
     } else {
       link = br.getRegex("Please use this <a href=\"(http://.*?)\"").getMatch(0);
       if (link == null)
         link =
             br.getRegex("\"(http://downloads\\.sourceforge.net/project/.*?\\?use_mirror=.*?)\"")
                 .getMatch(0);
     }
     if (link == null) return null;
     br.setFollowRedirects(false);
     br.getPage(Encoding.htmlDecode(link));
     String finallink = null;
     boolean failed = true;
     for (int i = 0; i <= 5; i++) {
       br.getPage(Encoding.htmlDecode(link));
       finallink = br.getRedirectLocation();
       if (finallink == null) return null;
       con = br.openGetConnection(finallink);
       if (con.getContentType().contains("html")) {
         logger.info("finallink is no file, continuing...");
         continue;
       }
       failed = false;
       break;
     }
     if (failed) logger.warning("The finallink is no file!!");
     decryptedLinks.add(createDownloadlink("directhttp://" + finallink));
     con.disconnect();
   } else {
     con.disconnect();
     decryptedLinks.add(createDownloadlink("directhttp://" + parameter));
   }
   return decryptedLinks;
 }
 @Override
 public AvailableStatus requestFileInformation(DownloadLink downloadLink)
     throws IOException, PluginException {
   this.setBrowserExclusive();
   br.setFollowRedirects(true);
   br.getPage(downloadLink.getDownloadURL());
   if (br.containsHTML("<title>404 Not Found</title>")) {
     throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
   }
   String filename = br.getRegex("<title>Download (.*?)  \\|").getMatch(0);
   if (filename == null) {
     filename = br.getRegex("<h2>Download File: (.*?)</h2>").getMatch(0);
   }
   if (filename == null) {
     filename = br.getRegex("<title>Download ([^<>\"]*?)</title>").getMatch(0);
   }
   DLLINK = br.getRegex("\\'file\\'([\t\n\r ]+)?:([\t\n\r ]+)?\\'([^<>\"]*?)\\'").getMatch(2);
   if (DLLINK == null) {
     DLLINK = br.getRegex("(https?://\\w+\\.tinyvid\\.net[^<>\"]*?\\.mp4)").getMatch(0);
   }
   if (filename == null && DLLINK == null) {
     throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
   } else if (filename == null || filename.equals("")) {
     throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
   }
   filename = Encoding.htmlDecode(filename.trim());
   downloadLink.setName(filename);
   DLLINK = Encoding.htmlDecode(DLLINK);
   if (!DLLINK.startsWith("http://")) {
     DLLINK = "http://s1000.animepremium.tv/download/" + DLLINK;
   }
   Browser br2 = br.cloneBrowser();
   // In case the link redirects to the finallink
   br2.setFollowRedirects(true);
   URLConnectionAdapter con = null;
   try {
     con = br2.openGetConnection(DLLINK);
     if (!con.getContentType().contains("html")) {
       String ext = br2.getURL().substring(br2.getURL().lastIndexOf("."));
       if (ext == null || ext.length() > 5) {
         ext = ".mp4";
       }
       downloadLink.setFinalFileName(filename + ext);
       downloadLink.setDownloadSize(con.getLongContentLength());
     } else {
       throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
     }
     return AvailableStatus.TRUE;
   } finally {
     try {
       con.disconnect();
     } catch (Throwable e) {
     }
   }
 }
Exemple #10
0
 @Override
 public AvailableStatus requestFileInformation(final DownloadLink downloadLink) throws Exception {
   if (downloadLink.getBooleanProperty("offline", false)) {
     throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
   }
   downloadLink.setName(new Regex(downloadLink.getDownloadURL(), "(\\d+)$").getMatch(0));
   setBrowserExclusive();
   br.setFollowRedirects(true);
   br.getPage(downloadLink.getDownloadURL());
   if (br.containsHTML("http://www\\.vidobu\\.com/uyari_ip\\.php")
       || br.getHttpConnection().getResponseCode() == 404) {
     throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
   }
   final String nextUrl = br.getRegex("<iframe src=\"(http://[^<>]+)\"").getMatch(0);
   clipData = br.getPage(Encoding.htmlDecode(nextUrl));
   String title = br.getRegex("<title>(.*?)</title>").getMatch(0);
   title =
       title == null
           ? "Vimeo_private_video_" + getClipData("id") + "_" + System.currentTimeMillis()
           : title;
   final String dlURL =
       "/play_redirect?clip_id="
           + getClipData("id")
           + "&sig="
           + getClipData("signature")
           + "&time="
           + getClipData("timestamp")
           + "&quality="
           + (getClipData("hd").equals("1") ? "hd" : "sd")
           + "&codecs=H264,VP8,VP6&type=moogaloop&embed_location="
           + Encoding.htmlDecode(getClipData("referrer"));
   br.setFollowRedirects(false);
   br.getPage(dlURL);
   finalURL = br.getRedirectLocation();
   if (finalURL == null) {
     throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
   }
   title = Encoding.htmlDecode(title);
   URLConnectionAdapter con = null;
   try {
     con = br.openGetConnection(finalURL);
     if (con.getContentType() != null && con.getContentType().contains("mp4")) {
       downloadLink.setName(title + ".mp4");
     } else {
       downloadLink.setName(title + ".flv");
     }
     downloadLink.setDownloadSize(con.getLongContentLength());
     return AvailableStatus.TRUE;
   } finally {
     try {
       con.disconnect();
     } catch (final Throwable e) {
     }
   }
 }
Exemple #11
0
 @Override
 public AvailableStatus requestFileInformation(DownloadLink downloadLink)
     throws IOException, PluginException {
   this.setBrowserExclusive();
   br.setFollowRedirects(true);
   br.getPage(downloadLink.getDownloadURL());
   if (br.getURL().equals("http://www.p**n.to/")
       || br.containsHTML("<title>Watch Free P**n Videos and Amateur Sex Movies</title>"))
     throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
   String filename =
       br.getRegex(
               "<div class=\"row\">[\t\n\r ]+<div class=\"box box_medium float\\-left\">[\t\n\r ]+<h2>(.*?)</h2>")
           .getMatch(0);
   if (filename == null) filename = br.getRegex("<title>(.*?)</title>").getMatch(0);
   Regex theRegex =
       br.getRegex(
           "createPlayer\\(\\'(http://.*?)\\',\\'http://.*?\\',\\'(.*?)\\',\\'(\\d+)\\'\\)");
   String token = theRegex.getMatch(1);
   String anID = theRegex.getMatch(2);
   boolean embeddedLink = false;
   DLLINK = theRegex.getMatch(0);
   if (DLLINK == null) {
     DLLINK = br.getRegex("\\&file=(http://embed\\.kickassratios\\.com/[^<>\"]*?)\\&").getMatch(0);
     embeddedLink = true;
   }
   if (filename == null || (DLLINK == null && token == null && !embeddedLink && anID == null))
     throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
   DLLINK = Encoding.htmlDecode(DLLINK);
   filename = filename.trim();
   downloadLink.setFinalFileName(
       Encoding.htmlDecode(filename) + DLLINK.substring(DLLINK.length() - 4, DLLINK.length()));
   if (!embeddedLink)
     DLLINK +=
         "?start=0&id=videoplayer&client=FLASH%20WIN%2010,"
             + anID
             + ",181,26&version=4.2.95&width=664&token="
             + token;
   Browser br2 = br.cloneBrowser();
   // In case the link redirects to the finallink
   br2.setFollowRedirects(true);
   URLConnectionAdapter con = null;
   try {
     con = br2.openGetConnection(DLLINK);
     if (!con.getContentType().contains("html"))
       downloadLink.setDownloadSize(con.getLongContentLength());
     else throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
     return AvailableStatus.TRUE;
   } finally {
     try {
       con.disconnect();
     } catch (Throwable e) {
     }
   }
 }
Exemple #12
0
  @Override
  public AvailableStatus requestFileInformation(final DownloadLink downloadLink)
      throws IOException, PluginException {
    setBrowserExclusive();
    br.setFollowRedirects(true);
    br.getPage(downloadLink.getDownloadURL());
    // Video offline
    if (br.containsHTML("(<h2>Sorry, this video is no longer available|<title></title>)"))
      throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
    // 404
    if (br.containsHTML(">Not Found<|The requested URL was not found on this server"))
      throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
    String filename = br.getRegex("<title>(.*?)</title>").getMatch(0);
    if (filename == null) {
      filename =
          br.getRegex(
                  "<meta name=\"description\" content=\"(.*?) \\- video on Alpha Porno \\- P**n Tube\"/>")
              .getMatch(0);
    }
    DLLINK = br.getRegex("video_url:.*?\\('(http://.*?)'\\)").getMatch(0);
    if (filename == null || DLLINK == null)
      throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
    DLLINK = Encoding.htmlDecode(DLLINK);
    filename = filename.trim();
    String ext = DLLINK.substring(DLLINK.lastIndexOf(".")).replaceAll("\\W", "");
    if (ext == null || ext.length() > 5) {
      ext = "flv";
    }
    downloadLink.setFinalFileName(Encoding.htmlDecode(filename) + "." + ext);

    final String time = checkTM();
    final String ahv = checkMD(DLLINK, time);
    DLLINK = DLLINK + "?time=" + time + "&ahv=" + ahv + "&cv=" + checkMD2(time);

    final Browser br2 = br.cloneBrowser();
    // In case the link redirects to the finallink
    br2.setFollowRedirects(true);
    URLConnectionAdapter con = null;
    try {
      con = br2.openGetConnection(DLLINK);
      if (!con.getContentType().contains("html")) {
        downloadLink.setDownloadSize(con.getLongContentLength());
      } else {
        throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
      }
      return AvailableStatus.TRUE;
    } finally {
      try {
        con.disconnect();
      } catch (final Throwable e) {
      }
    }
  }
Exemple #13
0
 public AvailableStatus requestFileInformation(final DownloadLink downloadLink)
     throws IOException, InterruptedException, PluginException {
   correctDownloadLink(downloadLink);
   this.setBrowserExclusive();
   br.getHeaders().put("User-Agent", userAgent.get());
   br.setCookie("http://remixshare.com", "lang_en", "english");
   br.setFollowRedirects(true);
   br.getPage(downloadLink.getDownloadURL());
   if (br.containsHTML(BLOCKED)) {
     return AvailableStatus.UNCHECKABLE;
   }
   br.setFollowRedirects(false);
   // 300 = The uploader has deleted the file
   // 400 = File deleted, maybe abused
   // 500 = Wrong link or maybe deleted some time ago
   if (br.containsHTML("<b>Error Code: [345]00\\.")
       || br.containsHTML("Please check the downloadlink")) {
     throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
   }
   String filename =
       Encoding.htmlDecode(
           br.getRegex(
                   Pattern.compile(
                       "<span title=\\'([0-9]{10}_)?(.*?)\\'>", Pattern.CASE_INSENSITIVE))
               .getMatch(1));
   if (filename == null) {
     filename =
         Encoding.htmlDecode(
             br.getRegex(
                     Pattern.compile(
                         "<title>(.*?)Download at remiXshare Filehosting",
                         Pattern.CASE_INSENSITIVE))
                 .getMatch(0));
   }
   String filesize = br.getRegex("(>|\\.\\.\\.)\\&nbsp;\\((.*?)\\)<").getMatch(1);
   if (filename == null) {
     throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
   }
   downloadLink.setName(filename.trim());
   if (filesize != null) {
     filesize = Encoding.htmlDecode(filesize);
     downloadLink.setDownloadSize(SizeFormatter.getSize(filesize.replace(",", ".")));
   }
   String md5Hash = br.getRegex("/>MD5:(.*?)<").getMatch(0);
   if (md5Hash != null && md5Hash.trim().length() == 32) {
     downloadLink.setMD5Hash(md5Hash.trim());
   } else {
     /* fix broken md5 sums */
     downloadLink.setMD5Hash(null);
   }
   return AvailableStatus.TRUE;
 }
Exemple #14
0
 private void getDllink(final String linkPart) throws IOException {
   final String vkey = new Regex(Encoding.htmlDecode(linkPart), "vkey=([0-9a-f]+)").getMatch(0);
   br.getPage(
       "http://www.nuvid.com"
           + Encoding.htmlDecode(linkPart)
           + "&pkey="
           + JDHash.getMD5(vkey + Encoding.Base64Decode("aHlyMTRUaTFBYVB0OHhS")));
   dllink = br.getRegex("<video_file>(http://.*?)</video_file>").getMatch(0);
   if (dllink == null) {
     dllink =
         br.getRegex("<video_file><\\!\\[CDATA\\[(http://.*?)\\]\\]></video_file>").getMatch(0);
   }
 }
Exemple #15
0
 @Override
 public AvailableStatus requestFileInformation(final DownloadLink downloadLink)
     throws IOException, PluginException {
   /* Offline links should also have nice filenames */
   downloadLink.setName(
       new Regex(
               downloadLink.getDownloadURL(),
               "presstv\\.ir/detail/\\d{4}/\\d{2}/\\d{2}/\\d+/([A-Za-z0-9\\-]+)/")
           .getMatch(0));
   this.setBrowserExclusive();
   br.setFollowRedirects(true);
   br.getPage(downloadLink.getDownloadURL());
   if (br.containsHTML("The requested page was not found|<title>No Operation</title>"))
     throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
   String ext;
   String filename = br.getRegex("id=\\'divTitle\\'>([^<>\"]*?)</div>").getMatch(0);
   if (filename == null)
     filename = br.getRegex("property=\"og:title\" content=\"([^<>\"]*?)\"").getMatch(0);
   if (filename == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
   /* Decide between video and photo */
   if (br.containsHTML("property=\"og:video\"")) {
     DLLINK = br.getRegex("\\(\\'file\\', \\'(presstv[^<>\"]*?)\\'\\)").getMatch(0);
     if (DLLINK == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
     DLLINK = "http://64.150.186.181/" + Encoding.htmlDecode(DLLINK).replace("/mp4:", "/");
     ext = DLLINK.substring(DLLINK.lastIndexOf("."));
     if (ext == null || ext.length() > 5) ext = ".mp4";
   } else {
     DLLINK = br.getRegex("id=\\'imgMain\\' src=\\'(http://[^<>\"]*?)\\'").getMatch(0);
     if (DLLINK == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
     ext = DLLINK.substring(DLLINK.lastIndexOf("."));
     if (ext == null || ext.length() > 5) ext = ".jpg";
   }
   filename = filename.trim();
   downloadLink.setFinalFileName(encodeUnicode(Encoding.htmlDecode(filename)) + ext);
   final Browser br2 = br.cloneBrowser();
   // In case the link redirects to the finallink
   br2.setFollowRedirects(true);
   URLConnectionAdapter con = null;
   try {
     con = br2.openGetConnection(DLLINK);
     if (!con.getContentType().contains("html"))
       downloadLink.setDownloadSize(con.getLongContentLength());
     else throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
     return AvailableStatus.TRUE;
   } finally {
     try {
       con.disconnect();
     } catch (final Throwable e) {
     }
   }
 }
Exemple #16
0
 @Override
 public AvailableStatus requestFileInformation(final DownloadLink downloadLink)
     throws IOException, PluginException {
   this.setBrowserExclusive();
   br.setFollowRedirects(true);
   br.getPage(downloadLink.getDownloadURL());
   if (br.getHttpConnection().getResponseCode() == 404) {
     throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
   }
   String filename = br.getRegex("<title>([^<>\"]*?) \\- Pornicom\\.com</title>").getMatch(0);
   DLLINK = checkDirectLink(downloadLink, "directlink");
   if (DLLINK == null) {
     DLLINK = br.getRegex("video_url: \\'(http[^<>\"]*?)\\'").getMatch(0);
   }
   if (filename == null || DLLINK == null) {
     throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
   }
   DLLINK = Encoding.htmlDecode(DLLINK);
   filename = Encoding.htmlDecode(filename);
   filename = filename.trim();
   filename = encodeUnicode(filename);
   String ext = DLLINK.substring(DLLINK.lastIndexOf("."));
   if (ext == null || ext.length() > 5) {
     ext = ".flv";
   }
   ext = ext.replace(".flv/", ".flv");
   downloadLink.setFinalFileName(Encoding.htmlDecode(filename) + ext);
   final Browser br2 = br.cloneBrowser();
   // In case the link redirects to the finallink
   br2.setFollowRedirects(true);
   URLConnectionAdapter con = null;
   try {
     try {
       con = br2.openGetConnection(DLLINK);
     } catch (final BrowserException e) {
       throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
     }
     if (!con.getContentType().contains("html")) {
       downloadLink.setDownloadSize(con.getLongContentLength());
     } else {
       throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
     }
     downloadLink.setProperty("directlink", DLLINK);
     return AvailableStatus.TRUE;
   } finally {
     try {
       con.disconnect();
     } catch (final Throwable e) {
     }
   }
 }
Exemple #17
0
 private void decryptLinks(final ArrayList<DownloadLink> decryptedLinks, final CryptedLink param)
     throws Exception {
   br.setFollowRedirects(false);
   final String[] matches = br.getRegex("getFile\\('(cid=\\w*?&lid=\\d*?)'\\)").getColumn(0);
   try {
     Browser brc = null;
     for (final String match : matches) {
       Thread.sleep(2333);
       handleCaptchaAndPassword("http://www.relink.us/frame.php?" + match, param);
       if (ALLFORM != null && ALLFORM.getRegex("captcha").matches()) {
         logger.warning("Falsche Captcheingabe, Link wird übersprungen!");
         continue;
       }
       brc = br.cloneBrowser();
       if (brc != null
           && brc.getRedirectLocation() != null
           && brc.getRedirectLocation().contains("relink.us/getfile")) {
         brc.getPage(brc.getRedirectLocation());
       }
       if (brc.getRedirectLocation() != null) {
         final DownloadLink dl =
             createDownloadlink(Encoding.htmlDecode(brc.getRedirectLocation()));
         try {
           distribute(dl);
         } catch (final Throwable e) {
           /* does not exist in 09581 */
         }
         decryptedLinks.add(dl);
         break;
       } else {
         final String url = brc.getRegex("iframe.*?src=\"(.*?)\"").getMatch(0);
         final DownloadLink dl = createDownloadlink(Encoding.htmlDecode(url));
         if (url != null) {
           try {
             distribute(dl);
           } catch (final Throwable e) {
             /* does not exist in 09581 */
           }
           decryptedLinks.add(dl);
         } else {
           /* as bot detected */
           return;
         }
       }
       PROGRESS.increase(1);
     }
   } finally {
     br.setFollowRedirects(true);
   }
 }
 @Override
 public AvailableStatus requestFileInformation(DownloadLink downloadLink)
     throws IOException, PluginException {
   this.setBrowserExclusive();
   br.setFollowRedirects(true);
   br.getPage(downloadLink.getDownloadURL());
   if (br.containsHTML("(nodata\\.png\"|<title>Videos \\| )"))
     throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
   String filename = br.getRegex(">Back to main page</a></div>(.*?)</h2>").getMatch(0);
   if (filename == null) filename = br.getRegex("<title>(.*?) \\| Videos \\| ").getMatch(0);
   if (filename == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
   if (br.containsHTML(VIDEOUNAVAILABLE)) {
     // Don't set final filename in this case, it's set once the video is
     // downloadable again!
     downloadLink.setName(Encoding.htmlDecode(filename) + ".flv");
     downloadLink
         .getLinkStatus()
         .setStatusText(
             JDL.L("plugins.hoster.groups.videobeingencoded", VIDEOUNAVAILABLEUSERTEXT));
     return AvailableStatus.TRUE;
   }
   DLLINK = br.getRegex("addParam\\(\\'flashvars\\',\\'\\&file=(http://.*?)\\'").getMatch(0);
   if (DLLINK == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
   DLLINK = Encoding.htmlDecode(DLLINK);
   DLLINK = Encoding.urlDecode(DLLINK, true);
   filename = filename.trim();
   Browser br2 = br.cloneBrowser();
   br2.setFollowRedirects(false);
   br2.getPage(DLLINK);
   DLLINK = br2.getRedirectLocation();
   if (DLLINK == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
   downloadLink.setFinalFileName(
       Encoding.htmlDecode(filename) + DLLINK.substring(DLLINK.length() - 4, DLLINK.length()));
   URLConnectionAdapter con = null;
   try {
     con = br2.openGetConnection(DLLINK);
     if (!con.getContentType().contains("html") && con.getLongContentLength() != 0) {
       downloadLink.setDownloadSize(con.getLongContentLength());
     } else {
       throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
     }
     return AvailableStatus.TRUE;
   } finally {
     try {
       con.disconnect();
     } catch (Throwable e) {
     }
   }
 }
Exemple #19
0
 @Override
 public AvailableStatus requestFileInformation(final DownloadLink link)
     throws IOException, PluginException {
   this.setBrowserExclusive();
   br.setFollowRedirects(true);
   br.getPage(link.getDownloadURL());
   if (br.getURL().contains(SIMULTANDLSLIMIT) || br.getURL().contains(SIMULTANDLSLIMIT_2)) {
     link.setName(new Regex(link.getDownloadURL(), "([A-Za-z0-9]+)$").getMatch(0));
     link.getLinkStatus().setStatusText(SIMULTANDLSLIMITUSERTEXT);
     return AvailableStatus.TRUE;
   } else if (br.getURL().contains(SERVERERROR)) {
     link.setName(new Regex(link.getDownloadURL(), "([A-Za-z0-9]+)$").getMatch(0));
     link.getLinkStatus().setStatusText(SERVERERRORUSERTEXT);
     return AvailableStatus.TRUE;
   }
   if (br.getURL().contains("/error." + TYPE)
       || br.getURL().contains("/index." + TYPE)
       || br.containsHTML("No htmlCode read")
       || !br.containsHTML("class=\"downloadPageTableV2\"")) {
     throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
   }
   final Regex fInfo =
       br.getRegex(
           "<th class=\"descr\"([^<>]*?)?>[\t\n\r ]+<strong>([^<>\"]*?) \\((\\d+(,\\d+)?(\\.\\d+)? (KB|MB|GB))\\)<br/>");
   final String filename = fInfo.getMatch(1);
   final String filesize = fInfo.getMatch(2);
   if (filename == null || filesize == null) {
     throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
   }
   link.setName(Encoding.htmlDecode(filename.trim()));
   link.setDownloadSize(SizeFormatter.getSize(filesize.replace(",", "")));
   return AvailableStatus.TRUE;
 }
Exemple #20
0
 @Override
 public boolean checkLinks(final DownloadLink[] urls) {
   if (urls == null || urls.length == 0) {
     return false;
   }
   try {
     final Browser br = new Browser();
     prepBrowser(br);
     br.setCookiesExclusive(true);
     final StringBuilder sb = new StringBuilder();
     final ArrayList<DownloadLink> links = new ArrayList<DownloadLink>();
     int index = 0;
     while (true) {
       links.clear();
       while (true) {
         /* we test 50 links at once */
         if (index == urls.length || links.size() > 50) {
           break;
         }
         links.add(urls[index]);
         index++;
       }
       sb.delete(0, sb.capacity());
       sb.append("op=checkfiles&process=Check+URLs&list=");
       for (final DownloadLink dl : links) {
         sb.append(dl.getDownloadURL());
         sb.append("%0A");
       }
       br.postPage("http://qtyfiles.com/?op=checkfiles", sb.toString());
       for (final DownloadLink dllink : links) {
         if (br.containsHTML(
             ">" + dllink.getDownloadURL() + "</td><td style=\"color:red;\">Not found\\!</td>")) {
           dllink.setAvailable(false);
         } else {
           final String[][] linkInformation =
               br.getRegex(
                       ">"
                           + dllink.getDownloadURL()
                           + "</td><td style=\"color:green;\">Found</td><td>([^<>\"]*?)</td>")
                   .getMatches();
           if (linkInformation == null) {
             logger.warning("Linkchecker broken for qtyfiles.com");
             return false;
           }
           String name = extractFileNameFromURL(dllink.getDownloadURL());
           final String size = linkInformation[0][0];
           dllink.setAvailable(true);
           dllink.setName(Encoding.htmlDecode(name).replace(".html", ""));
           dllink.setDownloadSize(SizeFormatter.getSize(size));
         }
       }
       if (index == urls.length) {
         break;
       }
     }
   } catch (final Exception e) {
     return false;
   }
   return true;
 }
Exemple #21
0
 /** @param downloadLink */
 private void fixFilename(final DownloadLink downloadLink) {
   String oldName = downloadLink.getFinalFileName();
   if (oldName == null) {
     oldName = downloadLink.getName();
   }
   final String serverFilename = Encoding.htmlDecode(getFileNameFromHeader(dl.getConnection()));
   String newExtension = null;
   // some streaming sites do not provide proper file.extension within headers (Content-Disposition
   // or the fail over getURL()).
   if (serverFilename == null) {
     logger.info("Server filename is null, keeping filename: " + oldName);
   } else {
     if (serverFilename.contains(".")) {
       newExtension = serverFilename.substring(serverFilename.lastIndexOf("."));
     } else {
       logger.info("HTTP headers don't contain filename.extension information");
     }
   }
   if (newExtension != null && !oldName.endsWith(newExtension)) {
     String oldExtension = null;
     if (oldName.contains(".")) {
       oldExtension = oldName.substring(oldName.lastIndexOf("."));
     }
     if (oldExtension != null && oldExtension.length() <= 5) {
       downloadLink.setFinalFileName(oldName.replace(oldExtension, newExtension));
     } else {
       downloadLink.setFinalFileName(oldName + newExtension);
     }
   }
 }
Exemple #22
0
 /**
  * This fixes filenames from all xfs modules: file hoster, audio/video streaming (including
  * transcoded video), or blocked link checking which is based on fuid.
  *
  * @version 0.2
  * @author raztoki
  */
 private void fixFilename(final DownloadLink downloadLink) {
   String orgName = null;
   String orgExt = null;
   String servName = null;
   String servExt = null;
   String orgNameExt = downloadLink.getFinalFileName();
   if (orgNameExt == null) orgNameExt = downloadLink.getName();
   if (!inValidate(orgNameExt) && orgNameExt.contains("."))
     orgExt = orgNameExt.substring(orgNameExt.lastIndexOf("."));
   if (!inValidate(orgExt)) orgName = new Regex(orgNameExt, "(.+)" + orgExt).getMatch(0);
   else orgName = orgNameExt;
   // if (orgName.endsWith("...")) orgName = orgName.replaceFirst("\\.\\.\\.$", "");
   String servNameExt = Encoding.htmlDecode(getFileNameFromHeader(dl.getConnection()));
   if (!inValidate(servNameExt) && servNameExt.contains(".")) {
     servExt = servNameExt.substring(servNameExt.lastIndexOf("."));
     servName = new Regex(servNameExt, "(.+)" + servExt).getMatch(0);
   } else servName = servNameExt;
   String FFN = null;
   if (orgName.equalsIgnoreCase(fuid.toLowerCase())) FFN = servNameExt;
   else if (inValidate(orgExt)
       && !inValidate(servExt)
       && (servName.toLowerCase().contains(orgName.toLowerCase())
           && !servName.equalsIgnoreCase(orgName)))
     // when partial match of filename exists. eg cut off by quotation mark miss match, or
     // orgNameExt has been abbreviated by hoster.
     FFN = servNameExt;
   else if (!inValidate(orgExt) && !inValidate(servExt) && !orgExt.equalsIgnoreCase(servExt))
     FFN = orgName + servExt;
   else FFN = orgNameExt;
   downloadLink.setFinalFileName(FFN);
 }
  // @Override
  public ArrayList<DownloadLink> decryptIt(CryptedLink param, ProgressController progress)
      throws Exception {
    ArrayList<DownloadLink> decryptedLinks = new ArrayList<DownloadLink>();
    String parameter = param.toString();

    br.getPage(parameter);

    Form form = br.getForm(1);
    for (int i = 0; i <= 5; i++) {
      String code = getCaptchaCode("http://alpha-link.eu/captcha/captcha.php", param);
      form.put("captcha", code);
      form.setAction(parameter);
      br.submitForm(form);
      if (!br.containsHTML("(Code ist falsch)|(kein Code eingegeben)")) break;
    }
    form = br.getForm(1);
    String[] ids = br.getRegex("class='btn' name='id' value='(\\d+)'").getColumn(0);
    if (ids.length == 0) return null;
    progress.setRange(ids.length);
    for (String id : ids) {
      form.put("id", id);
      br.submitForm(form);

      String codedLink = br.getRegex("src=.\"(.*?).\"").getMatch(0);
      if (codedLink == null) return null;
      String link = Encoding.htmlDecode(codedLink);

      decryptedLinks.add(createDownloadlink(link));
      progress.increase(1);
    }
    return decryptedLinks;
  }
Exemple #24
0
 @SuppressWarnings("deprecation")
 @Override
 public AvailableStatus requestFileInformation(final DownloadLink link)
     throws IOException, PluginException {
   this.setBrowserExclusive();
   br.setFollowRedirects(true);
   br.getPage(link.getDownloadURL());
   if (br.getHttpConnection().getResponseCode() == 404
       || this.br.containsHTML("img/404\\.jpg\"|>Whoops\\! 404")) {
     throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
   }
   String filename = br.getRegex("<td>Dateiname:</td><td>([^<>\"]*?)<").getMatch(0);
   String filesize = br.getRegex("<td>Dateigröße:</td><td>([^<>\"]*?)<").getMatch(0);
   if (filename == null || filesize == null) {
     Regex filenameSize = br.getRegex("<p class=\"intro\"><b>(.*?)</b>\\s*\\((.*?)\\)");
     if (filename == null) {
       filename = filenameSize.getMatch(0);
     }
     if (filesize == null) {
       filesize = filenameSize.getMatch(1);
     }
   }
   if (filename == null) {
     throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
   }
   link.setName(Encoding.htmlDecode(filename.trim()));
   if (filesize != null) {
     link.setDownloadSize(SizeFormatter.getSize(filesize));
   }
   return AvailableStatus.TRUE;
 }
Exemple #25
0
 @Override
 public AvailableStatus requestFileInformation(final DownloadLink link)
     throws IOException, PluginException {
   this.setBrowserExclusive();
   br.setFollowRedirects(true);
   br.getPage(link.getDownloadURL());
   if (br.containsHTML("(>File Not Found<|>The file you were looking for could not be found)"))
     throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
   // For invalid links
   if (br.containsHTML(">403 Forbidden<"))
     throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
   String filename = br.getRegex(">Filename:</span> <div title=\"([^<>\"]*?)\"").getMatch(0);
   if (filename == null)
     filename =
         br.getRegex(
                 "<title>Dev\\-Host \\- ([^<>\"]*?) \\- The Ultimate Free File Hosting / File Sharing Service</title>")
             .getMatch(0);
   String filesize = br.getRegex("\\((\\d+ bytes)\\)").getMatch(0);
   if (filename == null || filesize == null)
     throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
   link.setName(Encoding.htmlDecode(filename.trim()));
   link.setDownloadSize(SizeFormatter.getSize(filesize));
   final String md5 = br.getRegex(">MD5 Sum:</span> ([a-z0-9]{32})</div>").getMatch(0);
   if (md5 != null) link.setMD5Hash(md5);
   return AvailableStatus.TRUE;
 }
Exemple #26
0
 public ArrayList<DownloadLink> decryptIt(CryptedLink param, ProgressController progress)
     throws Exception {
   ArrayList<DownloadLink> decryptedLinks = new ArrayList<DownloadLink>();
   final String parameter = param.toString();
   br.setFollowRedirects(true);
   br.getPage(parameter);
   if (br.containsHTML(">Dieser Container \\(ID\\) existiert nicht")) {
     logger.info("Link offline: " + parameter);
     return decryptedLinks;
   }
   final String fpName = br.getRegex("<h5><span title=\"([^<>\"]*?)\"").getMatch(0);
   final String links[] = br.getRegex("\\'(/download/[A-Za-z0-9]+)\'").getColumn(0);
   if (links == null || links.length == 0) {
     logger.warning("Decrypter broken for link: " + parameter);
     return null;
   }
   for (String link : links) {
     decryptedLinks.add(createDownloadlink("http://remixshare.com" + link));
   }
   if (fpName != null) {
     final FilePackage fp = FilePackage.getInstance();
     fp.setName(Encoding.htmlDecode(fpName.trim()));
     fp.addLinks(decryptedLinks);
   }
   return decryptedLinks;
 }
  @Override
  public AvailableStatus requestFileInformation(DownloadLink downloadLink)
      throws IOException, InterruptedException, PluginException {
    br.setFollowRedirects(true);
    for (int i = 0; i < 5; i++) {
      /* hoster blocks several useragents */
      this.setBrowserExclusive();
      br.getHeaders().put("User-Agent", RandomUserAgent.generate());
      br.setCookie("http://www.storeplace.org", "setlang", "en");
      br.getPage(downloadLink.getDownloadURL());
      if (!br.containsHTML("User-Agent not allowed")) break;
      Thread.sleep(250);
    }
    if (br.containsHTML("User-Agent not allowed"))
      throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
    if (br.containsHTML("Your requested file is not found"))
      throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
    String filename =
        Encoding.htmlDecode(
            br.getRegex("File name:</b></td>.*?<td align=.*?width=[0-9]+px>(.*?)</td>")
                .getMatch(0));
    String filesize = br.getRegex("File size:</b></td>.*?<td align=left>(.*?)</td>").getMatch(0);
    if (filename == null || filesize == null)
      throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
    downloadLink.setName(filename.trim());
    downloadLink.setDownloadSize(SizeFormatter.getSize(filesize.trim()));

    return AvailableStatus.TRUE;
  }
Exemple #28
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();
 }
Exemple #29
0
 @Override
 public AvailableStatus requestFileInformation(DownloadLink link)
     throws IOException, PluginException {
   this.setBrowserExclusive();
   br.setFollowRedirects(true);
   br.setCookie("http://www.share4web.com/", "lang", "en");
   br.getPage(link.getDownloadURL());
   if (br.containsHTML(">File not found or removed|Page Not Found|File not found"))
     throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
   if (br.containsHTML(SECURITYCAPTCHA)) {
     link.getLinkStatus().setStatusText("Can't check status, security captcha...");
     return AvailableStatus.UNCHECKABLE;
   }
   final Regex fileInfo =
       br.getRegex(
           "<small>Download file:</small><br/>([^<>\"]*?)<small>\\(([^<>\"]*?)\\)</small>");
   String filename = fileInfo.getMatch(0);
   String filesize = fileInfo.getMatch(1);
   if (filename == null || filesize == null)
     throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
   // Server sends filename with .exe ending, prevent it by setting final
   // filename here
   link.setFinalFileName(Encoding.htmlDecode(filename.trim()));
   link.setDownloadSize(SizeFormatter.getSize(filesize));
   return AvailableStatus.TRUE;
 }
Exemple #30
0
  private String feedGetMediagenURL() {
    String flvgen_url =
        br.getRegex("(https?://[^<>\"]*?/www/xml/flv/flvgen\\.jhtml\\?[^<>\"]*?hiLoPref=hi)")
            .getMatch(0);
    if (flvgen_url == null) {
      flvgen_url =
          br.getRegex("(https?://[^<>\"]*?/www/xml/flv/flvgen\\.jhtml\\?[^<>\"]*?hiLoPref=lo)")
              .getMatch(0);
    }
    if (flvgen_url != null) {
      flvgen_url = Encoding.htmlDecode(flvgen_url);
    }

    String mediagen_url =
        br.getRegex("(?:\\'|\")(https?://[^<>\"]*?mediaGen[^<>\"]*?)(?:\\'|\")").getMatch(0);
    if (mediagen_url == null) {
      mediagen_url =
          br.getRegex("(?:\\'|\")(https?://[^<>\"]*?/mediagen/[^<>\"/]*?)(?:\\'|\")").getMatch(0);
    }
    /* flvgen - special cases e.g. for uk.viva.tv and gameone.de */
    if (mediagen_url == null) {
      mediagen_url = flvgen_url;
    }
    return mediagen_url;
  }