Skip to content

Commit

Permalink
fix: throw error导致无法运行
Browse files Browse the repository at this point in the history
  • Loading branch information
14790897 committed Sep 3, 2024
1 parent 6d7e287 commit 67811e3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ USERNAMES=hahaha2,hahaha1,ha1,ha2,DrKBoogieWoogie,lsp,lsb #888存在问题
PASSWORDS="BfdSGt}F4!5pLHt,BfdSGt}F4!5pLHt,iTs9Wx4+3Eavkhk,W$RhQUVn5E?BBBq,]\"w%2Qd%M8Z6-SS,HU5B6Ee]kRB%Qj',uYE)46Ej8phu$#u" # 密码外面要加上双引号,密码内部如果有双引号,需要加上转义字符 反斜杠 \
WEBSITE=https://linux.do # 需要阅读的网站,支持后面那些:https://meta.discourse.org, https://meta.appinn.net, https://community.openai.com
RUN_TIME_LIMIT_MINUTES=15 #运行时间,分钟为单位
TELEGRAM_BOT_TOKEN=yourtoken
TELEGRAM_CHAT_ID=yourid
TELEGRAM_BOT_TOKEN=
TELEGRAM_CHAT_ID=
9 changes: 5 additions & 4 deletions bypasscf.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ function delayClick(time) {
try {
if (usernames.length !== passwords.length) {
console.log(usernames.length, usernames, passwords.length, passwords);
console.log("用户名和密码的数量不匹配!");
return;
throw new error("用户名和密码的数量不匹配!");
}

// 并发启动浏览器实例进行登录
Expand All @@ -99,7 +98,7 @@ function delayClick(time) {
// 错误处理逻辑
console.error("发生错误:", error);
if (token && chatId) {
sendToTelegram(`发生错误:${error.message}`);
sendToTelegram(`${error.message}`);
}
}
})();
Expand Down Expand Up @@ -218,7 +217,9 @@ async function launchBrowserForUser(username, password) {
});
}
} catch (err) {
throw new Error(err);
// throw new Error(err);
console.log("Error:", err);
sendToTelegram(`${err.message}`);
}
}
async function login(page, username, password) {
Expand Down

0 comments on commit 67811e3

Please sign in to comment.