一个功能强大的 Flowith 账号自动化注册工具,支持单个注册、批量注册、并行注册和号池模式(持续运行)。可与 Deno 服务无缝集成,自动同步生成的 API Token。
- ✅ 单个注册 - 注册单个账号,适合测试和验证
- ✅ 批量注册(串行) - 按顺序批量注册,稳定可靠
- ✅ 并行注册(多线程) - 多线程并发注册,快速高效
- ✅ 号池模式 - 持续运行,定时自动注册账号
- ✅ 智能重试 - 失败自动重试,提高成功率
- ✅ 统计报告 - 实时显示成功率、失败率等统计信息
- 🔐 Cloudflare绕过 - 自动处理 Cloudflare Turnstile 验证
- 📧 IMAP邮件集成 - 自动获取邮箱验证码
- 🔄 Deno服务集成 - 自动同步 Token 到 Deno 服务
- 🎭 反爬虫技术 - 使用 puppeteer-real-browser,模拟真实浏览器行为
- 📊 灵活日志 - 支持 verbose/minimal/silent 三种日志级别
- 🛠️ CLI命令行 - 统一的命令行界面,易于使用
| 技术 | 用途 | 版本 |
|---|---|---|
| Node.js | 运行环境 | ≥16.0.0 |
| Puppeteer | 浏览器自动化 | ^21.0.0 |
| puppeteer-real-browser | 反爬虫增强 | ^1.3.8 |
| IMAP | 邮件接收 | ^0.8.19 |
| mailparser | 邮件解析 | ^3.6.5 |
// 使用 puppeteer-real-browser 实现最强反检测
const { connect } = require('puppeteer-real-browser');
const response = await connect({
headless: false,
turnstile: true, // 启用 Cloudflare Turnstile 支持
args: [
'--disable-blink-features=AutomationControlled',
'--lang=zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7'
]
});关键技术点:
- 隐藏 webdriver 特征
- 模拟真实浏览器指纹
- 自动处理 Cloudflare 验证
- 注入人类行为模式
async handleCloudflareVerification() {
// 多策略检测和点击验证框
const strategies = [
'iframe[src*="challenges.cloudflare.com"]',
'iframe[src*="turnstile"]',
'iframe[title*="Widget"]'
];
// 自动定位并点击验证checkbox
for (const selector of strategies) {
const iframe = await page.$(selector);
if (iframe) {
const frame = await iframe.contentFrame();
await frame.$('input[type="checkbox"]').click();
break;
}
}
}// 使用 JavaScript 直接操作 DOM,避免检测
await element.evaluate((el, value) => {
el.focus();
el.dispatchEvent(new FocusEvent('focus', { bubbles: true }));
el.value = value;
el.dispatchEvent(new Event('input', { bubbles: true }));
el.dispatchEvent(new Event('change', { bubbles: true }));
el.blur();
}, inputValue);class EmailClient {
async getVerificationCode(timeout = 120000) {
// 定时轮询邮箱
while (Date.now() - startTime < timeout) {
const emails = await this._searchForCode();
// 智能匹配验证码(多种正则模式)
const codeMatch = email.match(/(?:app|website):\s*(\d{6})\b/i);
if (codeMatch) return codeMatch[1];
await wait(5000); // 5秒后重试
}
}
}async fetchAPIToken() {
// 从浏览器 localStorage 获取 auth token
const authToken = await page.evaluate(() => {
return localStorage.getItem('token') ||
localStorage.getItem('access_token');
});
// 使用 Node.js 发起 API 请求(避免 CORS)
const response = await httpsRequest({
url: 'https://edge.flowith.net/external/account/api-keys',
headers: { 'authorization': authToken }
});
// 解析并返回最新的 token
return response.keys[0].token;
}class DenoService {
async addToken(token) {
return this._request('/v1/admin/tokens', 'POST', { token });
}
async addTokensBatch(tokens) {
return this._request('/v1/admin/tokens/batch', 'POST', { tokens });
}
}
// 注册成功后自动同步
await this.saveToken(token);
if (config.deno.enabled && config.deno.autoSync) {
await denoService.addToken(token);
}async function runParallel(count, concurrent) {
const queue = [...]; // 任务队列
const runNext = async () => {
if (queue.length === 0) return null;
const task = queue.shift();
await runRegistration(task);
return runNext();
};
// 启动 N 个并发 worker
const workers = Array(concurrent).fill(null).map(() => runNext());
await Promise.all(workers);
}async function runPool() {
while (true) {
// 执行一轮注册
await runParallel(config.pool.accountsPerRound, config.pool.concurrent);
// 批量同步到 Deno
if (config.deno.enabled && stats.tokens.length > 0) {
await denoService.addTokensBatch(stats.tokens);
}
// 等待下一轮
await wait(config.pool.intervalMinutes * 60 * 1000);
}
}- Node.js ≥ 16.0.0
- npm 或 yarn
- Linux/macOS/Windows (WSL)
- 有效的 IMAP 邮箱(用于接收验证码)
# 克隆项目
git clone https://github.com/chanhanzhan/flowith2pool.git
cd flowith-automation
# 安装依赖
npm install
# 复制配置模板
cp config.example.js config.js
# 编辑配置文件
nano config.js编辑 config.js 文件,填写必要信息:
module.exports = {
// 注册信息
registrationUrl: 'https://flowith.io?inv=YOUR_INVITATION_CODE',
invitationCode: 'YOUR_INVITATION_CODE',
emailDomain: '@mail.com',
password: 'your_password',
// IMAP邮箱(用于接收验证码)
imap: {
user: '[email protected]',
password: 'your_password',
host: 'imap.exmail.qq.com',
port: 993,
tls: true
}
};# 查看帮助
node main.js help
# 单个注册(测试)
node main.js start
# 批量注册10个
node main.js batch 10
# 并行注册50个(5线程)
node main.js parallel 50 5适合开发测试和小规模使用。
# 前台运行
node main.js start
# 后台运行(使用 nohup)
nohup node main.js pool > output.log 2>&1 &适合服务器长期运行。
# 创建新 screen 会话
screen -S flowith
# 运行程序
node main.js pool
# 分离会话(按 Ctrl+A+D)
# 恢复会话
screen -r flowith
# 查看所有会话
screen -ls
# 结束会话
screen -X -S flowith quit# 安装 PM2
npm install -g pm2
# 启动应用
pm2 start main.js --name flowith-pool -- pool
# 查看状态
pm2 status
# 查看日志
pm2 logs flowith-pool
# 重启
pm2 restart flowith-pool
# 停止
pm2 stop flowith-pool
# 开机自启
pm2 startup
pm2 savePM2 配置文件 (ecosystem.config.js):
module.exports = {
apps: [{
name: 'flowith-pool',
script: 'main.js',
args: 'pool',
instances: 1,
autorestart: true,
watch: false,
max_memory_restart: '1G',
env: {
NODE_ENV: 'production'
}
}]
};
// 启动: pm2 start ecosystem.config.js适合容器化部署。
Dockerfile:
FROM node:18-slim
# 安装必要的依赖
RUN apt-get update && apt-get install -y \
chromium \
fonts-liberation \
libappindicator3-1 \
libasound2 \
libatk-bridge2.0-0 \
libatk1.0-0 \
libcups2 \
libdbus-1-3 \
libgdk-pixbuf2.0-0 \
libnspr4 \
libnss3 \
libx11-xcb1 \
libxcomposite1 \
libxdamage1 \
libxrandr2 \
xdg-utils \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# 复制依赖文件
COPY package*.json ./
RUN npm install
# 复制源代码
COPY . .
# 设置 Chromium 路径
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium
# 启动应用
CMD ["node", "main.js", "pool"]docker-compose.yml:
version: '3.8'
services:
flowith-automation:
build: .
container_name: flowith-pool
restart: always
environment:
- NODE_ENV=production
- HEADLESS=true
volumes:
- ./data:/app/data
- ./config.js:/app/config.js
networks:
- flowith-network
# 可选:同时部署 Deno 服务
deno-service:
image: denoland/deno:latest
container_name: flowith-deno
restart: always
ports:
- "8787:8787"
command: run --allow-net --allow-env main.ts
working_dir: /app
volumes:
- ./deno:/app
networks:
- flowith-network
networks:
flowith-network:
driver: bridge运行:
# 构建并启动
docker-compose up -d
# 查看日志
docker-compose logs -f flowith-automation
# 停止
docker-compose down适合 Linux 服务器,开机自启。
创建服务文件 /etc/systemd/system/flowith-pool.service:
[Unit]
Description=Flowith Automation Pool Service
After=network.target
Documentation=https://github.com/your-repo/flowith-automation
[Service]
Type=simple
User=youruser
Group=yourgroup
WorkingDirectory=/home/youruser/flowith-automation
Environment="NODE_ENV=production"
Environment="PATH=/usr/bin:/usr/local/bin"
ExecStart=/usr/bin/node /home/youruser/flowith-automation/main.js pool
Restart=always
RestartSec=10
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=flowith-pool
# 安全设置
NoNewPrivileges=true
PrivateTmp=true
ProtectSystem=strict
ProtectHome=true
ReadWritePaths=/home/youruser/flowith-automation/data
[Install]
WantedBy=multi-user.target管理服务:
# 重载 systemd 配置
sudo systemctl daemon-reload
# 启动服务
sudo systemctl start flowith-pool
# 查看状态
sudo systemctl status flowith-pool
# 查看日志
sudo journalctl -u flowith-pool -f
# 开机自启
sudo systemctl enable flowith-pool
# 停止服务
sudo systemctl stop flowith-pool
# 重启服务
sudo systemctl restart flowith-pool适合定时批量注册。
# 编辑 crontab
crontab -e
# 添加定时任务
# 每天凌晨2点注册10个账号
0 2 * * * cd /home/youruser/flowith-automation && /usr/bin/node main.js batch 10 >> /var/log/flowith-cron.log 2>&1
# 每小时注册5个账号
0 * * * * cd /home/youruser/flowith-automation && /usr/bin/node main.js start 5 >> /var/log/flowith-cron.log 2>&1
# 每6小时注册20个账号(并行)
0 */6 * * * cd /home/youruser/flowith-automation && /usr/bin/node main.js parallel 20 3 >> /var/log/flowith-cron.log 2>&1module.exports = {
// ============ 注册信息 ============
registrationUrl: 'https://flowith.io?inv=YOUR_CODE',
invitationCode: 'YOUR_CODE',
emailDomain: '@7725.pp.ua',
password: 'your_password',
// ============ API端点 ============
settingsUrl: 'https://flowith.io/setting',
apiKeysEndpoint: 'https://edge.flowith.net/external/account/api-keys',
// ============ IMAP邮箱 ============
imap: {
user: '[email protected]',
password: 'your_password',
host: 'imap.exmail.qq.com',
port: 993,
tls: true
},
// ============ 浏览器配置 ============
browser: {
headless: false, // 生产环境建议 true
disableXvfb: false,
width: 1280,
height: 800
},
// ============ 日志配置 ============
logging: {
level: 'minimal', // verbose | minimal | silent
saveToFile: false,
logFile: './data/automation.log'
},
// ============ 批量注册 ============
batch: {
defaultCount: 50,
concurrent: 3, // 并发线程数
delayBetweenRuns: 5000,
maxRetries: 2
},
// ============ 号池模式 ============
pool: {
enabled: false,
intervalMinutes: 30, // 间隔时间
accountsPerRound: 5, // 每轮数量
concurrent: 2,
autoAddToDeno: true
},
// ============ Deno集成 ============
deno: {
enabled: false,
url: 'http://localhost:8787',
adminKey: '', // 管理员密钥
autoSync: true,
batchAdd: true
},
// ============ 超时配置 ============
timeouts: {
pageLoad: 60000,
emailVerification: 120000,
elementWait: 20000,
cloudflareWait: 3000
}
};可以通过环境变量覆盖部分配置:
# 无头模式
HEADLESS=true node main.js pool
# Deno URL
DENO_URL=http://192.168.1.100:8787 node main.js start
# 日志级别
LOG_LEVEL=verbose node main.js batch 10node main.js start输出:
============================================================
🚀 Single Registration Mode
============================================================
🚀 Launching real browser with maximum stealth...
✓ Real browser launched successfully with full stealth
📄 Navigating to https://flowith.io?inv=MRCTQB2692XA1PU2
✓ Page loaded
✓ Registration page ready
📧 Generated email: [email protected]
✅ Filled invitation code
✅ Filled email
✅ Filled password
✅ Filled confirm password
🔒 Handling Cloudflare verification...
✅✅✅ Cloudflare verification completed successfully!
⏳ Waiting for Cloudflare verification to complete...
📤 Submitting registration form...
✓ Registration submitted!
📬 Retrieving verification code from email...
⏳ Waiting 15 seconds for new email to arrive...
✓ Connected to IMAP server
✓ Retrieved verification code: 123456
🔢 Filling verification code: 123456
✓ Verification code filled
✅ Registration completed
🔧 Navigating to settings: https://flowith.io/setting
✓ Settings page loaded
🔑 Looking for API Keys menu...
✓ Found API Keys menu: "API 密钥"
✓ Clicked API Keys menu
➕ Looking for Create button...
✓ Found Create button: "创建"
✓ Clicked Create button
✅ API key creation initiated on page
🔍 Fetching API token via authenticated request...
✅ API response received
✓ Token extracted from API: flo_1234567890abcdef...
✅ Token saved: flo_1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef
🎉 Automation completed successfully!
📧 Email: [email protected]
🔑 Token: flo_1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef
============================================================
node main.js batch 5输出:
============================================================
🚀 Batch Registration Mode
📊 Target: 5 accounts
⏱️ Delay: 5000ms between runs
============================================================
[1/5] Starting registration...
🎉 Automation completed successfully!
📧 Email: [email protected]
🔑 Token: flo_abc...
✅ [1/5] Success! (Total: 1)
⏳ Waiting 5s before next registration...
[2/5] Starting registration...
🎉 Automation completed successfully!
📧 Email: [email protected]
🔑 Token: flo_def...
✅ [2/5] Success! (Total: 2)
...
============================================================
📊 Registration Summary
============================================================
✅ Successful: 5/5 (100.0%)
❌ Failed: 0/5
⏱️ Duration: 15.3 minutes
📁 Tokens saved to: ./data/tokens.txt
============================================================
node main.js parallel 10 3输出:
============================================================
🚀 Parallel Batch Registration Mode
📊 Target: 10 accounts
🔄 Concurrent: 3 threads
============================================================
[1/10] Starting... (Running: 1)
[2/10] Starting... (Running: 2)
[3/10] Starting... (Running: 3)
✅ [1/10] Success! (Total: 1)
[4/10] Starting... (Running: 3)
✅ [2/10] Success! (Total: 2)
[5/10] Starting... (Running: 3)
✅ [3/10] Success! (Total: 3)
...
============================================================
📊 Registration Summary
============================================================
✅ Successful: 10/10 (100.0%)
❌ Failed: 0/10
⏱️ Duration: 8.5 minutes
📁 Tokens saved to: ./data/tokens.txt
============================================================
node main.js pool输出:
============================================================
🔄 Pool Mode - Continuous Registration
⏱️ Interval: 30 minutes
📊 Accounts per round: 5
🔄 Concurrent: 2
✅ Deno sync: Enabled
============================================================
============================================================
🔄 Round 1 - 2025-10-19 14:30:00
============================================================
[1/5] Starting...
[2/5] Starting...
✅ [1/5] Success! (Total: 1)
[3/5] Starting...
✅ [2/5] Success! (Total: 2)
...
🔄 Syncing 5 tokens to Deno service...
✅ Batch sync completed: 5 added, 0 skipped
⏳ Next round at 2025-10-19 15:00:00
💤 Sleeping for 30 minutes...
- 启动Deno服务(在另一个终端):
cd /path/to/deno/project
deno run --allow-net --allow-env main.ts- 获取管理员密钥:
从Deno服务的启动日志或环境变量中获取 ADMIN_KEY。
- 配置
config.js:
deno: {
enabled: true,
url: 'http://localhost:8787',
adminKey: 'your-admin-key-from-deno',
autoSync: true, // 单个同步
batchAdd: true // 批量同步(号池模式)
}Deno服务应提供以下API端点:
| 端点 | 方法 | 说明 |
|---|---|---|
/v1/status |
GET | 获取服务状态和token列表 |
/v1/admin/tokens |
POST | 添加单个token |
/v1/admin/tokens/batch |
POST | 批量添加token |
# 查看Deno服务状态
curl http://localhost:8787/v1/status
# 手动添加token
curl -X POST http://localhost:8787/v1/admin/tokens \
-H "Authorization: Bearer YOUR_ADMIN_KEY" \
-H "Content-Type: application/json" \
-d '{"token": "flo_..."}'
# 批量添加token
curl -X POST http://localhost:8787/v1/admin/tokens/batch \
-H "Authorization: Bearer YOUR_ADMIN_KEY" \
-H "Content-Type: application/json" \
-d '{"tokens": ["flo_1...", "flo_2..."]}'┌─────────────────────────────────────────────────────────┐
│ Flowith Automation │
│ (Node.js) │
└─────────────────────────────────────────────────────────┘
│
┌───────────────────┼───────────────────┐
│ │ │
┌───────▼────────┐ ┌──────▼──────┐ ┌────────▼────────┐
│ Browser │ │ IMAP │ │ Deno Service │
│ Automation │ │ Client │ │ Integration │
│ (Puppeteer) │ │ (Email) │ │ (HTTP API) │
└────────┬───────┘ └──────┬──────┘ └────────┬─────────┘
│ │ │
▼ ▼ ▼
┌─────────────────────────────────────────────────────────┐
│ Flowith.io Website │
└─────────────────────────────────────────────────────────┘
flowith-automation/
├── main.js # 主程序 + CLI入口
├── config.js # 配置文件
├── package.json # 依赖管理
│
├── src/ # 源代码目录
│ ├── emailGenerator.js # 邮箱生成器
│ ├── smtpClient.js # IMAP邮件客户端
│ ├── logger.js # 日志工具
│ └── humanBehaviorPuppeteer.js # 人类行为模拟
│
└── data/ # 数据目录
├── tokens.txt # 生成的token列表
└── automation.log # 日志文件(可选)
1. 初始化浏览器
└─> puppeteer-real-browser (反检测)
2. 导航到注册页面
└─> 检测页面类型(登录/注册)
└─> 自动切换到注册表单
3. 填写注册表单
├─> 邀请码
├─> 邮箱(随机生成)
├─> 密码
└─> 确认密码
4. 处理Cloudflare验证
└─> 自动检测并点击验证框
5. 提交注册
└─> 等待验证通过
6. 获取邮箱验证码
├─> 连接IMAP服务器
├─> 监听新邮件
└─> 解析验证码
7. 填写验证码
└─> 完成注册
8. 创建API密钥
├─> 导航到设置页面
├─> 点击"API密钥"菜单
└─> 点击"创建"按钮
9. 获取Token
├─> 从localStorage获取auth token
├─> 调用API获取密钥列表
└─> 提取最新的token
10. 保存并同步
├─> 保存到本地文件
└─> 同步到Deno服务(可选)
症状:
- 注册按钮一直禁用
- 等待超时后报错
原因:
- IP被Cloudflare标记
- 并发过高触发限制
- 浏览器特征被检测
解决方案:
// config.js
batch: {
concurrent: 2, // 降低并发数
delayBetweenRuns: 10000 // 增加延迟到10秒
},
browser: {
headless: false // 使用非无头模式
}或者:
- 更换IP地址
- 使用代理服务器
- 增加
timeouts.cloudflareWait
症状:
- 等待验证码超时
- IMAP连接失败
原因:
- IMAP配置错误
- 邮件转发未设置
- 邮件进入垃圾箱
解决方案:
- 验证IMAP配置:
# 使用telnet测试连接
openssl s_client -connect imap.exmail.qq.com:993-
检查Cloudflare Email Routing设置
-
查看邮箱垃圾邮件文件夹
-
增加超时时间:
timeouts: {
emailVerification: 180000 // 增加到3分钟
}症状:
- 注册成功但未同步到Deno
- 提示连接错误
原因:
- Deno服务未运行
- adminKey错误
- 网络不通
解决方案:
- 检查Deno服务状态:
curl http://localhost:8787/v1/status- 验证adminKey:
curl -H "Authorization: Bearer YOUR_KEY" \
http://localhost:8787/v1/status- 手动同步token:
# 读取本地tokens
cat data/tokens.txt
# 批量导入
curl -X POST http://localhost:8787/v1/admin/tokens/batch \
-H "Authorization: Bearer YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"tokens": ["token1", "token2"]}'症状:
- 提示找不到Chromium
- 启动超时
解决方案:
Linux:
# 安装依赖
sudo apt-get install -y chromium-browserDocker:
RUN apt-get update && apt-get install -y \
chromium \
fonts-liberation \
libappindicator3-1症状:
- 程序崩溃
- 浏览器无响应
解决方案:
- 降低并发数
- 使用无头模式
- 增加系统内存
- 使用PM2限制内存:
pm2 start main.js --max-memory-restart 1G{
browser: { headless: false },
logging: { level: 'verbose' },
batch: { concurrent: 1, delayBetweenRuns: 3000 }
}{
browser: { headless: true },
logging: { level: 'minimal', saveToFile: false },
batch: { concurrent: 2, delayBetweenRuns: 10000 },
pool: { intervalMinutes: 60, accountsPerRound: 3 }
}{
browser: { headless: true },
logging: { level: 'silent' },
batch: { concurrent: 5, delayBetweenRuns: 3000 }
}| 模式 | 并发数 | 账号数 | 预计时间 | 成功率 |
|---|---|---|---|---|
| 单个 | 1 | 1 | 3-5分钟 | 95%+ |
| 批量 | 1 | 10 | 40-50分钟 | 90%+ |
| 并行 | 3 | 30 | 35-40分钟 | 85%+ |
| 并行 | 5 | 50 | 45-55分钟 | 80%+ |
| 号池 | 2 | 5/轮 | 持续运行 | 90%+ |
-
合理设置并发数
- 本地网络:2-3个
- 服务器/VPS:3-5个
- 云服务器(好IP):5-10个
-
使用无头模式
- 节省30-50%内存
- 提升10-20%速度
-
关闭日志文件
- 减少磁盘I/O
- 提升整体性能
-
定期清理数据
# 定时清理截图和日志
0 0 * * * rm -f /path/to/flowith/data/*.png# 查看帮助
node main.js help
# 单个注册
node main.js start
# 批量注册(指定数量)
node main.js start 10
node main.js batch 20
# 并行注册(指定数量和线程)
node main.js parallel 50 5
node main.js parallel 100 10
# 号池模式
node main.js poolnpm start # 单个注册
npm run batch # 批量注册(默认50个)
npm run batch:5 # 批量注册5个
npm run batch:10 # 批量注册10个
npm run batch:20 # 批量注册20个
npm run batch:50 # 批量注册50个
npm run parallel # 并行注册(默认50个)
npm run parallel:10 # 并行注册10个(3线程)
npm run parallel:20 # 并行注册20个(5线程)
npm run parallel:50 # 并行注册50个(5线程)
npm run parallel:100 # 并行注册100个(10线程)
npm run pool # 号池模式
npm run help # 帮助信息
npm run clean # 清理数据文件
npm run tokens # 查看tokens
npm run count # 统计token数量MIT License
本工具仅供学习和研究使用。请遵守 Flowith.io 的服务条款,不要滥用此工具。使用本工具所产生的一切后果由使用者自行承担。
欢迎提交 Issue 和 Pull Request!
如有问题,请提交 Issue 或联系维护者。
Happy Automating! 🚀