capmonster-python 2.6.1__py3-none-any.whl → 3.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,3 +8,4 @@ from .geetest import GeeTestTask
8
8
  from .utils import CapmonsterException
9
9
  from .compleximage import ComplexImageTask
10
10
  from .datadome import DataDomeTask
11
+ from .turnstile import TurnstileTask
@@ -73,7 +73,9 @@ class Capmonster:
73
73
  :return: True if the captcha is successfully reported, False otherwise.
74
74
  :raises CapmonsterException: If the captcha type is invalid.
75
75
  """
76
- if captcha_type != "image" or "token":
76
+ valid_captcha_types = ["image", "token"]
77
+
78
+ if captcha_type not in valid_captcha_types:
77
79
  raise CapmonsterException(
78
80
  1, "ERROR_INCORRECT_CAPTCHA_TYPE", "Valid captcha_type parameters are only 'image' or 'token'.")
79
81
  try:
@@ -1,8 +1,8 @@
1
- from .capmonster import Proxy
1
+ from .capmonster import Proxy, UserAgent
2
2
  from typing import Union
3
3
 
4
4
 
5
- class TurnstileTask(Proxy):
5
+ class TurnstileTask(UserAgent, Proxy):
6
6
  def __init__(self, client_key):
7
7
  super(TurnstileTask, self).__init__(client_key)
8
8
 
@@ -16,6 +16,7 @@ class TurnstileTask(Proxy):
16
16
  "websiteKey": website_key
17
17
  }
18
18
  }
19
+ data, is_user_agent = self._add_user_agent(data)
19
20
  data, is_proxy = self._is_proxy_task(data)
20
21
  if no_cache:
21
22
  data["task"]["nocache"] = no_cache
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: capmonster_python
3
- Version: 2.6.1
3
+ Version: 3.0.0
4
4
  Summary: capmonster.cloud library for Python
5
5
  Home-page: https://github.com/alperensert/capmonster_python
6
6
  Author: Alperen Sert
@@ -1,5 +1,5 @@
1
- capmonster_python/__init__.py,sha256=uF6-lErPDl0YVcEfPFg3Lc9SV877BxFEEOPZapqdyp0,415
2
- capmonster_python/capmonster.py,sha256=zCiK-jzLbCwjAY9qb8pM86PE5W2gQXurCBrcU2uOHR4,8963
1
+ capmonster_python/__init__.py,sha256=9rQthHrlBItDfV3mh0Ex6GgWAvQyhq90PH0csKfoseY,452
2
+ capmonster_python/capmonster.py,sha256=0gJw9iLl8XQvqk1eOgv9oOZ_929VS4r7dIv2ixbF9S0,9026
3
3
  capmonster_python/compleximage.py,sha256=NjsJBR7AlNeo9-1KMxUMCL4PkJm_nL_g8JiFgIk3Xgs,2048
4
4
  capmonster_python/datadome.py,sha256=5GQbIiiHN2jYF5il3z7p7_mkac1X7ejx8jkK5-T4RbI,615
5
5
  capmonster_python/fun_captcha.py,sha256=bHXsfmrfaDCiV43EiUpr5N8U5VnY0xZFB7876AMDCnA,1207
@@ -9,10 +9,10 @@ capmonster_python/image_to_text.py,sha256=V268ZeaVfTQHpfHkq5trxMQeLxZskv4r5_3xYj
9
9
  capmonster_python/recaptcha_v2.py,sha256=6fm1Lu3vHMZioHuW475nJ5_nMElgpOKru67x_lPC12c,1035
10
10
  capmonster_python/recaptcha_v2_enterprise.py,sha256=Ms8sN4FaA9M16PNkGB5tTP0SBW9H-WQaoh157ewtYG8,1191
11
11
  capmonster_python/recaptcha_v3.py,sha256=Yuvvc03FMALSki0WqJqAXGmNVpZqmtqDmhsY7LEP0fE,866
12
- capmonster_python/turnstile.py,sha256=1mvF6Q5gndzdQhRwanNItN5YUvo_SeM-yLjnx5zMUUg,703
12
+ capmonster_python/turnstile.py,sha256=nS_wny8y5KahEa28NlCaOS8cC_WNffL2xWyZSC08pyw,782
13
13
  capmonster_python/utils.py,sha256=kcHEYw-JqDXHPI8baBdRjdV1UKVo8oOriKhqfDgXxYI,1382
14
- capmonster_python-2.6.1.dist-info/LICENSE,sha256=dsx0VlJZP5DI64ranPoTdQuDmNvrABI9QNm-PctMmM4,1055
15
- capmonster_python-2.6.1.dist-info/METADATA,sha256=0oKOjW580CndFkwAGngODWfDXmeozaUh9ITmZGpwTq0,4070
16
- capmonster_python-2.6.1.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
17
- capmonster_python-2.6.1.dist-info/top_level.txt,sha256=QW5VEUvOJfzDxYpD7fSJtGfUxhM3m7U7LFcZ-wRpU70,18
18
- capmonster_python-2.6.1.dist-info/RECORD,,
14
+ capmonster_python-3.0.0.dist-info/LICENSE,sha256=dsx0VlJZP5DI64ranPoTdQuDmNvrABI9QNm-PctMmM4,1055
15
+ capmonster_python-3.0.0.dist-info/METADATA,sha256=gx34wC2ugSmPedd8QobyPTdfuB_fBmer-iZZQyGUYJo,4070
16
+ capmonster_python-3.0.0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
17
+ capmonster_python-3.0.0.dist-info/top_level.txt,sha256=QW5VEUvOJfzDxYpD7fSJtGfUxhM3m7U7LFcZ-wRpU70,18
18
+ capmonster_python-3.0.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.42.0)
2
+ Generator: bdist_wheel (0.43.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5