Skip to content

Commit 81652ff

Browse files
author
Mark Miller
committed
v1.1.0
1 parent dc3537f commit 81652ff

31 files changed

Lines changed: 272 additions & 82 deletions

examples/canvas.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))
44
from twocaptcha import TwoCaptcha
55

6+
# in this example we store the API key inside environment variables that can be set like:
7+
# export APIKEY_2CAPTCHA=1abc234de56fab7c89012d34e56fa7b8 on Linux or macOS
8+
# set APIKEY_2CAPTCHA=1abc234de56fab7c89012d34e56fa7b8 on Windows
9+
# you can just set the API key directly to it's value like:
10+
# api_key="1abc234de56fab7c89012d34e56fa7b8"
11+
612
api_key = os.getenv('APIKEY_2CAPTCHA', 'YOUR_API_KEY')
713

814
solver = TwoCaptcha(api_key)
@@ -14,4 +20,4 @@
1420
sys.exit(e)
1521

1622
else:
17-
sys.exit('solved: ' + str(result))
23+
sys.exit('result: ' + str(result))

examples/canvas_base64.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55
sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))
66
from twocaptcha import TwoCaptcha
77

8+
# in this example we store the API key inside environment variables that can be set like:
9+
# export APIKEY_2CAPTCHA=1abc234de56fab7c89012d34e56fa7b8 on Linux or macOS
10+
# set APIKEY_2CAPTCHA=1abc234de56fab7c89012d34e56fa7b8 on Windows
11+
# you can just set the API key directly to it's value like:
12+
# api_key="1abc234de56fab7c89012d34e56fa7b8"
13+
814
api_key = os.getenv('APIKEY_2CAPTCHA', 'YOUR_API_KEY')
915

1016
solver = TwoCaptcha(api_key)
@@ -19,4 +25,4 @@
1925
sys.exit(e)
2026

2127
else:
22-
sys.exit('solved: ' + str(result))
28+
sys.exit('result: ' + str(result))

examples/canvas_options.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,15 @@
44

55
from twocaptcha import TwoCaptcha
66

7+
# in this example we store the API key inside environment variables that can be set like:
8+
# export APIKEY_2CAPTCHA=1abc234de56fab7c89012d34e56fa7b8 on Linux or macOS
9+
# set APIKEY_2CAPTCHA=1abc234de56fab7c89012d34e56fa7b8 on Windows
10+
# you can just set the API key directly to it's value like:
11+
# api_key="1abc234de56fab7c89012d34e56fa7b8"
12+
713
api_key = os.getenv('APIKEY_2CAPTCHA', 'YOUR_API_KEY')
814

9-
solver = TwoCaptcha(api_key, defaultTimeout=120, pollingInterval=5)
15+
solver = TwoCaptcha(api_key, defaultTimeout=120, pollingInterval=5, server='2captcha.com')
1016

1117
try:
1218
result = solver.canvas(
@@ -16,11 +22,10 @@
1622
lang='en',
1723
hintImg='./images/canvas_hint.jpg',
1824
hintText='Draw around apple',
19-
# callback='http://127.0.0.1/test/'
2025
)
2126

22-
except Exception as e:
27+
except Exception as e:
2328
sys.exit(e)
2429

2530
else:
26-
sys.exit('sent: ' + str(result))
31+
sys.exit('result: ' + str(result))

examples/capy.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44

55
from twocaptcha import TwoCaptcha
66

7+
# in this example we store the API key inside environment variables that can be set like:
8+
# export APIKEY_2CAPTCHA=1abc234de56fab7c89012d34e56fa7b8 on Linux or macOS
9+
# set APIKEY_2CAPTCHA=1abc234de56fab7c89012d34e56fa7b8 on Windows
10+
# you can just set the API key directly to it's value like:
11+
# api_key="1abc234de56fab7c89012d34e56fa7b8"
12+
713
api_key = os.getenv('APIKEY_2CAPTCHA', 'YOUR_API_KEY')
814

915
solver = TwoCaptcha(api_key)
@@ -19,4 +25,4 @@
1925
sys.exit(e)
2026

2127
else:
22-
sys.exit('solved: ' + str(result))
28+
sys.exit('result: ' + str(result))

examples/capy_options.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44

55
from twocaptcha import TwoCaptcha
66

7+
# in this example we store the API key inside environment variables that can be set like:
8+
# export APIKEY_2CAPTCHA=1abc234de56fab7c89012d34e56fa7b8 on Linux or macOS
9+
# set APIKEY_2CAPTCHA=1abc234de56fab7c89012d34e56fa7b8 on Windows
10+
# you can just set the API key directly to it's value like:
11+
# api_key="1abc234de56fab7c89012d34e56fa7b8"
12+
713
api_key = os.getenv('APIKEY_2CAPTCHA', 'YOUR_API_KEY')
814

915
solver = TwoCaptcha(api_key, defaultTimeout=30, pollingInterval=5)
@@ -18,4 +24,4 @@
1824
sys.exit(e)
1925

2026
else:
21-
sys.exit('solved: ' + str(result))
27+
sys.exit('result: ' + str(result))

examples/coordinates.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44

55
from twocaptcha import TwoCaptcha
66

7+
# in this example we store the API key inside environment variables that can be set like:
8+
# export APIKEY_2CAPTCHA=1abc234de56fab7c89012d34e56fa7b8 on Linux or macOS
9+
# set APIKEY_2CAPTCHA=1abc234de56fab7c89012d34e56fa7b8 on Windows
10+
# you can just set the API key directly to it's value like:
11+
# api_key="1abc234de56fab7c89012d34e56fa7b8"
12+
713
api_key = os.getenv('APIKEY_2CAPTCHA', 'YOUR_API_KEY')
814

915
solver = TwoCaptcha(api_key)
@@ -15,4 +21,4 @@
1521
sys.exit(e)
1622

1723
else:
18-
sys.exit('solved: ' + str(result))
24+
sys.exit('result: ' + str(result))

examples/coordinates_base64.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66

77
from twocaptcha import TwoCaptcha
88

9+
# in this example we store the API key inside environment variables that can be set like:
10+
# export APIKEY_2CAPTCHA=1abc234de56fab7c89012d34e56fa7b8 on Linux or macOS
11+
# set APIKEY_2CAPTCHA=1abc234de56fab7c89012d34e56fa7b8 on Windows
12+
# you can just set the API key directly to it's value like:
13+
# api_key="1abc234de56fab7c89012d34e56fa7b8"
14+
915
api_key = os.getenv('APIKEY_2CAPTCHA', 'YOUR_API_KEY')
1016

1117
solver = TwoCaptcha(api_key)
@@ -20,4 +26,4 @@
2026
sys.exit(e)
2127

2228
else:
23-
sys.exit('solved: ' + str(result))
29+
sys.exit('result: ' + str(result))

examples/coordinates_options.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55

66
from twocaptcha import TwoCaptcha
77

8+
# in this example we store the API key inside environment variables that can be set like:
9+
# export APIKEY_2CAPTCHA=1abc234de56fab7c89012d34e56fa7b8 on Linux or macOS
10+
# set APIKEY_2CAPTCHA=1abc234de56fab7c89012d34e56fa7b8 on Windows
11+
# you can just set the API key directly to it's value like:
12+
# api_key="1abc234de56fab7c89012d34e56fa7b8"
13+
814
api_key = os.getenv('APIKEY_2CAPTCHA', 'YOUR_API_KEY')
915

1016
solver = TwoCaptcha(api_key, defaultTimeout=120, pollingInterval=5)
@@ -18,4 +24,4 @@
1824
sys.exit(e)
1925

2026
else:
21-
sys.exit('solved: ' + str(result))
27+
sys.exit('result: ' + str(result))

examples/funcaptcha.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44

55
from twocaptcha import TwoCaptcha
66

7+
# in this example we store the API key inside environment variables that can be set like:
8+
# export APIKEY_2CAPTCHA=1abc234de56fab7c89012d34e56fa7b8 on Linux or macOS
9+
# set APIKEY_2CAPTCHA=1abc234de56fab7c89012d34e56fa7b8 on Windows
10+
# you can just set the API key directly to it's value like:
11+
# api_key="1abc234de56fab7c89012d34e56fa7b8"
12+
713
api_key = os.getenv('APIKEY_2CAPTCHA', 'YOUR_API_KEY')
814

915
solver = TwoCaptcha(api_key)
@@ -17,4 +23,4 @@
1723
sys.exit(e)
1824

1925
else:
20-
sys.exit('solved: ' + str(result))
26+
sys.exit('result: ' + str(result))

examples/funcaptcha_options.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44

55
from twocaptcha import TwoCaptcha
66

7+
# in this example we store the API key inside environment variables that can be set like:
8+
# export APIKEY_2CAPTCHA=1abc234de56fab7c89012d34e56fa7b8 on Linux or macOS
9+
# set APIKEY_2CAPTCHA=1abc234de56fab7c89012d34e56fa7b8 on Windows
10+
# you can just set the API key directly to it's value like:
11+
# api_key="1abc234de56fab7c89012d34e56fa7b8"
12+
713
api_key = os.getenv('APIKEY_2CAPTCHA', 'YOUR_API_KEY')
814

915
solver = TwoCaptcha(api_key, defaultTimeout=180, pollingInterval=15)
@@ -25,4 +31,4 @@
2531
sys.exit(e)
2632

2733
else:
28-
sys.exit('solved: ' + str(result))
34+
sys.exit('result: ' + str(result))

0 commit comments

Comments
 (0)