public static void startServer(String serverip, final boolean rawmode) {
   steps = new Vector<String>();
   AUTH = null;
   running = true;
   steps.add("[[[HSRC]]]");
   int port = 80;
   try {
     Server_Socket_HTTP =
         new ServerSocket(
             SubConfiguration.getConfig("ReconnectRecorder")
                 .getIntegerProperty(ReconnectRecorder.PROPERTY_PORT, 8972));
     Server_Socket_HTTPS =
         new ServerSocket(
             SubConfiguration.getConfig("ReconnectRecorder")
                     .getIntegerProperty(ReconnectRecorder.PROPERTY_PORT, 8972)
                 + 1);
     if (serverip.contains(":")) {
       final String ports = new Regex(serverip, ".*?:(\\d+)").getMatch(0);
       port = Integer.parseInt(ports);
       serverip = new Regex(serverip, "(.*?):").getMatch(0);
     }
     new JDRRServer(Server_Socket_HTTP, serverip, port, false, rawmode).start();
     new JDRRServer(Server_Socket_HTTPS, serverip, 443, true, rawmode).start();
   } catch (Exception e) {
     JDLogger.exception(e);
   }
 }
  public String getFormattedFilename(final DownloadLink downloadLink) throws ParseException {
    String songTitle = downloadLink.getStringProperty("plainfilename", null);
    final SubConfiguration cfg = SubConfiguration.getConfig("soundcloud.com");
    String formattedFilename = cfg.getStringProperty(CUSTOM_FILENAME, defaultCustomFilename);
    if (formattedFilename == null || formattedFilename.equals(""))
      formattedFilename = defaultCustomFilename;
    if (!formattedFilename.contains("*songtitle*") || !formattedFilename.contains("*ext*"))
      formattedFilename = defaultCustomFilename;
    String ext = downloadLink.getStringProperty("type", null);
    if (ext != null) ext = "." + ext;
    else ext = ".mp3";

    String date = downloadLink.getStringProperty("originaldate", null);
    final String channelName = downloadLink.getStringProperty("channel", null);

    String formattedDate = null;
    if (date != null && formattedFilename.contains("*date*")) {
      // 2011-08-10T22:50:49Z
      date = date.replace("T", ":");
      final String userDefinedDateFormat =
          cfg.getStringProperty(CUSTOM_DATE, "dd.MM.yyyy_HH-mm-ss");
      SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd:HH:mm");
      Date dateStr = formatter.parse(date);

      formattedDate = formatter.format(dateStr);
      Date theDate = formatter.parse(formattedDate);

      if (userDefinedDateFormat != null) {
        try {
          formatter = new SimpleDateFormat(userDefinedDateFormat);
          formattedDate = formatter.format(theDate);
        } catch (Exception e) {
          // prevent user error killing plugin.
          formattedDate = "";
        }
      }
      if (formattedDate != null)
        formattedFilename = formattedFilename.replace("*date*", formattedDate);
      else formattedFilename = formattedFilename.replace("*date*", "");
    }
    if (formattedFilename.contains("*channelname*") && channelName != null) {
      formattedFilename = formattedFilename.replace("*channelname*", channelName);
    }
    formattedFilename = formattedFilename.replace("*ext*", ext);
    // Insert filename at the end to prevent errors with tags
    formattedFilename = formattedFilename.replace("*songtitle*", songTitle);

    return formattedFilename;
  }
 public void mouseReleased(final MouseEvent e) {
   this.result = e.getPoint();
   final int size =
       SubConfiguration.getConfig("JAC").getIntegerProperty(Configuration.PARAM_CAPTCHA_SIZE, 100);
   if (size != 100) {
     this.result.setLocation(
         this.result.getX() / (size / 100.0f), this.result.getY() / (size / 100.0f));
   }
   this.dispose();
 }
  /**
   * converts from old subconfig to new JSOnstorage
   *
   * @param string
   * @param ret
   */
  private static void convert(String string, JSonWrapper ret) {
    SubConfiguration subConfig = SubConfiguration.getConfig(string);
    HashMap<String, Object> props = subConfig.getProperties();
    if (props != null && props.size() > 0) {
      Entry<String, Object> next;
      for (Iterator<Entry<String, Object>> it = props.entrySet().iterator(); it.hasNext(); ) {
        next = it.next();
        try {
          ret.setProperty(next.getKey(), next.getValue());
        } catch (Throwable e) {
          Log.exception(e);
        }
        it.remove();
      }

      subConfig.setProperties(props);
      subConfig.save();
      ret.save();
    }
  }
Example #5
0
    @Override
    protected ConfigContainer setupContainer() {
        ConfigEntry ce;

        final ConfigContainer look = new ConfigContainer();

        look.setGroup(new ConfigGroup(_GUI._.gui_config_gui_view(), "gui"));
        look.addEntry(ce = new ConfigEntry(ConfigContainer.TYPE_COMBOBOX, SubConfiguration.getConfig(JDL.CONFIG), JDL.LOCALE_PARAM_ID, JDL.getLocaleIDs().toArray(new JDLocale[] {}), _GUI._.gui_config_gui_language()));
        ce.setDefaultValue(JDL.DEFAULT_LOCALE);
        ce.setPropertyType(PropertyType.NEEDS_RESTART);

        // if
        // (LookAndFeelController.getInstance().getSupportedLookAndFeels().length
        // > 1) {
        // look.addEntry(ce = new ConfigEntry(ConfigContainer.TYPE_COMBOBOX,
        // this.subConfig, LookAndFeelController.PARAM_PLAF,
        // LookAndFeelController.getInstance().getSupportedLookAndFeels(),
        // T._.gui_config_gui_plaf()));
        // ce.setDefaultValue(LookAndFeelController.getInstance().getPlaf());
        // ce.setPropertyType(PropertyType.NEEDS_RESTART);
        // }

        look.setGroup(new ConfigGroup(_GUI._.gui_config_gui_feel(), "settings"));
        // look.addEntry(ce = new ConfigEntry(ConfigContainer.TYPE_SPINNER,
        // this.subConfig, JDGuiConstants.PARAM_INPUTTIMEOUT,
        // JDL.L("gui.config.gui.inputtimeout", "Timeout for InputWindows"), 0,
        // 600, 5));
        // ce.setDefaultValue(20);
        // ce.setPropertyType(PropertyType.NEEDS_RESTART);
        // look.addEntry(ce = new ConfigEntry(ConfigContainer.TYPE_CHECKBOX,
        // this.subConfig, JDGuiConstants.PARAM_SHOW_BALLOON,
        // JDL.L("gui.config.gui.showBalloon", "Show Balloon infos")));
        // ce.setDefaultValue(false);
        look.addEntry(ce = new ConfigEntry(ConfigContainer.TYPE_BUTTON, new ActionListener() {

            public void actionPerformed(final ActionEvent e) {
                AbstractDialog.resetDialogInformations();
                UserIO.getInstance().requestMessageDialog(_GUI._.gui_config_gui_resetdialogs_message());
            }

        }, _GUI._.gui_config_gui_resetdialogs_short(), _GUI._.gui_config_gui_resetdialogs2(), NewTheme.I().getIcon("restart", 16)));

        look.setGroup(new ConfigGroup(_GUI._.gui_config_gui_performance(), "guiperformance"));
        look.addEntry(ce = new ConfigEntry(ConfigContainer.TYPE_CHECKBOX, this.subConfig, JDGuiConstants.DECORATION_ENABLED, _GUI._.gui_config_gui_decoration()));
        ce.setDefaultValue(true);
        ce.setPropertyType(PropertyType.NEEDS_RESTART);

        look.setGroup(new ConfigGroup(_GUI._.gui_config_gui_barrierfree(), "barrierfreesettings"));
        look.addEntry(ce = new ConfigEntry(ConfigContainer.TYPE_SPINNER, this.subConfig, JDGuiConstants.PARAM_GENERAL_FONT_SIZE, _GUI._.gui_config_gui_font_size(), 50, 200, 10).setDefaultValue(100));
        ce.setPropertyType(PropertyType.NEEDS_RESTART);

        return look;
    }
 private void checkShowFreeDialog() {
   SubConfiguration config = null;
   try {
     config = getPluginConfig();
     if (config.getBooleanProperty("premAdShown", Boolean.FALSE) == false) {
       if (config.getProperty("premAdShown2") == null) {
         File checkFile = JDUtilities.getResourceFile("tmp/cldzn");
         if (!checkFile.exists()) {
           checkFile.mkdirs();
           showFreeDialog("cloudzer.net");
         }
       } else {
         config = null;
       }
     } else {
       config = null;
     }
   } catch (final Throwable e) {
   } finally {
     if (config != null) {
       config.setProperty("premAdShown", Boolean.TRUE);
       config.setProperty("premAdShown2", "shown");
       config.save();
     }
   }
 }
  @Override
  public JComponent layoutDialogContent() {
    final JPanel panel = new JPanel(new MigLayout("ins 5,wrap 1", "[fill,grow]"));

    ImageIcon imageIcon = null;

    if (this.imagefile != null && this.imagefile.exists()) {
      imageIcon = new ImageIcon(this.imagefile.getAbsolutePath());
    } else {
      imageIcon = NewTheme.I().getIcon("ocr", 0);
    }

    final int size =
        SubConfiguration.getConfig("JAC").getIntegerProperty(Configuration.PARAM_CAPTCHA_SIZE, 100);
    if (size != 100) {
      imageIcon =
          new ImageIcon(
              imageIcon
                  .getImage()
                  .getScaledInstance(
                      (int) (imageIcon.getIconWidth() * size / 100.0f),
                      (int) (imageIcon.getIconHeight() * size / 100.0f),
                      Image.SCALE_SMOOTH));
    }

    final JLabel captcha = new JLabel(imageIcon);
    captcha.addMouseListener(this);
    captcha.setCursor(Cursor.getPredefinedCursor(Cursor.CROSSHAIR_CURSOR));
    captcha.setToolTipText(this.explain);

    if (this.explain != null) {
      final JTextPane tf = new JTextPane();
      tf.setBorder(null);
      tf.setBackground(null);
      tf.setContentType("text/html");
      tf.setOpaque(false);
      tf.putClientProperty("Synthetica.opaque", Boolean.FALSE);
      tf.setText(this.explain);
      tf.setEditable(false);
      panel.add(tf, "");
    }
    panel.add(captcha, "w pref!, h pref!, alignx center");

    return panel;
  }
  public JDSimpleWebserver() {
    SubConfiguration subConfig = SubConfiguration.getConfig("WEBINTERFACE");
    Boolean https = subConfig.getBooleanProperty(JDWebinterface.PROPERTY_HTTPS, false);
    AuthUser =
        "******"
            + Encoding.Base64Encode(
                subConfig.getStringProperty(JDWebinterface.PROPERTY_USER, "JD")
                    + ":"
                    + subConfig.getStringProperty(JDWebinterface.PROPERTY_PASS, "JD"));
    NeedAuth = subConfig.getBooleanProperty(JDWebinterface.PROPERTY_LOGIN, true);
    boolean localhostonly =
        subConfig.getBooleanProperty(JDWebinterface.PROPERTY_LOCALHOST_ONLY, false);
    int port = subConfig.getIntegerProperty(JDWebinterface.PROPERTY_PORT, 8765);
    try {
      if (!https) {
        if (localhostonly) {
          Server_Socket = new ServerSocket(port, -1, HttpServer.getLocalHost());
        } else {
          Server_Socket = new ServerSocket(port);
        }
      } else {
        try {
          ServerSocketFactory ssocketFactory = setupSSL();

          if (localhostonly) {
            Server_Socket = ssocketFactory.createServerSocket(port, -1, HttpServer.getLocalHost());
          } else {
            Server_Socket = ssocketFactory.createServerSocket(port);
          }
        } catch (Exception e) {
          logger.severe("WebInterface: Server failed to start (SSL Setup Failed)!");
          return;
        }
      }
      logger.info("Webinterface: Server started");
      start();
    } catch (IOException e) {
      logger.severe("WebInterface: Server failed to start!");
    }
  }
Example #9
0
 /**
  * p gibt das interne properties objekt zurück indem die Plugineinstellungen gespeichert werden
  *
  * @return internes property objekt
  */
 public SubConfiguration getPluginConfig() {
   return SubConfiguration.getConfig(this.wrapper.getConfigName());
 }
Example #10
0
  public ArrayList<DownloadLink> decryptIt(CryptedLink param, ProgressController progress)
      throws Exception {
    ArrayList<DownloadLink> decryptedLinks = new ArrayList<DownloadLink>();
    final String parameter = param.toString();
    JDUtilities.getPluginForHost("sta.sh");
    final SubConfiguration cfg = SubConfiguration.getConfig("sta.sh");
    final boolean force_html_dl = cfg.getBooleanProperty(FORCEHTMLDOWNLOAD, false);
    final boolean linkid_as_filename = cfg.getBooleanProperty(USE_LINKID_AS_FILENAME, false);
    final String main_linkid = new Regex(parameter, "sta\\.sh/(.+)").getMatch(0);
    final DownloadLink main = createDownloadlink(parameter.replace("sta.sh/", "stadecrypted.sh/"));
    if (parameter.matches(INVALIDLINKS)) {
      main.setAvailable(false);
      decryptedLinks.add(main);
      return decryptedLinks;
    }
    try {
      br.getPage(parameter);
    } catch (final BrowserException e) {
      main.setAvailable(false);
      decryptedLinks.add(main);
      return decryptedLinks;
    }
    final String[][] picdata =
        br.getRegex(
                "class=\"thumb\" href=\"(https?://(www\\.)?sta\\.sh/[a-z0-9]+)\" title=\"([^<>\"]*?)\"")
            .getMatches();
    if (picdata == null || picdata.length == 0) {
      decryptedLinks.add(main);
      return decryptedLinks;
    }

    String fpName = br.getRegex("name=\"og:title\" content=\"([^<>\"]*?)\"").getMatch(0);
    if (fpName == null) {
      fpName = new Regex(parameter, "([a-z0-9]+)$").getMatch(0);
    }
    fpName = Encoding.htmlDecode(fpName.trim());

    for (final String singleLinkData[] : picdata) {
      final String url = singleLinkData[0];
      final String linkid = new Regex(url, "sta\\.sh/(.+)").getMatch(0);
      String name = Encoding.htmlDecode(singleLinkData[2]);
      final DownloadLink dl = createDownloadlink(url.replace("sta.sh/", "stadecrypted.sh/"));
      /* Obey user setting */
      if (linkid_as_filename) {
        name = linkid;
      }
      if (force_html_dl) {
        dl.setName(name + ".html");
        dl.setAvailable(true);
      } else {
        /* No ext found --> Don't set available, let host plugin perform a full check to find the correct name */
        final String ext = jd.plugins.hoster.StaSh.getFileExt(this.br);
        if (ext != null) {
          dl.setName(name + "." + ext);
          dl.setAvailable(true);
        } else {
          dl.setName(name);
        }
      }
      decryptedLinks.add(dl);
    }
    final String zipLink = br.getRegex("\"(/zip/[a-z0-9]+)\"").getMatch(0);
    if (cfg.getBooleanProperty(DOWNLOAD_ZIP, false) && zipLink != null) {
      final DownloadLink zip = createDownloadlink(parameter.replace("sta.sh/", "stadecrypted.sh/"));
      zip.setProperty("iszip", true);
      zip.setProperty("directlink", zipLink);
      String zip_filename;
      if (linkid_as_filename) {
        zip_filename = main_linkid;
      } else {
        zip_filename = fpName;
      }
      if (force_html_dl) {
        zip.setName(zip_filename + ".html");
      } else {
        zip.setName(zip_filename + ".zip");
      }
      zip.setAvailable(true);
      decryptedLinks.add(zip);
    }
    final FilePackage fp = FilePackage.getInstance();
    fp.setName(fpName);
    fp.addLinks(decryptedLinks);
    return decryptedLinks;
  }
Example #11
0
 @Override
 public SubConfiguration getPluginConfig() {
   return SubConfiguration.getConfig(lazyC.getDisplayName());
 }
  public AboutDialog() {
    super(DummyFrame.getDialogParent());

    JLabel lbl = new JLabel("JDownloader");
    lbl.setFont(lbl.getFont().deriveFont(lbl.getFont().getSize() * 2.0f));

    String branch =
        SubConfiguration.getConfig("WEBUPDATE").getStringProperty(WebUpdater.BRANCHINUSE, null);
    final String version;
    if (branch == null) {
      version = "JDownloader Build " + JDUtilities.getRevision();
    } else {
      version = "JDownloader -" + branch + "- Build " + JDUtilities.getRevision();
    }

    JPanel links = new JPanel(new MigLayout("ins 0", "[]push[]push[]push[]"));
    try {
      JButton btn =
          Factory.createButton(
              JDL.L(JDL_PREFIX + "license", "Show license"),
              JDTheme.II("gui.images.premium", 16, 16),
              new ActionListener() {

                public void actionPerformed(ActionEvent e) {
                  String license =
                      JDIO.readFileToString(
                          JDUtilities.getResourceFile("licenses/jdownloader.license"));
                  UserIO.getInstance()
                      .requestMessageDialog(
                          UserIO.STYLE_LARGE | UserIO.NO_ICON | UserIO.NO_COUNTDOWN,
                          JDL.L(JDL_PREFIX + "license.title", "JDownloader License"),
                          license);
                }
              });
      btn.setBorder(null);

      links.add(btn);
      links.add(
          new JLink(
              JDL.L(JDL_PREFIX + "homepage", "Homepage"),
              JDTheme.II("gui.images.config.host", 16, 16),
              new URL("http://www.jdownloader.org/home?lng=en")));
      links.add(
          new JLink(
              JDL.L(JDL_PREFIX + "forum", "Support board"),
              JDTheme.II("gui.images.list", 16, 16),
              new URL("http://board.jdownloader.org")));
      links.add(
          new JLink(
              JDL.L(JDL_PREFIX + "contributers", "Contributers"),
              JDTheme.II("gui.images.accounts", 16, 16),
              new URL("http://jdownloader.org/knowledge/wiki/contributers")));
    } catch (MalformedURLException e1) {
      e1.printStackTrace();
    }

    JButton btn =
        Factory.createButton(
            JDL.L(JDL_PREFIX + "copy", "Copy"),
            JDTheme.II("gui.icons.copy", 16, 16),
            new ActionListener() {

              public void actionPerformed(ActionEvent e) {
                StringBuilder sb = new StringBuilder();
                sb.append(version).append("\r\n");
                sb.append("Java Vendor: ").append(System.getProperty("java.vendor")).append("\r\n");
                sb.append("Java Version: ").append(System.getProperty("java.version"));
                ClipboardHandler.getClipboard().copyTextToClipboard(sb.toString());
              }
            });
    btn.setBorder(null);
    btn.setVerticalTextPosition(JButton.BOTTOM);
    btn.setHorizontalTextPosition(JButton.CENTER);

    this.setLayout(new MigLayout("ins 10, wrap 3", "[]15[]push[right]"));
    this.add(new JLabel(JDImage.getImageIcon("logo/jd_logo_128_128")), "aligny center, spany 6");
    this.add(lbl, "spanx");
    this.add(new JLabel("© AppWork UG (haftungsbeschränkt) 2007-2010"), "spanx");
    this.add(new JLabel(version), "gaptop 10");
    this.add(btn, "aligny center, spany 3");
    this.add(new JLabel("JRE Vendor: " + System.getProperty("java.vendor")));
    this.add(new JLabel("JRE Version: " + System.getProperty("java.version")));
    this.add(new JLabel("Synthetica License Registration Number (#289416475)"), "gaptop 10, spanx");
    this.add(links, "gaptop 15, growx, pushx, spanx");
    this.pack();

    this.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
    this.setTitle(JDL.L(JDL_PREFIX + "title", "About JDownloader"));
    this.setResizable(false);
    this.setLocation(Screen.getCenterOfComponent(DummyFrame.getDialogParent(), this));

    /*
     * Fixes Always-on-Top-Bug in windows. Bugdesc: found in svn
     */
    DummyFrame.getDialogParent().setAlwaysOnTop(true);
    DummyFrame.getDialogParent().setAlwaysOnTop(false);

    this.setVisible(true);
  }
Example #13
0
 private static boolean checkSsl() {
   return SubConfiguration.getConfig("crocko.com").getBooleanProperty(SSL_CONNECTION, false);
 }
  /** TODO: Fix/implement subtitle support */
  @SuppressWarnings({"deprecation", "unchecked", "rawtypes"})
  public ArrayList<DownloadLink> decryptIt(CryptedLink param, ProgressController progress)
      throws Exception {
    final String parameter = param.toString();
    String contentID = null;
    String thisvideoID = null;
    String show = null;
    String json = null;
    String videoplayerkey = null;
    String referenceID = null;
    String bitrate = null;
    LinkedHashMap<String, Object> entries = null;
    ArrayList<Object> ressourcelist = null;
    ArrayList<DownloadLink> decryptedLinks = new ArrayList<DownloadLink>();
    final LinkedHashMap<String, String[]> formats = jd.plugins.hoster.DiscoveryCom.formats;
    final String host_nice = new Regex(parameter, "http://(?:www\\.)?([^/]+)").getMatch(0);
    final String host_plain = host_nice.replace(".com", "");
    final String decryptedhost = "http://" + host_nice + "decrypted";
    final SubConfiguration cfg = SubConfiguration.getConfig(DOMAIN);
    final boolean grabSubtitle = cfg.getBooleanProperty(GRAB_SUBTITLE, false);
    final boolean fastLinkcheck = cfg.getBooleanProperty(FAST_LINKCHECK, false);
    br.setFollowRedirects(true);
    br.getPage(parameter);
    if (br.getRequest().getHttpConnection().getResponseCode() == 404) {
      final DownloadLink dl = this.createOfflinelink(parameter);
      decryptedLinks.add(dl);
      return decryptedLinks;
    }
    json = this.br.cloneBrowser().getPage(this.br.getURL() + "?flat=1");
    if (json == null) {
      logger.warning("Decrypter broken for link: " + parameter);
      return null;
    }
    entries =
        (LinkedHashMap<String, Object>)
            jd.plugins.hoster.DummyScriptEnginePlugin.jsonToJavaObject(json);
    videoplayerkey = (String) entries.get("video_player_key");
    if (videoplayerkey == null) {
      videoplayerkey = playerKey;
    }
    ressourcelist = (ArrayList) entries.get("playlist");
    for (final Object plo : ressourcelist) {
      final LinkedHashMap<String, Object> playlist_entry = (LinkedHashMap<String, Object>) plo;
      final String thumbnail = (String) playlist_entry.get("thumbnailURL");
      final Object thisvideoIDo = playlist_entry.get("_id");
      String entryname = (String) playlist_entry.get("name");
      String description = (String) playlist_entry.get("description");
      contentID = (String) playlist_entry.get("contentId");
      if (thisvideoIDo instanceof Integer) {
        thisvideoID = Integer.toString(((Number) thisvideoIDo).intValue());
      } else {
        thisvideoID = (String) thisvideoIDo;
      }
      show = (String) playlist_entry.get("show");
      referenceID = (String) playlist_entry.get("referenceId");
      if (thisvideoID == null
          || show == null
          || entryname == null
          || thumbnail == null
          || referenceID == null) {
        logger.warning("Decrypter broken for link: " + parameter);
        return null;
      }
      show = encodeUnicode(show);
      entryname = encodeUnicode(entryname);
      if (contentID != null && !contentID.equals("")) {
        /* contentID available --> Easy parsing */
        br.getPage(
            "http://snagplayer.video.dp."
                + host_plain
                + ".com/"
                + contentID
                + "/snag-it-player.htm?auto=yes&_fwEnv=prod");
        json = br.getRegex("var videoListJSON = (\\{.*?\\});\n").getMatch(0);
        if (json == null) {
          logger.warning("Decrypter broken for link: " + parameter);
          return null;
        }
        final HashMap<String, Object> videomap =
            (HashMap<String, Object>)
                jd.plugins.hoster.DummyScriptEnginePlugin.jsonToJavaObject(json);
        final long videosCount =
            jd.plugins.hoster.DummyScriptEnginePlugin.toLong(videomap.get("count"), 0);
        if (videosCount <= 0) {
          logger.info("Found no videos for contentID: " + contentID);
          continue;
        }
        final ArrayList<Object> episodelist = (ArrayList) videomap.get("clips");
        for (final Object o : episodelist) {
          String dllink = null;
          final HashMap<String, Object> vinfo = (HashMap<String, Object>) o;
          final ArrayList<Object> vurls = (ArrayList) vinfo.get("mp4");
          String titleseries = (String) vinfo.get("programTitle");
          String titleepisode = (String) vinfo.get("episodeTitle");
          description = (String) vinfo.get("videoCaption");
          final String subtitle = (String) vinfo.get("srtUrl");
          if (titleseries == null || titleepisode == null) {
            return null;
          }
          titleseries = encodeUnicode(titleseries);
          titleepisode = encodeUnicode(titleepisode);
          final String filenamepart = titleseries + " - " + titleepisode;
          final FilePackage fp = FilePackage.getInstance();
          fp.setName(filenamepart);
          DownloadLink dl = null;
          for (final Object urlo : vurls) {
            dl =
                createDownloadlink(
                    decryptedhost + System.currentTimeMillis() + new Random().nextInt(1000000000));
            final HashMap<String, Object> urlinfo = (HashMap<String, Object>) urlo;
            bitrate = (String) urlinfo.get("bitrate");
            dllink = (String) urlinfo.get("href");
            try {
              getFormatString(formats.get(bitrate));
            } catch (final Throwable e) {
              logger.info("currentBITRATE:" + bitrate);
            }
            final String filenamepart_two =
                filenamepart + "_" + getFormatString(formats.get(bitrate));
            try {
              dl.setContentUrl(parameter);
              if (description != null) {
                dl.setComment(description);
              }
            } catch (final Throwable e) {
              /* Not available in old 0.9.581 Stable */
            }
            dl._setFilePackage(fp);
            dl.setProperty("bitrate", bitrate);
            dl.setProperty("mainlink", parameter);
            final String filenamevideo = filenamepart_two + ".mp4";
            /* Video */
            dl.setFinalFileName(filenamevideo);
            dl.setProperty("directlink", dllink);
            dl.setProperty("directfilename", filenamevideo);
            dl.setLinkID(filenamevideo);
            if (fastLinkcheck) {
              dl.setAvailable(true);
            }
            if (cfg.getBooleanProperty(bitrate, false)) {
              decryptedLinks.add(dl);
            }

            // final String filenameaudio = filenamepart_two + ".srt";
            // /* Subtitle */
            // dl.setUrlDownload(decryptedhost + System.currentTimeMillis() + new
            // Random().nextInt(1000000000));
            // dl.setFinalFileName(filenameaudio);
            // dl.setProperty("directlink", subtitle);
            // dl.setProperty("directfilename", filenameaudio);
            // dl.setLinkID(filenameaudio);
            // if (fastLinkcheck) {
            // dl.setAvailable(true);
            // }
            // if (grabSubtitle && !inValidate(subtitle)) {
            // decryptedLinks.add(dl);
            // }
          }
        }
      } else {
        /* contentID NOT available --> Brightcove handling needed --> Nope we can easily avoid this :) */
        /* AMF-Request */
        this.br.getHeaders().put("Content-Type", "application/x-amf");
        getAMFRequest(
            this.br,
            createAMFMessage(
                "ca38f4f2cff16b53daa67436490b7d344d4f222c",
                playerID,
                referenceID,
                video_player_brightcove_id),
            videoplayerkey);
        final String filenamepart = show + " - " + entryname;
        final FilePackage fp = FilePackage.getInstance();
        fp.setName(filenamepart);
        final String[] urls =
            br.getRegex(
                    "(http://discsmil\\.edgesuite\\.net/digmed/dsc/\\d+/[A-Za-z0-9\\-_\\.]+\\-\\d+k\\.mp4)")
                .getColumn(0);
        for (final String dllink : urls) {
          final DownloadLink dl =
              createDownloadlink(
                  decryptedhost + System.currentTimeMillis() + new Random().nextInt(1000000000));
          bitrate = new Regex(dllink, "(\\d+k)\\.mp4$").getMatch(0);
          final String filenamepart_two =
              filenamepart + "_" + getFormatString(formats.get(bitrate));
          try {
            dl.setContentUrl(parameter);
            if (description != null) {
              dl.setComment(description);
            }
          } catch (final Throwable e) {
            /* Not available in old 0.9.581 Stable */
          }
          dl._setFilePackage(fp);
          dl.setProperty("bitrate", bitrate);
          dl.setProperty("mainlink", parameter);
          final String filenamevideo = filenamepart_two + ".mp4";
          /* Video */
          dl.setFinalFileName(filenamevideo);
          dl.setProperty("directlink", dllink);
          dl.setProperty("directfilename", filenamevideo);
          dl.setLinkID(filenamevideo);
          if (fastLinkcheck) {
            dl.setAvailable(true);
          }
          if (cfg.getBooleanProperty(bitrate, false)) {
            decryptedLinks.add(dl);
          }
        }
      }
    }
    if (decryptedLinks.size() == 0) {
      logger.info(
          DOMAIN
              + ": None of the selected formats were found or none were selected, decrypting done...");
      return decryptedLinks;
    }
    return decryptedLinks;
  }