Skip to content
This repository was archived by the owner on Mar 5, 2021. It is now read-only.

Commit 8f72b3c

Browse files
1st commit
0 parents  commit 8f72b3c

File tree

8 files changed

+559
-0
lines changed

8 files changed

+559
-0
lines changed

LICENSE.txt

+21
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

+129
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
imagetyperz-api-python2 - Imagetyperz API wrapper
2+
=========================================
3+
4+
imagetyperzapi2 is a super easy to use bypass captcha API wrapper for imagetyperz.com captcha service
5+
6+
## Installation
7+
8+
9+
git clone https://github.com/imagetyperz-api/imagetyperz-api-python2
10+
11+
## Dependencies
12+
13+
pip install requests
14+
15+
## Usage
16+
# make sure you've changed access_key, page_url, etc in main.py
17+
python main.py
18+
19+
## How to use?
20+
21+
Simply require the module, set the auth details and start using the captcha service:
22+
23+
``` python
24+
from imagetyperzapi2 import ImageTyperzAPI
25+
from time import sleep
26+
```
27+
Set access_token or username and password (legacy) for authentication
28+
29+
``` python
30+
access_token = 'access_token_here'
31+
# get access token from: http://www.imagetyperz.com/Forms/ClientHome.aspx
32+
ita = ImageTyperzAPI(access_token) # init imagetyperz api obj
33+
```
34+
```python
35+
# legacy way, will get deprecated at some point
36+
#ita.set_user_password('your_username', 'your_password')
37+
```
38+
Once you've set your authentication details, you can start using the API
39+
40+
**Get balance**
41+
42+
``` python
43+
balance = ita.account_balance() # get account balance
44+
print 'Balance: {}'.format(balance) # print balance
45+
```
46+
47+
**Submit image captcha**
48+
49+
``` python
50+
ita.solve_captcha('captcha.jpg', case_sensitive=False)
51+
```
52+
**Works with both files and URLs**
53+
``` python
54+
ita.solve_captcha('http://abc.com/your_captcha.jpg')
55+
```
56+
**Submit recaptcha details**
57+
58+
For recaptcha submission there are two things that are required.
59+
- page_url
60+
- site_key
61+
``` python
62+
captcha_id = ita.submit_recaptcha(page_url, sitekey) # submit captcha first, to get ID
63+
```
64+
This method returns a captchaID. This ID will be used next, to retrieve the g-response, once workers have
65+
completed the captcha. This takes somewhere between 10-80 seconds.
66+
67+
**Retrieve captcha response**
68+
69+
Once you have the captchaID, you check for it's progress, and later on retrieve the gresponse.
70+
71+
The ***in_progress()*** method will tell you if captcha is still being decoded by workers.
72+
Once it's no longer in progress, you can retrieve the gresponse with ***retrieve_recaptcha(captcha_id)***
73+
74+
``` python
75+
# check if it's still in progress (waiting to be solved), every 10 seconds
76+
print 'Waiting for recaptcha to be solved ...'
77+
while ita.in_progress(): # while it's still in progress
78+
sleep(10) # sleep for 10 seconds and recheck
79+
80+
recaptcha_response = ita.retrieve_recaptcha(captcha_id) # captcha_id is optional, if not given, will use last captcha id submited
81+
print 'Recaptcha response: {}'.format(recaptcha_response) # print google response
82+
```
83+
84+
## Other methods/variables
85+
86+
**Affiliate id**
87+
88+
The constructor accepts a 2nd parameter, as the affiliate id.
89+
``` python
90+
ita = ImageTyperzAPI(access_token, 123) # 123 is the affid
91+
```
92+
93+
**Requests timeout**
94+
95+
As a 3rd parameter in the constructor, you can specify a timeout for the requests (in seconds)
96+
``` python
97+
ita = ImageTyperzAPI(access_token, 123, 60) # sets timeout to 60 seconds
98+
```
99+
100+
**Submit recaptcha with proxy**
101+
102+
When a proxy is submitted with the recaptcha details, the workers will complete the captcha using
103+
the provided proxy/IP.
104+
105+
``` python
106+
captcha_id = ita.submit_recaptcha(page_url, sitekey, '12.34.56.78:1234') # ip:port
107+
```
108+
Proxy with authentication is also supported
109+
``` python
110+
captcha_id = ita.submit_recaptcha(page_url, sitekey, '12.34.56.78:1234:user:password')
111+
```
112+
113+
**Set captcha bad**
114+
115+
When a captcha was solved wrong by our workers, you can notify the server with it's ID,
116+
so we know something went wrong.
117+
118+
``` python
119+
print ita.set_captcha_bad(captcha_id)
120+
```
121+
122+
## Examples
123+
Check main.py
124+
125+
## License
126+
API library is licensed under the MIT License
127+
128+
## More information
129+
More details about the server-side API can be found [here](http://imagetyperz.com)

imagetyperzapi2/__init__.py

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
__title__ = 'imagetyperzapi2-python2'
2+
__version__ = '1.0.0'
3+
__author__ = 'Imagetyperz Dev'
4+
__license__ = 'MIT'
5+
__copyright__ = 'Copyright 2018 ImageTyperz.com'
6+
7+
from imagetyperzapi import *

imagetyperzapi2/__init__.pyc

446 Bytes
Binary file not shown.
396 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)