fix automatic login
This commit is contained in:
+1
-3
@@ -114,7 +114,6 @@ class YouProvider {
|
|||||||
createDirectoryIfNotExists(path.join(__dirname, "browser_profiles", currentUsername));
|
createDirectoryIfNotExists(path.join(__dirname, "browser_profiles", currentUsername));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await sleep(1000);
|
|
||||||
const response = await connect({
|
const response = await connect({
|
||||||
headless: "auto",
|
headless: "auto",
|
||||||
turnstile: true,
|
turnstile: true,
|
||||||
@@ -158,10 +157,9 @@ class YouProvider {
|
|||||||
session.dsr
|
session.dsr
|
||||||
));
|
));
|
||||||
await page.goto("https://you.com", {timeout: timeout});
|
await page.goto("https://you.com", {timeout: timeout});
|
||||||
|
await sleep(5000); // 等待加载完毕
|
||||||
}
|
}
|
||||||
|
|
||||||
await sleep(5000); // 等待加载完毕
|
|
||||||
|
|
||||||
// 如果遇到盾了就多等一段时间
|
// 如果遇到盾了就多等一段时间
|
||||||
const pageContent = await page.content();
|
const pageContent = await page.content();
|
||||||
if (pageContent.indexOf("https://challenges.cloudflare.com") > -1) {
|
if (pageContent.indexOf("https://challenges.cloudflare.com") > -1) {
|
||||||
|
|||||||
Reference in New Issue
Block a user