use of ar.rulosoft.navegadores.VolatileCookieJar in project MiMangaNu by raulhaag.
the class BatoTo method testLogin.
// just log in batoto to store the cookie if all ok
@Override
public boolean testLogin(String user, String password) throws Exception {
Navigator nav = getNavigatorAndFlushParameters();
CookieJar ccj = nav.getHttpClient().cookieJar();
VolatileCookieJar cj = new VolatileCookieJar();
nav.setCookieJar(cj);
String data = nav.get(HOST + "/forums/index.php?app=core&module=global&section=login");
HashMap<String, String> params = Navigator.getFormParamsFromSource(data);
nav = getNavigatorAndFlushParameters();
nav.addPost("auth_key", params.get("auth_key"));
nav.addPost("ips_password", password);
nav.addPost("ips_username", user);
nav.addPost("referer", "https://bato.to/forums/");
nav.addPost("rememberMe", "1");
nav.post(HOST + "/forums/index.php?app=core&module=global§ion=login&do=process");
List<Cookie> cookies = Navigator.getCookieJar().loadForRequest(HttpUrl.parse("https://bato.to"));
nav.setCookieJar(ccj);
return cj.contain("member_id");
}
Aggregations