@@ -16,13 +16,38 @@ def __init__(
16
16
action: Control action type
17
17
18
18
Examples:
19
- >>> Control(rucaptcha_key="aa9.....",
20
- ... action=ControlEnm.getBalance.value).report()
19
+ >>> Control(rucaptcha_key="aa9.....").getBalance()
21
20
{
22
- 'captchaSolve': '1',
23
- 'taskId': None,
24
- 'error': False,
25
- 'errorBody': None
21
+ 'balance': 1593.4479
22
+ }
23
+
24
+ >>> await Control(rucaptcha_key="aa9.....").aio_getBalance()
25
+ {
26
+ 'balance': 1593.4479
27
+ }
28
+
29
+ >>> Control(rucaptcha_key="aa9.....").reportCorrect(id=75188571838)
30
+ {
31
+ 'errorId': 0,
32
+ 'status': 'success'
33
+ }
34
+
35
+ >>> await Control(rucaptcha_key="aa9.....").aio_reportCorrect(id=75188571838)
36
+ {
37
+ 'errorId': 0,
38
+ 'status': 'success'
39
+ }
40
+
41
+ >>> Control(rucaptcha_key="aa9.....").reportIncorrect(id=75188571838)
42
+ {
43
+ 'errorId': 0,
44
+ 'status': 'success'
45
+ }
46
+
47
+ >>> await Control(rucaptcha_key="aa9.....").aio_reportIncorrect(id=75188571838)
48
+ {
49
+ 'errorId': 0,
50
+ 'status': 'success'
26
51
}
27
52
28
53
Returns:
@@ -36,104 +61,84 @@ def __init__(
36
61
37
62
super ().__init__ (method = ControlEnm .control , * args , ** kwargs )
38
63
39
- def report (self , id : str ) -> dict :
64
+ def reportCorrect (self , id : int ) -> dict :
40
65
"""
41
- Captcha results report
66
+ reportCorrect method
42
67
43
68
Args:
44
69
id: Captcha task ID
45
70
46
- Examples:
47
- >>> Control(rucaptcha_key="aa9011f31111181111168611f1151122",
48
- ... action=ControlEnm.GET.value).report(id="73043727671")
49
- {
50
- 'captchaSolve': '1',
51
- 'taskId': None,
52
- 'error': False,
53
- 'errorBody': None
54
- }
71
+ Returns:
72
+ Dict with full server response
55
73
56
- >>> Control(rucaptcha_key="aa9011f31111181111168611f1151122",
57
- ... action=ControlEnm.REPORTGOOD.value).report(id="73043727671")
58
- {
59
- 'captchaSolve': 'OK_REPORT_RECORDED',
60
- 'taskId': None,
61
- 'error': False,
62
- 'errorBody': None
63
- }
74
+ Notes:
75
+ https://2captcha.com/api-docs/report-correct
76
+ """
77
+ self .get_task_payload .taskId = id
78
+ return get_sync_result (
79
+ get_payload = self .get_task_payload ,
80
+ sleep_time = self .params .sleep_time ,
81
+ url_response = f"https://api.{ self .params .service_type } .com/reportCorrect" ,
82
+ )
64
83
65
- >>> Control(rucaptcha_key="aa9011f31111181111168611f1151122",
66
- ... action=ControlEnm.REPORTBAD.value).report(id="73043727671")
67
- {
68
- 'captchaSolve': 'OK_REPORT_RECORDED',
69
- 'taskId': None,
70
- 'error': False,
71
- 'errorBody': None
72
- }
84
+ async def aio_reportCorrect (self , id : int ) -> dict :
85
+ """
86
+ Captcha results report
73
87
88
+ Args:
89
+ id: Captcha task ID
74
90
75
91
Returns:
76
92
Dict with full server response
77
93
78
94
Notes:
79
- https://rucaptcha .com/api-rucaptcha#complain
95
+ https://2captcha .com/api-docs/report-correct
80
96
"""
81
- self .get_payload . update ({ "id" : id })
82
- return get_sync_result (
83
- get_payload = self .get_payload ,
97
+ self .get_task_payload . taskId = id
98
+ return await get_async_result (
99
+ get_payload = self .get_task_payload ,
84
100
sleep_time = self .params .sleep_time ,
85
- url_response = self .params .url_response ,
86
- result = self .result ,
101
+ url_response = f"https://api.{ self .params .service_type } .com/reportCorrect" ,
87
102
)
88
103
89
- async def aio_report (self , id : str ) -> dict :
104
+ def reportIncorrect (self , id : int ) -> dict :
90
105
"""
91
- Captcha results report
106
+ reportCorrect method
92
107
93
108
Args:
94
109
id: Captcha task ID
95
110
96
- Examples:
97
- >>> await Control(rucaptcha_key="aa9011f31111181111168611f1151122",
98
- ... action=ControlEnm.GET.value).aio_report(id="73043727671")
99
- {
100
- 'captchaSolve': '1',
101
- 'taskId': None,
102
- 'error': False,
103
- 'errorBody': None
104
- }
111
+ Returns:
112
+ Dict with full server response
105
113
106
- >>> await Control(rucaptcha_key="aa9011f31111181111168611f1151122",
107
- ... action=ControlEnm.REPORTGOOD.value).aio_report(id="73043727671")
108
- {
109
- 'captchaSolve': 'OK_REPORT_RECORDED',
110
- 'taskId': None,
111
- 'error': False,
112
- 'errorBody': None
113
- }
114
+ Notes:
115
+ https://2captcha.com/api-docs/report-incorrect
116
+ """
117
+ self .get_task_payload .taskId = id
118
+ return get_sync_result (
119
+ get_payload = self .get_task_payload ,
120
+ sleep_time = self .params .sleep_time ,
121
+ url_response = f"https://api.{ self .params .service_type } .com/reportIncorrect" ,
122
+ )
114
123
115
- >>> await Control(rucaptcha_key="aa9011f31111181111168611f1151122",
116
- ... action=ControlEnm.REPORTBAD.value).aio_report(id="73043727671")
117
- {
118
- 'captchaSolve': 'OK_REPORT_RECORDED',
119
- 'taskId': None,
120
- 'error': False,
121
- 'errorBody': None
122
- }
124
+ async def aio_reportIncorrect (self , id : int ) -> dict :
125
+ """
126
+ Captcha results report
123
127
128
+ Args:
129
+ id: Captcha task ID
124
130
125
131
Returns:
126
132
Dict with full server response
127
133
128
134
Notes:
129
- https://rucaptcha .com/api-rucaptcha#complain
135
+ https://2captcha .com/api-docs/report-incorrect
130
136
"""
131
- self .get_payload . update ({ "id" : id })
137
+ self .get_task_payload . taskId = id
132
138
return await get_async_result (
133
- get_payload = self .get_payload ,
139
+ get_payload = self .get_task_payload ,
134
140
sleep_time = self .params .sleep_time ,
135
- url_response = self .params .url_response ,
136
- result = self .result ,
141
+ url_response = f"https://api.{ self .params .service_type } .com/reportIncorrect" ,
137
142
)
138
143
139
144
def getBalance (self ) -> dict :
0 commit comments