コード例 #1
0
  public void loginUGotFile() throws Exception {

    loginsuccessful = false;
    HttpParams params = new BasicHttpParams();
    params.setParameter(
        "http.useragent",
        "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.2) Gecko/20100115 Firefox/3.6");
    DefaultHttpClient httpclient = new DefaultHttpClient(params);

    NULogger.getLogger().info("Trying to log in to ugotfile.com");
    HttpPost httppost = new HttpPost("http://ugotfile.com/user/login");
    httppost.setHeader("Cookie", phpsessioncookie);
    List<NameValuePair> formparams = new ArrayList<NameValuePair>();
    formparams.add(new BasicNameValuePair("ugfLoginUserName", getUsername()));
    formparams.add(new BasicNameValuePair("ugfLoginPassword", getPassword()));
    UrlEncodedFormEntity entity = new UrlEncodedFormEntity(formparams, "UTF-8");
    httppost.setEntity(entity);
    HttpResponse httpresponse = httpclient.execute(httppost);
    if (httpresponse.getStatusLine().toString().contains("302")) {
      tmp = httpresponse.getLastHeader("Location").getValue();
      NULogger.getLogger().info("UGotFile Login success");
      loginsuccessful = true;
      username = getUsername();
      password = getPassword();
    } else {
      NULogger.getLogger().info("UGotFile login failed");
      loginsuccessful = false;
      username = "";
      password = "";
      showWarningMessage(Translation.T().loginerror(), HOSTNAME);
      accountUIShow().setVisible(true);
    }
  }
コード例 #2
0
  /** @return the locale specific text for a particular Enum value */
  public String getLocaleSpecificString() {

    try {
      return Translation.T(/*UploadStatus.class.getName()+"."+*/ this.toString());
    } catch (Exception a) {
      NULogger.getLogger().log(Level.SEVERE, "{0}: {1}", new Object[] {getClass().getName(), a});
      return "Error";
    }
  }
コード例 #3
0
  @Override
  public void login() {
    loginsuccessful = false;
    try {
      initialize();

      NULogger.getLogger().info("Trying to log in to FileHoot.com");
      httpPost = new NUHttpPost("http://filehoot.com/");

      List<NameValuePair> formparams = new ArrayList<NameValuePair>();
      formparams.add(new BasicNameValuePair("op", "login"));
      formparams.add(new BasicNameValuePair("redirect", ""));
      formparams.add(new BasicNameValuePair("login", getUsername()));
      formparams.add(new BasicNameValuePair("password", getPassword()));

      UrlEncodedFormEntity entity = new UrlEncodedFormEntity(formparams, "UTF-8");
      httpPost.setEntity(entity);
      httpResponse = httpclient.execute(httpPost, httpContext);
      NULogger.getLogger().info(httpResponse.getStatusLine().toString());
      Header lastHeader = httpResponse.getLastHeader("Location");

      if (httpResponse != null && httpResponse.toString().contains("xfss=")) {
        EntityUtils.consume(httpResponse.getEntity());
        loginsuccessful = true;
        username = getUsername();
        password = getPassword();
        NULogger.getLogger().info("FileHoot.com login successful!");

      } else {
        // Get error message
        responseString = EntityUtils.toString(httpResponse.getEntity());
        // FileUtils.saveInFile("FileHootAccount.html", responseString);
        Document doc = Jsoup.parse(responseString);
        String error = doc.select("div.alert-danger").first().text();

        if ("Incorrect Login or Password".equals(error)) {
          throw new NUInvalidLoginException(getUsername(), HOSTNAME);
        }

        // Generic exception
        throw new Exception("Login error: " + "Login Failed");
      }
    } catch (NUException ex) {
      resetLogin();
      ex.printError();
      accountUIShow().setVisible(true);
    } catch (Exception e) {
      resetLogin();
      NULogger.getLogger().log(Level.SEVERE, "{0}: {1}", new Object[] {getClass().getName(), e});
      showWarningMessage(Translation.T().loginerror(), HOSTNAME);
      accountUIShow().setVisible(true);
    }
  }
コード例 #4
0
  @Override
  public void login() {
    loginsuccessful = false;
    try {
      initialize();

      NULogger.getLogger().info("Trying to log in to OpenLoad.co");
      httpPost = new NUHttpPost("https://openload.co/login");

      List<NameValuePair> formparams = new ArrayList<NameValuePair>();
      formparams.add(new BasicNameValuePair("_csrf", csrfToken));
      formparams.add(new BasicNameValuePair("LoginForm[rememberMe]", "1"));
      formparams.add(new BasicNameValuePair("LoginForm[email]", getUsername()));
      formparams.add(new BasicNameValuePair("LoginForm[password]", getPassword()));

      UrlEncodedFormEntity entity = new UrlEncodedFormEntity(formparams, "UTF-8");
      httpPost.setEntity(entity);
      httpResponse = httpclient.execute(httpPost, httpContext);
      NULogger.getLogger().info(httpResponse.getStatusLine().toString());

      responseString = NUHttpClientUtils.getData("https://openload.co/upload", httpContext);

      if (responseString.contains("logout")) {
        EntityUtils.consume(httpResponse.getEntity());
        loginsuccessful = true;
        username = getUsername();
        password = getPassword();
        NULogger.getLogger().info("OpenLoad.co login successful!");

      } else {
        // Get error message
        responseString = EntityUtils.toString(httpResponse.getEntity());
        Document doc = Jsoup.parse(responseString);
        String error = doc.select(".err").first().text();

        if ("Incorrect Login or Password".equals(error)) {
          throw new NUInvalidLoginException(getUsername(), HOSTNAME);
        }

        // Generic exception
        throw new Exception("Login error: " + error);
      }
    } catch (NUException ex) {
      resetLogin();
      ex.printError();
      accountUIShow().setVisible(true);
    } catch (Exception e) {
      resetLogin();
      NULogger.getLogger().log(Level.SEVERE, "{0}: {1}", new Object[] {getClass().getName(), e});
      showWarningMessage(Translation.T().loginerror(), HOSTNAME);
      accountUIShow().setVisible(true);
    }
  }
コード例 #5
0
  @Override
  public void login() {
    loginsuccessful = false;
    try {
      initialize();

      NULogger.getLogger().info("Trying to log in to TopUpload1.com");
      httpPost = new NUHttpPost("http://topupload1.com/ajax/_account_login.ajax.php");

      List<NameValuePair> formparams = new ArrayList<NameValuePair>();
      formparams.add(new BasicNameValuePair("username", getUsername()));
      formparams.add(new BasicNameValuePair("password", getPassword()));

      UrlEncodedFormEntity entity = new UrlEncodedFormEntity(formparams, "UTF-8");
      httpPost.setEntity(entity);
      httpResponse = httpclient.execute(httpPost, httpContext);
      NULogger.getLogger().info(httpResponse.getStatusLine().toString());
      responseString = EntityUtils.toString(httpResponse.getEntity());

      if (StringUtils.stringBetweenTwoStrings(responseString, "\"login_status\":\"", "\"")
          .equals("success")) {
        EntityUtils.consume(httpResponse.getEntity());
        loginsuccessful = true;
        username = getUsername();
        password = getPassword();
        NULogger.getLogger().info("TopUpload1.com login successful!");

      } else {
        // Get error message
        responseString = EntityUtils.toString(httpResponse.getEntity());
        // FileUtils.saveInFile("TopUploadOneAccount.html", responseString);
        Document doc = Jsoup.parse(responseString);
        String error = doc.select(".err").first().text();

        if ("Incorrect Login or Password".equals(error)) {
          throw new NUInvalidLoginException(getUsername(), HOSTNAME);
        }

        // Generic exception
        throw new Exception("Login error: " + error);
      }
    } catch (NUException ex) {
      resetLogin();
      ex.printError();
      accountUIShow().setVisible(true);
    } catch (Exception e) {
      resetLogin();
      NULogger.getLogger().log(Level.SEVERE, "{0}: {1}", new Object[] {getClass().getName(), e});
      showWarningMessage(Translation.T().loginerror(), HOSTNAME);
      accountUIShow().setVisible(true);
    }
  }
コード例 #6
0
  /** Update the columns when the language is changed.. */
  static final void languageChanged_UpdateColumnNames() {
    NULogger.getLogger().log(Level.INFO, "{0}Updating column names", NUTableModel.class.getName());

    columnNames[0] = Translation.T().File();
    columnNames[1] = Translation.T().Size();
    columnNames[2] = Translation.T().Host();
    columnNames[3] = Translation.T().Status();
    columnNames[4] = Translation.T().Speed();
    columnNames[5] = Translation.T().Progress();
    columnNames[6] = Translation.T().Download_URL();
    columnNames[7] = Translation.T().Delete_URL();

    // Must call this to reflect change on runtime..
    INSTANCE.fireTableStructureChanged();
    //
  }
コード例 #7
0
  @Override
  public void login() {
    loginsuccessful = false;
    try {
      initialize();

      NULogger.getLogger().info("Trying to log in to Ex-Load.com");
      httpPost = new NUHttpPost("http://ex-load.com/");
      httpPost.setHeader("Referer", "http://ex-load.com/login.html");
      httpPost.setHeader("Host", "ex-load.com");
      httpPost.setHeader(
          "User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:35.0) Gecko/20100101 Firefox/35.0");
      httpPost.setHeader("DNT", "1");

      List<NameValuePair> formparams = new ArrayList<NameValuePair>();
      formparams.add(new BasicNameValuePair("code", captcha));
      formparams.add(new BasicNameValuePair("op", "login"));
      formparams.add(new BasicNameValuePair("login", getUsername()));
      formparams.add(new BasicNameValuePair("password", getPassword()));
      formparams.add(new BasicNameValuePair("rand", rand));
      formparams.add(new BasicNameValuePair("redirect", "http://ex-load.com/"));

      UrlEncodedFormEntity entity = new UrlEncodedFormEntity(formparams, "UTF-8");
      httpPost.setEntity(entity);
      httpResponse = httpclient.execute(httpPost, httpContext);
      NULogger.getLogger().info(httpResponse.getStatusLine().toString());

      responseString = EntityUtils.toString(httpResponse.getEntity());
      if (responseString.contains("Wrong captcha code")) {
        NULogger.getLogger().info("** Ex-Load.com ** => Server reports the captcha as incorrect");
        throw new Exception("Server reports incorrect captcha");
      }

      if (!CookieUtils.getCookieValue(httpContext, "xfss").isEmpty()
          && !CookieUtils.getCookieValue(httpContext, "login").isEmpty()) {
        EntityUtils.consume(httpResponse.getEntity());
        loginsuccessful = true;
        username = getUsername();
        password = getPassword();
        hostsAccountUI().hostUI(HOSTNAME).setEnabled(true);
        NULogger.getLogger().info("Ex-Load.com login successful!");

      } else {
        // Get error message
        responseString = EntityUtils.toString(httpResponse.getEntity());
        // FileUtils.saveInFile("ExLoadAccount.html", responseString);
        Document doc = Jsoup.parse(responseString);
        String error = doc.select(".err").first().text();

        if ("Incorrect Login or Password".equals(error)) {
          throw new NUInvalidLoginException(getUsername(), HOSTNAME);
        }

        // Generic exception
        throw new Exception("Login error: " + error);
      }
    } catch (NUException ex) {
      resetLogin();
      ex.printError();
      accountUIShow().setVisible(true);
    } catch (Exception e) {
      resetLogin();
      NULogger.getLogger().log(Level.SEVERE, "{0}: {1}", new Object[] {getClass().getName(), e});
      showWarningMessage(Translation.T().loginerror(), HOSTNAME);
      accountUIShow().setVisible(true);
    }
  }