Skip to content

Commit 2893973

Browse files
author
Ankur
committed
bypassrecaptcha csharp code added
0 parents  commit 2893973

31 files changed

+2257
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.vs

LICENSE.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2013 Ran Mizrahi <[email protected]>
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

README.md

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
imagetyperzapi - Imagetyperz API wrapper
2+
=========================================
3+
imagetyperzapi is a super easy to use bypass captcha API wrapper for imagetyperz.com captcha service
4+
5+
## Installation
6+
Install-Package imagetyperzapi
7+
8+
or
9+
10+
git clone https://github.com/imagetyperz-api/imagetyperz-api-csharp
11+
12+
## How to use?
13+
14+
Simply import the library, set the auth details and start using the captcha service:
15+
16+
``` csharp
17+
using imagetyperzapi;
18+
```
19+
Set access_token or username and password (legacy) for authentication
20+
21+
``` csharp
22+
string access_key = "your_access_key";
23+
ImagetyperzAPI i = new ImagetyperzAPI(access_key);
24+
```
25+
legacy authentication, will get deprecated at some point
26+
```csharp
27+
i.set_user_and_password("your_username", "your_password");
28+
```
29+
Once you've set your authentication details, you can start using the API
30+
31+
**Get balance**
32+
33+
``` csharp
34+
string balance = i.account_balance();
35+
Console.WriteLine(string.Format("Balance: {0}", balance));
36+
```
37+
38+
**Submit image captcha**
39+
40+
``` csharp
41+
var captcha_text = i.solve_captcha("captcha.jpg");
42+
Console.WriteLine(string.Format("Got response: {0}", captcha_text));
43+
```
44+
Takes a 2nd argument, **case_sensitive** which is a bool
45+
``` csharp
46+
// tell our server this is caseSensitive, false by default
47+
var captcha_text = i.solve_captcha("captcha.jpg", true);
48+
```
49+
50+
**Works with both files and URLs**
51+
``` csharp
52+
var captcha_text = i.solve_captcha("http://abc.com/captcha.jpg");
53+
```
54+
**OBS:** URL instead of image file path works when you're authenticated with access_key. For those that are still using username & password, retrieve your access_key from imagetyperz.com
55+
56+
**Submit recaptcha details**
57+
58+
For recaptcha submission there are two things that are required.
59+
- page_url
60+
- site_key
61+
``` csharp
62+
string page_url = "your_page_url_here";
63+
string sitekey = "your_site_key_here";
64+
// get captcha_id, we'll use this later
65+
string captcha_id = i.submit_recaptcha(page_url, sitekey);
66+
```
67+
This method returns a captchaID. This ID will be used next, to retrieve the g-response, once workers have
68+
completed the captcha. This takes somewhere between 10-80 seconds.
69+
70+
**Retrieve captcha response**
71+
72+
Once you have the captchaID, you check for it's progress, and later on retrieve the gresponse.
73+
74+
The ***in_progress(captcha_id)*** method will tell you if captcha is still being decoded by workers.
75+
Once it's no longer in progress, you can retrieve the gresponse with ***retrieve_recaptcha(captcha_id)***
76+
77+
``` csharp
78+
Console.WriteLine("Waiting for recaptcha to be solved ...");
79+
while (i.in_progress(captcha_id)) // check if it's still being decoded
80+
{ System.Threading.Thread.Sleep(10000); } // sleep for 10 seconds
81+
string recaptcha_response = i.retrieve_captcha(captcha_id); // get the response
82+
Console.WriteLine(string.Format("Recaptcha response: {0}", recaptcha_response));
83+
```
84+
85+
## Other methods/variables
86+
87+
**Affiliate id**
88+
89+
The constructor accepts a 2nd parameter, as the affiliate id.
90+
``` csharp
91+
ImagetypersAPI i = new ImagetypersAPI(access_token, 123);
92+
```
93+
94+
**Requests timeout**
95+
96+
You can set the timeout for the requests using the **set_timeout(seconds)** method
97+
``` csharp
98+
i.set_timeout(10);
99+
```
100+
101+
**Submit recaptcha with proxy**
102+
103+
When a proxy is submitted with the recaptcha details, the workers will complete the captcha using
104+
the provided proxy/IP.
105+
106+
``` csharp
107+
i.submit_recaptcha(page_url, sitekey, "127.0.0.1:1234");
108+
```
109+
Proxy with authentication is also supported
110+
``` csharp
111+
i.submit_recaptcha(page_url, sitekey, "127.0.0.1:1234:user:pass");
112+
```
113+
114+
**Set captcha bad**
115+
116+
When a captcha was solved wrong by our workers, you can notify the server with it's ID,
117+
so we know something went wrong
118+
119+
``` csharp
120+
i.set_captcha_bad(captcha_id);
121+
```
122+
123+
## Examples
124+
Compile and run the **example** project in solution
125+
126+
## Command-line client
127+
For those that are looking for a command-line, check out the **imagetyperz-cli** project in solution
128+
It's a tool that allows you to do pretty much all the API offers, from the command-line
129+
Check it's README.md file of the cli for more details
130+
131+
## Binary
132+
If you don't want to compile your own library, you can check the binary folder for a compiled version.
133+
**Keep in mind** that this might not be the latest version with every release
134+
135+
## License
136+
API library is licensed under the MIT License
137+
138+
## More information
139+
More details about the server-side API can be found [here](http://imagetyperz.com)
140+
141+
142+
<sup><sub>captcha, bypasscaptcha, decaptcher, decaptcha, 2captcha, deathbycaptcha, anticaptcha,
143+
bypassrecaptchav2, bypassnocaptcharecaptcha, bypassinvisiblerecaptcha, captchaservicesforrecaptchav2,
144+
recaptchav2captchasolver, googlerecaptchasolver, recaptchasolverpython, recaptchabypassscript</sup></sub>

binary/cli/README.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
## Windows command-line client
2+
3+
Normal captcha - solve regular captcha (from image file)
4+
--------------------------------------------------------------------------------------------
5+
6+
- mode = 1
7+
- -t "your_token" -m 1 -i "captcha_file"
8+
- -t "your_token" -m 1 -i "captcha_file" -o "output_file" -refid "ref_id" -case "1"
9+
10+
```program.exe -u 12 -p 34 -m 1 -i "C:\Users\Me\Desktop\captcha.jpg"```
11+
12+
----
13+
14+
Recaptcha (submit) - solve recaptcha; submit page_url and sitekey to our server
15+
--------------------------------------------------------------------------------------------
16+
17+
- mode = 2
18+
- -t "your_token" -m 2 -pageurl "page_url" -sitekey "sitekey"
19+
- -t "your_token" -m 2 -pageurl "page_url" -sitekey "sitekey" -o "output_file" -refid "ref_id" -proxy "IP:Port:[user:pass]"
20+
21+
```program.exe -u 12 -p 34 -m 2 -pageurl "http://test.com" -sitekey "adsvvv"```
22+
23+
-----
24+
25+
Recaptcha (retrieve) - retrieve catpcha after it was solved from server
26+
--------------------------------------------------------------------------------------------
27+
28+
- mode = 3
29+
- -t "your_token" -m 3 -captchaid "captcha_id"
30+
- -t "your_token" -m 3 -captchaid "captcha_id" -o "output_file"
31+
32+
```program.exe -u 12 -p 34 -m 3 -id "321"```
33+
34+
----
35+
36+
OTHER
37+
-------
38+
39+
Balance - get account balance (credit)
40+
--------------------------------------------------------------------------------------------
41+
42+
- mode = 4
43+
- -t "your_token" -m 4
44+
- -t "your_token" -m 4 -o "output_file"
45+
46+
```program.exe -u 12 -p 34 -m 4```
47+
48+
----
49+
50+
Set bad captcha - set a bad captcha by using the captcha ID
51+
--------------------------------------------------------------------------------------------
52+
53+
- mode = 5
54+
- -t "your_token" -m 5 -captchaid "captcha_id"
55+
- -t "your_token" -m 5 -captchaid "captcha_id" -o "output_file"
56+
57+
```program.exe -u 12 -p 34 -m 5 -captchaid 321```
58+
59+
----
60+
61+
- The -o parameter is optional. The response/reply will be always printed to STDOUT.
62+
In case you want to have it stored into a file as well, use the -o parameter.
63+
- Same goes with the -tffiliateid parameter
64+
- case parameter for mode 1 (normal captcha) is optional as well, tells if the solving
65+
of the captcha should keep account of lower/upper case. It can be either 1 (enabled) or 0
66+
67+
- The old way of authentication, using username and password still works
68+
-u "username" -p "password"
69+
but it's not recommended because it might be taken out from the API at some point
70+
71+
- In case error occurs, details will be saved to error.txt
72+
73+
- Requires .NET Framework 4.0 to run: https://www.microsoft.com/en-us/download/details.aspx?id=17851
74+
75+

binary/cli/imagetyperz-cli.exe

9.5 KB
Binary file not shown.

binary/cli/imagetyperzapi.dll

12.5 KB
Binary file not shown.

binary/imagetyperzapi.dll

12.5 KB
Binary file not shown.

source/imagetyperzapi/UpgradeLog.XML

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type='text/xsl' href='_UpgradeReport_Files/UpgradeReport.xslt'?><UpgradeLog>
2+
<Properties><Property Name="Solution" Value="imagetyperzapi">
3+
</Property><Property Name="Solution File" Value="C:\Users\root\Desktop\imagetyperz-api-csharp\source\imagetyperzapi\imagetyperzapi.sln">
4+
</Property><Property Name="Date" Value="Wednesday, March 21, 2018">
5+
</Property><Property Name="Time" Value="6:04 AM">
6+
</Property></Properties><Event ErrorLevel="0" Project="imagetyperzapi" Source="imagetyperzapi\imagetyperzapi.csproj" Description="The project file does not require conversion.">
7+
</Event><Event ErrorLevel="3" Project="imagetyperzapi" Source="imagetyperzapi\imagetyperzapi.csproj" Description="No Conversion Required">
8+
</Event><Event ErrorLevel="0" Project="example" Source="example\example.csproj" Description="The project file does not require conversion.">
9+
</Event><Event ErrorLevel="3" Project="example" Source="example\example.csproj" Description="No Conversion Required">
10+
</Event><Event ErrorLevel="0" Project="imagetyperz-cli" Source="imagetyperz-cli\imagetyperz-cli.csproj" Description="The project file does not require conversion.">
11+
</Event><Event ErrorLevel="3" Project="imagetyperz-cli" Source="imagetyperz-cli\imagetyperz-cli.csproj" Description="No Conversion Required">
12+
</Event><Event ErrorLevel="0" Project="" Source="imagetyperzapi.sln" Description="Solution converted successfully">
13+
</Event><Event ErrorLevel="3" Project="" Source="imagetyperzapi.sln" Description="Converted">
14+
</Event></UpgradeLog>

0 commit comments

Comments
 (0)