java - How to bypass cloudflare ddos or redirect after 5 seconds using JSOUP? -


i'm trying anime-list in site, https://ww1.gogoanime.io

this code,

org.jsoup.connection.response usage = jsoup.connect("https://ww1.gogoanime.io/anime-list-a")             .header("accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8")             .header("accept-encoding", "gzip, deflate, sdch, br")             .header("accept-language", "en-us,en;q=0.8")             .header("cache-control", "max-age=0")             .header("user-agent", "mozilla/5.0 (windows nt 6.1; win64; x64) applewebkit/537.36 (khtml, gecko) chrome/57.0.2987.133 safari/537.36")             .header("upgrade-insecure-requests", "1")             .ignorehttperrors(true)             .followredirects(true)             .method(connection.method.get)             .timeout(30000)             .execute();  system.out.println(usage.parse()); 

this code works other websites, site result cloudflare ddos protection have added headers, chrome can access url without problem.

btw, if didn't set,

ignorehttperrors(true) 

to true, throw exception 503. no matter won't go away until change true. i'm stuck @ ddos protection page, says redirect website in 5 seconds.

i tried below code too,

org.jsoup.connection.response usage = jsoup.connect("https://ww1.gogoanime.io/anime-list-a")         .header("accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8")         .header("accept-encoding", "gzip, deflate, sdch, br")         .header("accept-language", "en-us,en;q=0.8")         .header("cache-control", "max-age=0")         .header("user-agent", "mozilla/5.0 (windows nt 6.1; win64; x64) applewebkit/537.36 (khtml, gecko) chrome/57.0.2987.133 safari/537.36")         .header("upgrade-insecure-requests", "1")         .ignorehttperrors(true)         .followredirects(true)         .method(connection.method.get)         .timeout(30000)         .execute();  thread.sleep(5000);  org.jsoup.connection.response usg = jsoup.connect("https://ww1.gogoanime.io/anime-list-a")             .header("accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8")             .header("accept-encoding", "gzip, deflate, sdch, br")             .header("accept-language", "en-us,en;q=0.8")             .header("cache-control", "max-age=0")             .header("user-agent", "mozilla/5.0 (windows nt 6.1; win64; x64) applewebkit/537.36 (khtml, gecko) chrome/57.0.2987.133 safari/537.36")             .header("upgrade-insecure-requests", "1")             .ignorehttperrors(true)             .followredirects(true)             .cookies(usage.cookies())             .method(connection.method.get)             .timeout(30000)             .execute(); 

this didn't work either. browser access url without problem. think it's related jsoup?

btw, thought certificates, used too.but didn't work too.

trustmanager[] trustallcerts = new trustmanager[] { new x509trustmanager() {         public java.security.cert.x509certificate[] getacceptedissuers() {             return null;         }          public void checkclienttrusted(java.security.cert.x509certificate[] certs, string authtype) {         }          public void checkservertrusted(java.security.cert.x509certificate[] certs, string authtype) {         }     } };      // install all-trusting trust manager     try {         sslcontext sc = sslcontext.getinstance("ssl");         sc.init(null, trustallcerts, new java.security.securerandom());         httpsurlconnection.setdefaultsslsocketfactory(sc.getsocketfactory());     } catch (exception e) {         throw new runtimeexception(e);     } 


Comments

Post a Comment

Popular posts from this blog

cookies - Yii2 Advanced - Share session between frontend and mainsite (duplicate of frontend for www) -

angular - password and confirm password field validation angular2 reactive forms -

javascript - Angular2 intelliJ config error.. Cannot find module '@angular/core' -