搜索

PythonReactSEOPDF
OpenClaw

captcha-solver

验证码识别与解决 - 本地OCR识别 + 第三方API / CAPTCHA Recognition and Solving - Local OCR + Third-party APIs

bombfuock0 来源安装数☆ 0 仓库 Stars

安装与使用

请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。

SkillHub CLI

skillhub install bombfuock/captcha-solver

打开来源仓库,查看说明和兼容环境后,按来源提供的命令或步骤安装。

将来源链接提供给你的 Agent,让它先读取说明、核对依赖,并向你说明将执行的安装步骤。

查看来源 ↗使用指南

技能说明

验证码识别与解决 / CAPTCHA Solver

自动识别和解决各类验证码 / Automatically recognize and solve various CAPTCHAs

支持类型 / Supported Types

本地OCR识别 / Local OCR (免费/Free)
  • 🔤 简单文本验证码 / Simple text CAPTCHA
  • 🔢 数字验证码 / Numeric CAPTCHA
  • ➕ 数学运算验证码 / Math CAPTCHA
  • 🖼️ 滑动验证码(缺口检测) / Slide CAPTCHA (gap detection)
API解决 / API Solving (付费/APIs)
  • reCAPTCHA v2/v3
  • hCaptcha
  • Cloudflare Turnstile
  • 2Captcha / Anti-Captcha

使用方法 / Usage

# 识别图片验证码
python solve.py --image captcha.png

# 解决reCaptcha
python solve.py --recaptcha "site_key" --url "page_url"

# 滑动验证码
python solve.py --slide background.png --template slider.png

配置 / Configuration

本地OCR
# 默认使用Tesseract
TESSERACT_CMD = "/usr/bin/tesseract"
LANG = "eng+chi_sim"  # 支持中英文
API服务 (可选)
# 2Captcha
API_2CAPTCHA = "your_api_key"

# Anti-Captcha  
API_ANTI_CAPTCHA = "your_api_key"

算法 / Algorithms

1. 图像预处理
  • 灰度转换 / Grayscale
  • 二值化 / Binarization
  • 去噪 / Denoising
  • 锐化 / Sharpening
2. 字符分割
  • 连通域分析 / Connected component analysis
  • 投影法 / Projection method
3. 字符识别
  • 模板匹配 / Template matching
  • 机器学习 / ML-based OCR
4. 滑动验证码
  • 边缘检测 / Edge detection
  • 缺口定位 / Gap localization
  • 轨迹生成 / Trajectory generation

示例 / Examples

简单文本识别
from solver import CaptchaSolver

solver = CaptchaSolver()
result = solver.solve_image("captcha.png")
print(result)  # 输出识别的字符
滑动验证码
result = solver.solve_slide(bg_img, slider_img)
print(result)  # 输出滑动距离
reCaptcha
result = solver.solve_recaptcha(site_key, page_url)
print(result)  # 输出token

服务对比 / Service Comparison

服务 价格 成功率 速度
本地OCR 免费 60-80% 快
2Captcha $2.99/1000 95%+ 慢
Anti-Captcha $2.00/1000 95%+ 中

##...

来源信息

Source
github
Repository
openclaw/skills
Path
skills/bombfuock/captcha-solver
Version
—
Commit
03eea8ceb9ac8bd598f6831d778dd6ece6eb2571
分类来源
rules
状态
active
可见性
public

这些信息来自收录时的来源分析,可能滞后;使用前请核对最新来源文件。

README

验证码识别与解决 / CAPTCHA Solver

自动识别和解决各类验证码

功能 / Features

  • 📷 图片验证码识别 (OCR)
  • 🖱️ 滑动验证码解决
  • 🤖 reCaptcha解决 (API)
  • 🔧 支持本地识别和API调用

安装 / Install

# 安装依赖
pip install pillow numpy opencv-python

# 可选:安装Tesseract
# Ubuntu: apt install tesseract-ocr
# Mac: brew install tesseract

使用 / Usage

# 识别图片验证码
python scripts/solve.py --image captcha.png

# 解决滑动验证码
python scripts/solve.py --slide-bg bg.png --slide-slider slider.png

# 解决reCaptcha (需要API)
python scripts/solve.py --recaptcha-key "site_key" --recaptcha-url "https://..."

API / API

from solver import CaptchaSolver

solver = CaptchaSolver()

# 图片验证码
result = solver.solve_image("captcha.png")

# 滑动验证码
result = solver.solve_slide(bg.png, slider.png)

环境变量

export API_2CAPTCHA="your_api_key"

注意

仅供学习研究使用,请遵守网站服务条款。

来源内容

SKILL.md
# 验证码识别与解决 / CAPTCHA Solver

自动识别和解决各类验证码 / Automatically recognize and solve various CAPTCHAs

## 支持类型 / Supported Types

### 本地OCR识别 / Local OCR (免费/Free)
- 🔤 简单文本验证码 / Simple text CAPTCHA
- 🔢 数字验证码 / Numeric CAPTCHA
- ➕ 数学运算验证码 / Math CAPTCHA
- 🖼️ 滑动验证码(缺口检测) / Slide CAPTCHA (gap detection)

### API解决 / API Solving (付费/APIs)
- reCAPTCHA v2/v3
- hCaptcha
- Cloudflare Turnstile
- 2Captcha / Anti-Captcha

## 使用方法 / Usage

```bash
# 识别图片验证码
python solve.py --image captcha.png

# 解决reCaptcha
python solve.py --recaptcha "site_key" --url "page_url"

# 滑动验证码
python solve.py --slide background.png --template slider.png
```

## 配置 / Configuration

### 本地OCR
```python
# 默认使用Tesseract
TESSERACT_CMD = "/usr/bin/tesseract"
LANG = "eng+chi_sim"  # 支持中英文
```

### API服务 (可选)
```python
# 2Captcha
API_2CAPTCHA = "your_api_key"

# Anti-Captcha  
API_ANTI_CAPTCHA = "your_api_key"
```

## 算法 / Algorithms

### 1. 图像预处理
- 灰度转换 / Grayscale
- 二值化 / Binarization
- 去噪 / Denoising
- 锐化 / Sharpening

### 2. 字符分割
- 连通域分析 / Connected component analysis
- 投影法 / Projection method

### 3. 字符识别
- 模板匹配 / Template matching
- 机器学习 / ML-based OCR

### 4. 滑动验证码
- 边缘检测 / Edge detection
- 缺口定位 / Gap localization
- 轨迹生成 / Trajectory generation

## 示例 / Examples

### 简单文本识别
```python
from solver import CaptchaSolver

solver = CaptchaSolver()
result = solver.solve_image("captcha.png")
print(result)  # 输出识别的字符
```

### 滑动验证码
```python
result = solver.solve_slide(bg_img, slider_img)
print(result)  # 输出滑动距离
```

### reCaptcha
```python
result = solver.solve_recaptcha(site_key, page_url)
print(result)  # 输出token
```

## 服务对比 / Service Comparison

| 服务 | 价格 | 成功率 | 速度 |
|------|------|--------|------|
| 本地OCR | 免费 | 60-80% | 快 |
| 2Captcha | $2.99/1000 | 95%+ | 慢 |
| Anti-Captcha | $2.00/1000 | 95%+ | 中 |

##...
README
# 验证码识别与解决 / CAPTCHA Solver

自动识别和解决各类验证码

## 功能 / Features

- 📷 图片验证码识别 (OCR)
- 🖱️ 滑动验证码解决
- 🤖 reCaptcha解决 (API)
- 🔧 支持本地识别和API调用

## 安装 / Install

```bash
# 安装依赖
pip install pillow numpy opencv-python

# 可选:安装Tesseract
# Ubuntu: apt install tesseract-ocr
# Mac: brew install tesseract
```

## 使用 / Usage

```bash
# 识别图片验证码
python scripts/solve.py --image captcha.png

# 解决滑动验证码
python scripts/solve.py --slide-bg bg.png --slide-slider slider.png

# 解决reCaptcha (需要API)
python scripts/solve.py --recaptcha-key "site_key" --recaptcha-url "https://..."
```

## API / API

```python
from solver import CaptchaSolver

solver = CaptchaSolver()

# 图片验证码
result = solver.solve_image("captcha.png")

# 滑动验证码
result = solver.solve_slide(bg.png, slider.png)
```

## 环境变量

```bash
export API_2CAPTCHA="your_api_key"
```

## 注意

仅供学习研究使用,请遵守网站服务条款。

相关技能

OpenClaw

1password

daggerkun007

Set up and use 1Password CLI (op). Use when installing the CLI, enabling desktop app integration, signing in (single or multi-account), or reading/injecting/running secrets via op.