Ejemplo n.º 1
0
 private void downloadRTMP(final DownloadLink downloadLink, String rtmp_src) throws Exception {
   if (!rtmpe_supported) {
     /* Works in most cases. */
     rtmp_src = rtmp_src.replace("rtmpe://", "rtmp://");
   }
   final String ext = rtmp_src.substring(rtmp_src.lastIndexOf(".") + 1);
   String app;
   String rtmphost;
   String playpath;
   String swfurl;
   // if (downloadLink.getDownloadURL().matches(type_mtviggy)) {
   // /* Usually the convertRTMPtoHTTP will work and this code is never executed. */
   // /* Original swfurl contains a lof more info but it's not needed! */
   // swfurl = "http://media.mtvnservices.com/player/prime/mediaplayerprime.2.5.3.swf?uri=" + mgid;
   // app = "viacommtvstrm";
   // rtmphost = "rtmpe://viacommtvstrmfs.fplive.net:1935/viacommtvstrm";
   // playpath = new Regex(rtmp_src, "/(gsp\\..+)").getMatch(0);
   // if (playpath == null) {
   // throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
   // }
   // if (!rtmpe_supported) {
   // throw new PluginException(LinkStatus.ERROR_FATAL, "rtmpe:// not supported!");
   // }
   // rtmp_src = rtmp_src.replace("rtmp://", "rtmpe://");
   // }
   //
   swfurl = "http://player.mtvnn.com/g2/g2player_2.2.1.swf";
   app = new Regex(rtmp_src, "(ondemand/(?:(mtviestor|riptide)/)?)").getMatch(0);
   final Regex host_app = new Regex(rtmp_src, "(rtmp://[^/]*?/)ondemand/(.+)");
   rtmphost = host_app.getMatch(0);
   playpath = new Regex(rtmp_src, app + "(.+)").getMatch(0);
   if (rtmphost == null || playpath == null || app == null) {
     throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
   }
   rtmphost += app;
   playpath = ext + ":" + playpath;
   /* Small fix for serverside wrong rtmp urls */
   playpath = playpath.replace("_od_flv.flv", "_od_flv");
   try {
     dl = new RTMPDownload(this, downloadLink, rtmphost);
   } catch (final NoClassDefFoundError e) {
     throw new PluginException(LinkStatus.ERROR_FATAL, "RTMPDownload class missing");
   }
   /* Setup rtmp connection */
   jd.network.rtmp.url.RtmpUrlConnection rtmp = ((RTMPDownload) dl).getRtmpConnection();
   rtmp.setPageUrl(downloadLink.getStringProperty("page_url", null));
   rtmp.setUrl(rtmp_src);
   rtmp.setApp(app);
   rtmp.setPlayPath(playpath);
   /* Make sure we're using the correct protocol! */
   if (!rtmpe_supported) {
     rtmp.setProtocol(0);
   }
   rtmp.setFlashVer("WIN 16,0,0,305");
   rtmp.setSwfVfy(swfurl);
   /* Our rtmp resuming isn't the best plus we got a lot of different servers so better disable resume to prevent errors. */
   rtmp.setResume(false);
   ((RTMPDownload) dl).startDownload();
 }
Ejemplo n.º 2
0
 private void download(DownloadLink downloadLink) throws Exception {
   requestFileInformation(downloadLink);
   String[] stream = DLLINK.split("@");
   if (DLLINK.startsWith("rtmp")) {
     dl = new RTMPDownload(this, downloadLink, stream[0] + stream[1]);
     setupRTMPConnection(stream, dl);
     ((RTMPDownload) dl).startDownload();
   } else {
     throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
   }
 }
Ejemplo n.º 3
0
  public void download(final DownloadLink downloadLink) throws Exception {
    if (DLLINK.startsWith("rtmp")) {
      dl = new RTMPDownload(this, downloadLink, DLLINK.split("@")[0] + DLLINK.split("@")[1]);
      setupRTMPConnection(dl);
      ((RTMPDownload) dl).startDownload();

    } else if (DLLINK.startsWith("http")) {
      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();
    } else {
      throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
    }
  }
Ejemplo n.º 4
0
  private void download(final DownloadLink downloadLink) throws Exception {
    if (DLCONTENT == null || !DLCONTENT.startsWith("rtmp")) {
      throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
    }
    /* Possible apps: vod/rtl2/flv/, ondemand/flv_dach/vipo/[seriesname]/ */
    final Regex info =
        new Regex(
            DLCONTENT, "([a-z]+://[a-z0-9\\-\\.]+/)([^<>/]+/[^<>/]+/[^<>/]+/(?:[^<>/]+/)?)(.+)");
    dl = new RTMPDownload(this, downloadLink, DLCONTENT);

    final String protocol_host = info.getMatch(0);
    final String app = info.getMatch(1);
    String playpath = info.getMatch(2);
    if (protocol_host == null || app == null || playpath == null) {
      throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
    }

    final String url = protocol_host + app;
    /* Correct playpath */
    /* Notes: Usually we'll have the vod app in this case */
    if (playpath.endsWith(".flv")) {
      playpath = playpath.substring(0, playpath.lastIndexOf("."));
    } else {
      playpath = "mp4:" + playpath;
    }
    /* Setup rtmp connection */
    final jd.network.rtmp.url.RtmpUrlConnection rtmp = ((RTMPDownload) dl).getRtmpConnection();
    rtmp.setPlayPath(playpath);
    rtmp.setSwfVfy(
        "http://www.rtl2.de/sites/default/modules/rtl2/jwplayer/assets/jwplayer.flash.swf");
    rtmp.setFlashVer("WIN 16,0,0,305");
    rtmp.setUrl(url);
    rtmp.setApp(app);
    rtmp.setPageUrl(downloadLink.getDownloadURL());
    rtmp.setResume(true);
    /* Make sure we use the right protocol... */
    rtmp.setProtocol(0);
    // rtmp.setRealTime();
    rtmp.setTimeOut(-10);

    ((RTMPDownload) dl).startDownload();
  }
Ejemplo n.º 5
0
  @Override
  public void handleFree(final DownloadLink downloadLink) throws Exception {
    requestFileInformation(downloadLink);

    final String playpath = br.getRegex("file:'(.*?)',").getMatch(0);
    final String url = br.getRegex("streamer:'(.*?)',").getMatch(0);
    if (playpath == null && url == null) {
      /* videarn now also supports download of the flv stream */
      String directURL = br.getRegex("player\\.swf.*?file: \"(http://.*?)\"").getMatch(0);
      if (directURL != null) {
        dl = jd.plugins.BrowserAdapter.openDownload(br, downloadLink, directURL, true, 0);
        if (dl.getConnection().getContentType() != null
            && dl.getConnection().getContentType().contains("text")) {
          br.followConnection();
          throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
        }
        dl.startDownload();
        return;
      }
    }
    if (playpath == null || url == null) {
      throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
    }
    if (oldStyle())
      throw new PluginException(
          LinkStatus.ERROR_FATAL, "This host only works in the JDownloader 2 BETA version.");
    dl = new RTMPDownload(this, downloadLink, url + playpath);
    final jd.network.rtmp.url.RtmpUrlConnection rtmp = ((RTMPDownload) dl).getRtmpConnection();

    final String host = url.substring(0, url.lastIndexOf("lb/"));
    final String app = "videarn";
    if (host == null || app == null) {
      throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
    }

    rtmp.setResume(false); // Must be set on false
    rtmp.setPlayPath(playpath);
    rtmp.setUrl(host + app);
    rtmp.setSwfUrl("http://videarn.com/player.swf");

    ((RTMPDownload) dl).startDownload();
  }
Ejemplo n.º 6
0
 private void rtmpDownload(DownloadLink downloadLink, String dllink) throws Exception {
   dl = new RTMPDownload(this, downloadLink, dllink);
   setupRTMPConnection(dllink, dl, downloadLink);
   ((RTMPDownload) dl).startDownload();
 }