Skip to content

Commit

Permalink
chore: .
Browse files Browse the repository at this point in the history
  • Loading branch information
14790897 committed Jul 9, 2024
1 parent bce285f commit 4e53bc8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 15 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/cron_bypassCF.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,5 @@ jobs:
run: |
npm install
sudo apt install -y xvfb
- name: Start Xvfb
run: |
# 启动 Xvfb 在 Display :99
sudo Xvfb :99 &
export DISPLAY=:99
- name: Run a script
run: xvfb-run --server-args="-screen 0 1024x768x24" node bypasscf.js
run: xvfb-run --auto-servernum --server-args="-screen 0 1280x720x24" node bypasscf.js
18 changes: 9 additions & 9 deletions bypasscf.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@ async function launchBrowserForUser(username, password) {
};

// 如果环境变量不是 'dev',则添加代理配置
// if (process.env.ENVIRONMENT !== "dev") {
// browserOptions["proxy"] = {
// host: "216.98.11.172",
// port: "54651",
// username: "T5kQrKCwXZ",
// password: "jH51RWYSkr",
// };
// }
if (process.env.ENVIRONMENT !== "dev") {
browserOptions["proxy"] = {
host: "216.98.11.172",
port: "54651",
username: "T5kQrKCwXZ",
password: "jH51RWYSkr",
};
}

var { connect } = await import("puppeteer-real-browser");
const { page, browser } = await connect(
Expand Down Expand Up @@ -237,7 +237,7 @@ async function navigatePage(url, page, browser) {
pageTitle = await page.title();

// 检查是否超过15秒
if (Date.now() - startTime > 15000) {
if (Date.now() - startTime > 25000) {
console.log("Timeout exceeded, aborting actions.");
await browser.close();
return; // 超时则退出函数
Expand Down

0 comments on commit 4e53bc8

Please sign in to comment.