Fix Cloudscraper
ritornati alla vecchia versione di js2py modificata versione 1.1.24 di cloudscrape
This commit is contained in:
@@ -20,10 +20,9 @@ class captchaSolver(reCaptcha):
|
||||
self.host = 'http://api.dbcapi.me/api'
|
||||
self.session = requests.Session()
|
||||
|
||||
# ------------------------------------------------------------------------------- #
|
||||
##########################################################################################################################################################
|
||||
|
||||
@staticmethod
|
||||
def checkErrorStatus(response):
|
||||
def checkErrorStatus(self, response):
|
||||
errors = dict(
|
||||
[
|
||||
(400, "DeathByCaptcha: 400 Bad Request"),
|
||||
@@ -36,7 +35,7 @@ class captchaSolver(reCaptcha):
|
||||
if response.status_code in errors:
|
||||
raise RuntimeError(errors.get(response.status_code))
|
||||
|
||||
# ------------------------------------------------------------------------------- #
|
||||
##########################################################################################################################################################
|
||||
|
||||
def login(self, username, password):
|
||||
self.username = username
|
||||
@@ -72,7 +71,7 @@ class captchaSolver(reCaptcha):
|
||||
|
||||
self.debugRequest(response)
|
||||
|
||||
# ------------------------------------------------------------------------------- #
|
||||
##########################################################################################################################################################
|
||||
|
||||
def reportJob(self, jobID):
|
||||
if not jobID:
|
||||
@@ -105,7 +104,7 @@ class captchaSolver(reCaptcha):
|
||||
else:
|
||||
raise RuntimeError("DeathByCaptcha: Error report failed reCaptcha.")
|
||||
|
||||
# ------------------------------------------------------------------------------- #
|
||||
##########################################################################################################################################################
|
||||
|
||||
def requestJob(self, jobID):
|
||||
if not jobID:
|
||||
@@ -134,7 +133,7 @@ class captchaSolver(reCaptcha):
|
||||
else:
|
||||
raise RuntimeError("DeathByCaptcha: Error failed to solve reCaptcha.")
|
||||
|
||||
# ------------------------------------------------------------------------------- #
|
||||
##########################################################################################################################################################
|
||||
|
||||
def requestSolve(self, site_url, site_key):
|
||||
def _checkRequest(response):
|
||||
@@ -170,7 +169,7 @@ class captchaSolver(reCaptcha):
|
||||
else:
|
||||
raise RuntimeError('DeathByCaptcha: Error no job id was returned.')
|
||||
|
||||
# ------------------------------------------------------------------------------- #
|
||||
##########################################################################################################################################################
|
||||
|
||||
def getCaptchaAnswer(self, site_url, site_key, reCaptchaParams):
|
||||
jobID = None
|
||||
@@ -196,6 +195,4 @@ class captchaSolver(reCaptcha):
|
||||
raise RuntimeError("DeathByCaptcha: reCaptcha solve took to long to execute, aborting.")
|
||||
|
||||
|
||||
# ------------------------------------------------------------------------------- #
|
||||
|
||||
captchaSolver()
|
||||
|
||||
Reference in New Issue
Block a user