Skip to content

Commit

Permalink
feat: 可自定义验证码识别API
Browse files Browse the repository at this point in the history
Fixed #395
  • Loading branch information
shanmiteko committed Jun 13, 2024
1 parent 9f417d6 commit e723136
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion env.example.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ module.exports = Object.freeze({
* - `ACCOUNT_UA` 账号UA, 可在浏览器控制台输入 navigator.userAgent 查看
* ## 高级功能
* - `ENABLE_CHAT_CAPTCHA_OCR` 开启评论验证码识别 使用方法见README
* - `CHAT_CAPTCHA_OCR_URL` 验证码识别接口 POST `url`->`code`
* - `ENABLE_MULTIPLE_ACCOUNT` 是否启用多账号
* - `MULTIPLE_ACCOUNT_PARM` 多账号参数(JSON格式) <不推荐使用
* ## 调试相关
Expand All @@ -28,7 +29,8 @@ module.exports = Object.freeze({
CLEAR: true,
ACCOUNT_UA: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36",

ENABLE_CHAT_CAPTCHA_OCR: "",
ENABLE_CHAT_CAPTCHA_OCR: false,
CHAT_CAPTCHA_OCR_URL: "http://127.0.0.1:9898/ocr/url/text",
ENABLE_MULTIPLE_ACCOUNT: false,

MULTIPLE_ACCOUNT_PARM: "",
Expand Down
2 changes: 1 addition & 1 deletion lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ const utils = {
return new Promise((resolve) => {
send({
method: 'POST',
url: 'http://127.0.0.1:9898/ocr/url/text',
url: process.env["CHAT_CAPTCHA_OCR_URL"] || "http://127.0.0.1:9898/ocr/url/text",
headers: {
"content-type": 'application/x-www-form-urlencoded; charset=UTF-8',
},
Expand Down

0 comments on commit e723136

Please sign in to comment.