-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into RC-2938-cybersiara
- Loading branch information
Showing
6 changed files
with
117 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import sys | ||
import os | ||
import json | ||
|
||
sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__)))) | ||
|
||
from twocaptcha import TwoCaptcha | ||
|
||
# in this example we store the API key inside environment variables that can be set like: | ||
# export APIKEY_2CAPTCHA=1abc234de56fab7c89012d34e56fa7b8 on Linux or macOS | ||
# set APIKEY_2CAPTCHA=1abc234de56fab7c89012d34e56fa7b8 on Windows | ||
# you can just set the API key directly to it's value like: | ||
# api_key="1abc234de56fab7c89012d34e56fa7b8" | ||
|
||
api_key = os.getenv('APIKEY_2CAPTCHA', 'YOUR_API_KEY') | ||
|
||
solver = TwoCaptcha(api_key) | ||
|
||
try: | ||
result = solver.datadome( | ||
captcha_url="https://geo.captcha-delivery.com/captcha/?initialCid=AHrlqAAAAAMAZirHgKBVrxwAsVuKlQ%3D%3D&c...", | ||
pageurl="https://mysite.com/page/with/datadome", | ||
userAgent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36", | ||
proxy={ | ||
'type': 'HTTP', | ||
'uri': 'login:password@IP_address:PORT' | ||
} | ||
) | ||
|
||
except Exception as e: | ||
sys.exit(e) | ||
|
||
else: | ||
sys.exit('result: ' + str(result)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import unittest | ||
|
||
try: | ||
from .abstract import AbstractTest | ||
except ImportError: | ||
from abstract import AbstractTest | ||
|
||
|
||
class DatadomeTest(AbstractTest): | ||
|
||
def test_all_params(self): | ||
params = { | ||
'captcha_url': 'https://geo.captcha-delivery.com/captcha/?initialCid=AHrlqAAAAAMAZirHgKBVrxwAsVuKlQ%3D%3D&c', | ||
'pageurl': 'https://mysite.com/page/with/datadome', | ||
'userAgent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36', | ||
'proxy': {'type': 'HTTP', 'uri': 'login:password@IP_address:PORT'} | ||
} | ||
|
||
sends = { | ||
'method': 'datadome', | ||
'captcha_url': 'https://geo.captcha-delivery.com/captcha/?initialCid=AHrlqAAAAAMAZirHgKBVrxwAsVuKlQ%3D%3D&c', | ||
'pageurl': 'https://mysite.com/page/with/datadome', | ||
'userAgent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36', | ||
'proxy': 'login:password@IP_address:PORT', | ||
'proxytype': 'HTTP' | ||
} | ||
|
||
return self.send_return(sends, self.solver.datadome, **params) | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,4 +12,4 @@ | |
""" | ||
|
||
__author__ = '2captcha' | ||
__version__ = '1.2.8' | ||
__version__ = '1.3.0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters