Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
API bindings for the NopeCHA CAPTCHA service.
To install from PyPI, run python3 -m pip install nopecha
.
This package provides API wrappers for the following http packages:
Note: You will need to install the http package you want to use separately
(except for urllib
, as it's built-in but not recommended).
from nopecha.api.requests import RequestsAPIClient
api = RequestsAPIClient("YOUR_API_KEY")
solution = api.solve_hcaptcha("b4c45857-0e23-48e6-9017-e28fff99ffb2", "https://nopecha.com/demo/hcaptcha#easy")
print("token is", solution["data"])
from nopecha.api.httpx import AsyncHTTPXAPIClient
async def main():
api = AsyncHTTPXAPIClient("YOUR_API_KEY")
solution = await api.solve_hcaptcha("b4c45857-0e23-48e6-9017-e28fff99ffb2", "https://nopecha.com/demo/hcaptcha#easy")
print("token is", solution["data"])
asyncio.run(main())
This package also provides a extension builder for Automation builds which includes:
from nopecha.extension import build_chromium
# will download the extension to the current working directory
output = build_chromium({
"key": "YOUR_API_KEY",
})
# custom output directory
from pathlib import Path
output = build_chromium({
"key": "YOUR_API_KEY",
}, Path("extension"))
You can plug the output path directly into your browser's extension manager to load the extension:
import undetected_chromedriver as uc
from nopecha.extension import build_chromium
output = build_chromium({
"key": "YOUR_API_KEY",
})
options = uc.ChromeOptions()
options.add_argument(f"load-extension={output}")
To build from source, you will need to install
build
(python3 -m pip install --upgrade build
).
Then simply run python3 -m build
to build the package.
To upload to PyPI, you will need to install
twine
(python3 -m pip install --upgrade twine
).
Then simply run python3 -m twine upload dist/*
to upload the package.
If you are migrating from v1, you will need to update your code to use the new client classes.
V1 was synchronous only, using the requests HTTP library. V2 supports both synchronous and asynchronous code, and multiple HTTP libraries.
To migrate, you will need to:
nopecha.api_key
with creating a client instance.# Before
import nopecha
nopecha.api_key = "YOUR_API_KEY"
# Now
from nopecha.api.requests import RequestsAPIClient
client = RequestsAPIClient("YOUR_API_KEY")
nopecha.Token.solve()
/nopecha.Recognition.solve()
/nopecha.Balance.get()
with the appropriate method on the client instance.# Before
import nopecha
nopecha.api_key = "..."
clicks = nopecha.Recognition.solve(
type='hcaptcha',
task='Please click each image containing a cat-shaped cookie.',
image_urls=[f"https://nopecha.com/image/demo/hcaptcha/{i}.png" for i in range(9)],
)
print(clicks)
token = nopecha.Token.solve(
type='hcaptcha',
sitekey='ab803303-ac41-41aa-9be1-7b4e01b91e2c',
url='https://nopecha.com/demo/hcaptcha',
)
print(token)
balance = nopecha.Balance.get()
print(balance)
# Now
from nopecha.api.requests import RequestsAPIClient
client = RequestsAPIClient("YOUR_API_KEY")
clicks = client.recognize_hcaptcha(
'Please click each image containing a cat-shaped cookie.',
[f"https://nopecha.com/image/demo/hcaptcha/{i}.png" for i in range(9)],
)
print(clicks)
token = client.solve_hcaptcha(
'ab803303-ac41-41aa-9be1-7b4e01b91e2c',
'https://nopecha.com/demo/hcaptcha',
)
print(token)
balance = client.status()
print(balance)
FAQs
API bindings for the NopeCHA CAPTCHA-solving service.
We found that nopecha demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.