diff --git a/weboob/capabilities/captcha.py b/weboob/capabilities/captcha.py
index ecc6f9160c5783ee79d1efc2065d473c7b755fe4..6db4b1cf28085ae3016d3c625312af8e72fc51c4 100644
--- a/weboob/capabilities/captcha.py
+++ b/weboob/capabilities/captcha.py
@@ -18,17 +18,19 @@
# along with weboob. If not, see .
from time import sleep
+import warnings
from .base import Capability, BaseObject, StringField, UserError, BytesField
from ..exceptions import (
- RecaptchaQuestion, RecaptchaV3Question, NocaptchaQuestion, FuncaptchaQuestion,
+ RecaptchaQuestion, RecaptchaV3Question, RecaptchaV2Question, FuncaptchaQuestion,
ImageCaptchaQuestion, HcaptchaQuestion,
)
__all__ = [
'CapCaptchaSolver',
- 'SolverJob', 'RecaptchaJob', 'NocaptchaJob', 'ImageCaptchaJob', 'HcaptchaJob',
+ 'SolverJob', 'RecaptchaJob', 'RecaptchaV2Job', 'RecaptchaV3Job',
+ 'ImageCaptchaJob', 'HcaptchaJob',
'CaptchaError', 'UnsolvableCaptcha', 'InvalidCaptcha', 'InsufficientFunds',
'exception_to_job',
]
@@ -51,11 +53,17 @@ class RecaptchaV3Job(SolverJob):
action = StringField('Website owner defines what user is doing on the page through this parameter.')
-class NocaptchaJob(SolverJob):
+class RecaptchaV2Job(SolverJob):
site_url = StringField('Site URL for NoCaptcha service')
site_key = StringField('Site key for NoCaptcha service')
+class NocaptchaJob(RecaptchaV2Job):
+ def __init__(self, *args, **kwargs):
+ warnings.warn('use RecaptchaV2Job class instead', DeprecationWarning)
+ super(NocaptchaJob, self).__init__(*args, **kwargs)
+
+
class FuncaptchaJob(SolverJob):
site_url = StringField('Site URL for FunCaptcha service')
site_key = StringField('Site key for FunCaptcha service')
@@ -97,8 +105,8 @@ def exception_to_job(exc):
job.site_url = exc.website_url
job.site_key = exc.website_key
job.action = exc.action
- elif isinstance(exc, NocaptchaQuestion):
- job = NocaptchaJob()
+ elif isinstance(exc, RecaptchaV2Question):
+ job = RecaptchaV2Job()
job.site_url = exc.website_url
job.site_key = exc.website_key
elif isinstance(exc, FuncaptchaQuestion):
diff --git a/weboob/exceptions.py b/weboob/exceptions.py
index 731c87f498380626d2ead653ca262a940f2f26f5..d41c9f22fb9e0cc8ffdfde2649b8f46167a00531 100644
--- a/weboob/exceptions.py
+++ b/weboob/exceptions.py
@@ -17,6 +17,7 @@
# You should have received a copy of the GNU Lesser General Public License
# along with weboob. If not, see .
+import warnings
from weboob.tools.misc import to_unicode
from weboob.tools.compat import StrConv
@@ -127,14 +128,20 @@ def __init__(self, image_data):
super(ImageCaptchaQuestion, self).__init__(self.type, image_data=image_data)
-class NocaptchaQuestion(CaptchaQuestion):
+class RecaptchaV2Question(CaptchaQuestion):
type = 'g_recaptcha'
website_key = None
website_url = None
def __init__(self, website_key, website_url):
- super(NocaptchaQuestion, self).__init__(self.type, website_key=website_key, website_url=website_url)
+ super(RecaptchaV2Question, self).__init__(self.type, website_key=website_key, website_url=website_url)
+
+
+class NocaptchaQuestion(RecaptchaV2Question):
+ def __init__(self, *args, **kwargs):
+ warnings.warn('use RecaptchaV2Question class instead', DeprecationWarning)
+ super(NocaptchaQuestion, self).__init__(*args, **kwargs)
class RecaptchaQuestion(CaptchaQuestion):