Example #1
0
 @SuppressWarnings("deprecation")
 public ArrayList<DownloadLink> decryptIt(CryptedLink param, ProgressController progress)
     throws Exception {
   /* we first have to load the plugin, before we can reference it */
   JDUtilities.getPluginForHost("viva.tv");
   default_ext = jd.plugins.hoster.VivaTv.default_ext;
   parameter = param.toString();
   jd.plugins.hoster.VivaTv.prepBR(this.br);
   if (parameter.matches(type_viva) || parameter.matches(type_mtv_de)) {
     decryptMtvGermanyPlaylists();
   } else if (parameter.matches(type_southpark_de_episode)) {
     decryptSouthparkDe();
   } else if (parameter.matches(type_southpark_cc_episode)) {
     decryptSouthparkCc();
   } else if (parameter.matches(type_nickmom_com)) {
     decryptNickmomCom();
   } else if (parameter.matches(type_mtv_com)) {
     decryptMtvCom();
   } else if (parameter.matches(type_logotv_com)) {
     decrypLogoTvCom();
   } else {
     /* Universal viacom crawler */
     this.br.getPage(parameter);
     vivaUniversalCrawler();
   }
   return decryptedLinks;
 }
Example #2
0
  @SuppressWarnings("deprecation")
  @Override
  public AvailableStatus requestFileInformation(final DownloadLink link)
      throws IOException, PluginException {
    String filename = link.getStringProperty("decryptedfilename", null);
    String ext = null;
    String description = null;
    this.setBrowserExclusive();
    prepBR(this.br);
    // final String main_url = link.getStringProperty("mainlink", null);
    this.mgid = getMGIDOutOfURL(link.getDownloadURL());
    this.feed_url = mgidGetFeedurlForMgid(this.mgid);
    this.mediagen_url = mgidGetMediagenurlForMgid(this.mgid);

    if (this.feed_url == null) {
      throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
    }

    if (filename == null) {
      if (this.mgid.contains("nick")) {
        /* Very strange but this is needed for all "nick" websites */
        this.br.setCookie("nick.com", "Visited", "Yes");
      }
      /* Maybe filename was set in decypter already --> No reason to access feed here! */
      br.getPage(this.feed_url);
      final int responsecode = this.br.getHttpConnection().getResponseCode();
      if (responsecode == 404 || responsecode == 500 || this.br.toString().length() < 300) {
        throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
      }
      filename = feedGetFilename();
    }
    if (filename == null) {
      throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
    }
    description = feedGetDescription();
    ext = default_ext;
    filename = doFilenameEncoding(this, filename);
    if (!filename.endsWith(ext)) {
      filename += ext;
    }
    link.setFinalFileName(filename);

    if (description != null && description.length() > 20) {
      description = doEncoding(description);
      try {
        link.setComment(description);
      } catch (final Throwable e) {
        /* Not available in old 0.9.581 Stable */
      }
    }
    return AvailableStatus.TRUE;
  }