Package xyz.hexile.cloudflarescraper
Class CloudflareScraper
- java.lang.Object
-
- xyz.hexile.cloudflarescraper.CloudflareScraper
-
public class CloudflareScraper extends java.lang.ObjectCore class of CloudflareScraper
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classCloudflareScraper.ScraperException
-
Constructor Summary
Constructors Constructor Description CloudflareScraper(java.net.URI uri)CloudflareScraper(java.net.URI uri, int challengeDelay)CloudflareScraper(java.net.URI uri, int challengeDelay, int connectionTimeout)CloudflareScraper(java.net.URI uri, int challengeDelay, int connectionTimeout, int readTimeout)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.net.HttpURLConnectionbuildRequest(java.net.URI url)voidconnect()java.lang.StringextractChallenge(java.lang.String content)java.lang.StringextractChallengePass(java.lang.String content)java.lang.StringextractChallengeVc(java.lang.String content)java.lang.StringextractRayId(java.lang.String content)java.lang.StringgetAnswer()java.lang.StringgetChallenge()java.lang.StringgetChallengeAnswer()java.lang.StringgetChallengePass()java.lang.StringgetChallengeVc()intgetConnectionTimeout()java.lang.StringgetContent()java.lang.StringgetContent(java.io.InputStream inputStream)java.lang.StringgetCookie()java.util.List<java.lang.String>getCookies()java.lang.StringgetDomainName(java.net.URI uri)java.lang.StringgetRayId()intgetReadTimeout()intgetResponseCode()java.net.URIgetUri()booleanisCloudflareProtected()
-
-
-
Constructor Detail
-
CloudflareScraper
public CloudflareScraper(java.net.URI uri)
-
CloudflareScraper
public CloudflareScraper(java.net.URI uri, int challengeDelay)
-
CloudflareScraper
public CloudflareScraper(java.net.URI uri, int challengeDelay, int connectionTimeout)
-
CloudflareScraper
public CloudflareScraper(java.net.URI uri, int challengeDelay, int connectionTimeout, int readTimeout)
-
-
Method Detail
-
connect
public void connect() throws java.io.IOException, CloudflareScraper.ScraperException, java.net.URISyntaxException, javax.script.ScriptException- Throws:
java.io.IOExceptionCloudflareScraper.ScraperExceptionjava.net.URISyntaxExceptionjavax.script.ScriptException
-
getAnswer
public java.lang.String getAnswer() throws javax.script.ScriptException- Throws:
javax.script.ScriptException
-
getCookie
public java.lang.String getCookie() throws java.io.IOException, java.net.URISyntaxException, java.lang.InterruptedException- Throws:
java.io.IOExceptionjava.net.URISyntaxExceptionjava.lang.InterruptedException
-
getCookies
public java.util.List<java.lang.String> getCookies() throws java.lang.InterruptedException, java.io.IOException, java.net.URISyntaxException- Throws:
java.lang.InterruptedExceptionjava.io.IOExceptionjava.net.URISyntaxException
-
buildRequest
public java.net.HttpURLConnection buildRequest(java.net.URI url) throws java.io.IOException- Throws:
java.io.IOException
-
isCloudflareProtected
public boolean isCloudflareProtected()
-
getContent
public java.lang.String getContent(java.io.InputStream inputStream) throws java.io.IOException- Throws:
java.io.IOException
-
getDomainName
public java.lang.String getDomainName(java.net.URI uri)
-
extractRayId
public java.lang.String extractRayId(java.lang.String content) throws CloudflareScraper.ScraperException
-
extractChallenge
public java.lang.String extractChallenge(java.lang.String content) throws CloudflareScraper.ScraperException
-
extractChallengeVc
public java.lang.String extractChallengeVc(java.lang.String content) throws CloudflareScraper.ScraperException
-
extractChallengePass
public java.lang.String extractChallengePass(java.lang.String content) throws CloudflareScraper.ScraperException
-
getUri
public java.net.URI getUri()
-
getConnectionTimeout
public int getConnectionTimeout()
-
getReadTimeout
public int getReadTimeout()
-
getResponseCode
public int getResponseCode()
-
getContent
public java.lang.String getContent()
-
getRayId
public java.lang.String getRayId()
-
getChallenge
public java.lang.String getChallenge()
-
getChallengeVc
public java.lang.String getChallengeVc()
-
getChallengePass
public java.lang.String getChallengePass()
-
getChallengeAnswer
public java.lang.String getChallengeAnswer()
-
-