diff --git a/modules/anticaptcha/browser.py b/modules/anticaptcha/browser.py index d7ad327ff1c938cee7d20d2148e452e3649411dc..bf76baafb1a9da91696a1ae4d265a793d79f4d60 100644 --- a/modules/anticaptcha/browser.py +++ b/modules/anticaptcha/browser.py @@ -24,7 +24,7 @@ from weboob.browser.browsers import APIBrowser from weboob.exceptions import BrowserIncorrectPassword, BrowserBanned from weboob.capabilities.captcha import ( - ImageCaptchaJob, RecaptchaJob, RecaptchaV3Job, NocaptchaJob, FuncaptchaJob, HcaptchaJob, + ImageCaptchaJob, RecaptchaJob, RecaptchaV3Job, RecaptchaV2Job, FuncaptchaJob, HcaptchaJob, CaptchaError, InsufficientFunds, UnsolvableCaptcha, InvalidCaptcha, ) @@ -150,7 +150,7 @@ def poll(self, job): elif isinstance(job, RecaptchaJob): job.solution = sol['recaptchaResponse'] job.solution_challenge = sol['recaptchaChallenge'] - elif isinstance(job, (NocaptchaJob, RecaptchaV3Job, HcaptchaJob)): + elif isinstance(job, (RecaptchaV2Job, RecaptchaV3Job, HcaptchaJob)): job.solution = sol['gRecaptchaResponse'] elif isinstance(job, FuncaptchaJob): job.solution = sol['token'] diff --git a/modules/anticaptcha/module.py b/modules/anticaptcha/module.py index 7ab963b5576aeb317c7fe953d53ee393fb7da8eb..d8f7015f4042650c3dee13519b4dad4bb479f896 100644 --- a/modules/anticaptcha/module.py +++ b/modules/anticaptcha/module.py @@ -22,7 +22,7 @@ from weboob.tools.backend import Module, BackendConfig from weboob.capabilities.captcha import ( - CapCaptchaSolver, ImageCaptchaJob, RecaptchaJob, RecaptchaV3Job, NocaptchaJob, FuncaptchaJob, + CapCaptchaSolver, ImageCaptchaJob, RecaptchaJob, RecaptchaV3Job, RecaptchaV2Job, FuncaptchaJob, HcaptchaJob, ) from weboob.tools.value import ValueBackendPassword @@ -58,7 +58,7 @@ def create_job(self, job): job.id = self.browser.post_recaptcha(job.site_url, job.site_key) elif isinstance(job, RecaptchaV3Job): job.id = self.browser.post_gcaptchav3(job.site_url, job.site_key, job.action) - elif isinstance(job, NocaptchaJob): + elif isinstance(job, RecaptchaV2Job): job.id = self.browser.post_nocaptcha(job.site_url, job.site_key) elif isinstance(job, FuncaptchaJob): job.id = self.browser.post_funcaptcha(job.site_url, job.site_key, job.sub_domain) @@ -73,7 +73,7 @@ def poll_job(self, job): def report_wrong_solution(self, job): if isinstance(job, ImageCaptchaJob): self.browser.report_wrong_image(job) - if isinstance(job, (NocaptchaJob, RecaptchaJob, RecaptchaV3Job)): + if isinstance(job, (RecaptchaV2Job, RecaptchaJob, RecaptchaV3Job)): self.browser.report_wrong_recaptcha(job) def get_balance(self): diff --git a/modules/carrefourbanque/browser.py b/modules/carrefourbanque/browser.py index c2531a45ba32bbee0677bb84379d244fcefb0f68..b5be98d7c82b64a44af22ef5b0957ab4ed7b2044 100644 --- a/modules/carrefourbanque/browser.py +++ b/modules/carrefourbanque/browser.py @@ -22,7 +22,7 @@ from time import sleep from weboob.browser import LoginBrowser, URL, need_login, StatesMixin -from weboob.exceptions import BrowserIncorrectPassword, NocaptchaQuestion, BrowserUnavailable +from weboob.exceptions import BrowserIncorrectPassword, RecaptchaV2Question, BrowserUnavailable from weboob.capabilities.bank import Account from weboob.tools.compat import basestring @@ -102,7 +102,7 @@ def do_login(self): # cookie session is not available website_key = self.page.get_recaptcha_site_key() website_url = self.login.build() - raise NocaptchaQuestion(website_key=website_key, website_url=website_url) + raise RecaptchaV2Question(website_key=website_key, website_url=website_url) else: # we got javascript page again, this shouldn't happen assert False, "obfuscated javascript not managed" diff --git a/modules/cityscoot/browser.py b/modules/cityscoot/browser.py index dff38a4a00b094b284d16e20985232a6f7d30f7e..1537c0d0389937e76f1defb50f397ad80ebe085c 100644 --- a/modules/cityscoot/browser.py +++ b/modules/cityscoot/browser.py @@ -21,7 +21,7 @@ from weboob.browser import LoginBrowser, URL, need_login -from weboob.exceptions import BrowserIncorrectPassword, NocaptchaQuestion +from weboob.exceptions import BrowserIncorrectPassword, RecaptchaV2Question from .pages import LoginPage, SubscriptionsPage, DocumentsPage, OtpPage @@ -47,7 +47,7 @@ def do_login(self): self.login.go() if self.page.has_captcha() and self.config['captcha_response'].get() is None: website_key = self.page.get_captcha_key() - raise NocaptchaQuestion(website_key=website_key, website_url=self.url) + raise RecaptchaV2Question(website_key=website_key, website_url=self.url) else: self.page.login(self.username, self.password, self.config['captcha_response'].get()) diff --git a/modules/deathbycaptcha/browser.py b/modules/deathbycaptcha/browser.py index 65d6b62e705972e978604f3c625b07aee00deb35..1a584b14466e02f1e17dac20227a08b671151303 100644 --- a/modules/deathbycaptcha/browser.py +++ b/modules/deathbycaptcha/browser.py @@ -64,7 +64,7 @@ def create_job(self, data): return reply['captcha'] - def create_nocaptcha_job(self, url, key): + def create_recaptcha2_job(self, url, key): token_params = { 'googlekey': key, diff --git a/modules/deathbycaptcha/module.py b/modules/deathbycaptcha/module.py index 6b3e6cd237582378af9d1fa812e43c141c9b3e61..9b3d967843ca6d23f0758d7bb39d621d4f81e4c4 100644 --- a/modules/deathbycaptcha/module.py +++ b/modules/deathbycaptcha/module.py @@ -21,7 +21,7 @@ from weboob.tools.backend import Module, BackendConfig from weboob.tools.value import ValueBackendPassword, Value -from weboob.capabilities.captcha import CapCaptchaSolver, ImageCaptchaJob, NocaptchaJob +from weboob.capabilities.captcha import CapCaptchaSolver, ImageCaptchaJob, RecaptchaV2Job from .browser import DeathbycaptchaBrowser @@ -50,8 +50,8 @@ def create_default_browser(self): def create_job(self, job): if isinstance(job, ImageCaptchaJob): job.id = self.browser.create_job(job.image) - elif isinstance(job, NocaptchaJob): # or RecaptchaV2 - job.id = self.browser.create_nocaptcha_job(job.site_url, job.site_key) + elif isinstance(job, RecaptchaV2Job): + job.id = self.browser.create_recaptcha2_job(job.site_url, job.site_key) else: raise NotImplementedError() diff --git a/modules/ldlc/browser.py b/modules/ldlc/browser.py index a6e0b74b47a4bd30875c901c4608379e06af9aed..8ce8718beceaf39983d42c6731e731955db83fa7 100644 --- a/modules/ldlc/browser.py +++ b/modules/ldlc/browser.py @@ -18,7 +18,7 @@ # along with this weboob module. If not, see . from weboob.browser import LoginBrowser, AbstractBrowser, URL, need_login -from weboob.exceptions import BrowserIncorrectPassword, NocaptchaQuestion +from weboob.exceptions import BrowserIncorrectPassword, RecaptchaV2Question from .pages import HomePage, LoginPage, ProBillsPage, DocumentsPage @@ -56,7 +56,7 @@ def do_login(self): self.login.stay_or_go() sitekey = self.page.get_recaptcha_sitekey() if sitekey and not self.config['captcha_response'].get(): - raise NocaptchaQuestion(website_key=sitekey, website_url=self.login.build()) + raise RecaptchaV2Question(website_key=sitekey, website_url=self.login.build()) self.page.login(self.username, self.password, self.config['captcha_response'].get()) diff --git a/modules/materielnet/browser.py b/modules/materielnet/browser.py index 9c6cd37dc394dda1416c9b84e3d82f4904a63c5d..a19dbbee1ab30e84ce25de6238a833e725af68e9 100644 --- a/modules/materielnet/browser.py +++ b/modules/materielnet/browser.py @@ -21,7 +21,7 @@ from weboob.browser import LoginBrowser, URL, need_login -from weboob.exceptions import BrowserIncorrectPassword, NocaptchaQuestion +from weboob.exceptions import BrowserIncorrectPassword, RecaptchaV2Question from .pages import LoginPage, CaptchaPage, ProfilePage, DocumentsPage, DocumentsDetailsPage @@ -64,7 +64,7 @@ def do_login(self): # captcha is not always present if sitekey: if not self.config['captcha_response'].get(): - raise NocaptchaQuestion(website_key=sitekey, website_url=self.login.build(lang=self.lang)) + raise RecaptchaV2Question(website_key=sitekey, website_url=self.login.build(lang=self.lang)) self.page.login(self.username, self.password, self.config['captcha_response'].get()) diff --git a/modules/myedenred/browser.py b/modules/myedenred/browser.py index 8ef55919c221866f8dd727a98682d4c0fd42697c..feca0799323e785b91864763ed832097db9953e9 100644 --- a/modules/myedenred/browser.py +++ b/modules/myedenred/browser.py @@ -24,7 +24,7 @@ from functools import wraps from weboob.browser import URL, OAuth2PKCEMixin, PagesBrowser -from weboob.exceptions import BrowserIncorrectPassword, NocaptchaQuestion, WrongCaptchaResponse, ActionNeeded +from weboob.exceptions import BrowserIncorrectPassword, RecaptchaV2Question, WrongCaptchaResponse, ActionNeeded from weboob.browser.exceptions import ServerError, ClientError, BrowserUnavailable from weboob.tools.decorators import retry @@ -117,7 +117,7 @@ def request_authorization(self): website_key = self.page.get_recaptcha_site_key() if not self.config['captcha_response'].get() and website_key: - raise NocaptchaQuestion(website_key=website_key, website_url=self.url) + raise RecaptchaV2Question(website_key=website_key, website_url=self.url) form = self.page.get_login_form() form['Username'] = self.username diff --git a/modules/swile/browser.py b/modules/swile/browser.py index 86e67ed569f46d313287bc4fbcd0a01a77dd4d1a..efff7d4f6b9aba877be645caf8490883ea75acbd 100644 --- a/modules/swile/browser.py +++ b/modules/swile/browser.py @@ -31,7 +31,7 @@ from weboob.capabilities.base import empty from weboob.browser.filters.json import Dict from weboob.browser.exceptions import ClientError, BrowserTooManyRequests -from weboob.exceptions import BrowserIncorrectPassword, NocaptchaQuestion +from weboob.exceptions import BrowserIncorrectPassword, RecaptchaV2Question from weboob.browser.browsers import APIBrowser, OAuth2Mixin from weboob.capabilities.bank import Account, Transaction @@ -72,7 +72,7 @@ def request_authorization(self): # if the captcha's response is not completed the error is # 426 Client Error: Upgrade Required if e.response.status_code == 426 and not self.config['captcha_response'].get(): - raise NocaptchaQuestion(website_url='https://app.swile.co/signin', website_key='6LceI-EUAAAAACrBsmKCmllNdk1-H5U7G7NOTzmj') + raise RecaptchaV2Question(website_url='https://app.swile.co/signin', website_key='6LceI-EUAAAAACrBsmKCmllNdk1-H5U7G7NOTzmj') if e.response.status_code == 400: json = e.response.json() message = json['error_description']