Skip to content

Commit 24b1dc6

Browse files
committed
feat(core): rewrite Capmonster client with Pydantic v2 and modern Python features
- Replaced legacy procedural structure with fully typed class-based design - Introduced Pydantic v2 models with field validation, serialization, and aliasing - Implemented sync and async Capmonster clients using httpx - Added extensible BaseTaskPayload structure with abstract to_request() - Included validator and field_serializer usage for dynamic task behavior - Flattened proxy structure via smart task serialization - Applied frozen and immutable model config where applicable - Full support for Literal, Optional etc. - Some test cases prepared with pytest + pytest-asyncio - Ready for mkdocs documentation generation BREAKING CHANGE: API usage has completely changed from v3.2 to v4.0. All task creation methods now rely on structured payloads and typed clients.
1 parent ac2ba72 commit 24b1dc6

74 files changed

Lines changed: 1253 additions & 13407 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

capmonster_python/__init__.py

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1-
from .recaptcha_v2 import RecaptchaV2Task
2-
from .recaptcha_v2_enterprise import RecaptchaV2EnterpriseTask
3-
from .fun_captcha import FuncaptchaTask
4-
from .recaptcha_v3 import RecaptchaV3Task
5-
from .hcaptcha import HCaptchaTask
6-
from .image_to_text import ImageToTextTask
7-
from .geetest import GeeTestTask
8-
from .utils import CapmonsterException
9-
from .compleximage import ComplexImageTask
10-
from .datadome import DataDomeTask
11-
from .turnstile import TurnstileTask
12-
from .tendi import TenDITask
13-
from .aws_waf import AmazonWafTask
1+
from .client import CapmonsterClient
2+
from .tasks.basilisk import BasiliskTask
3+
from .tasks.binance import BinanceTask
4+
from .tasks.complex_image_recaptcha import ComplexImageRecaptchaTask, ComplexImageRecaptchaMetadata
5+
from .tasks.complex_image_recognition import ComplexImageRecognitionTask
6+
from .tasks.datadome import DataDomeTask, DataDomeMetadata
7+
from .tasks.geetest import GeeTestV4Task, GeeTestV3Task
8+
from .tasks.image_to_text import ImageToTextTask
9+
from .tasks.imperva import ImpervaTask, ImpervaTaskMetadata
10+
from .tasks.prosopo import ProsopoTask
11+
from .tasks.recaptcha_v2 import RecaptchaV2Task
12+
from .tasks.recaptcha_v2_enterprise import RecaptchaV2EnterpriseTask
13+
from .tasks.recaptcha_v3 import RecaptchaV3Task
14+
from .tasks.temu import TemuTask
15+
from .tasks.tendi import TenDITask
16+
from .tasks.turnstile import TurnstileTask, TurnstileCloudFlareTask

capmonster_python/aws_waf.py

Lines changed: 0 additions & 22 deletions
This file was deleted.

capmonster_python/capmonster.py

Lines changed: 0 additions & 253 deletions
This file was deleted.

0 commit comments

Comments
 (0)