增加 goToVerify 函数

This commit is contained in:
Saul Hetherman
2024-10-01 23:37:39 +08:00
parent 5abc4a74e7
commit 1cf0843dee
3 changed files with 26 additions and 2 deletions

View File

@@ -44,6 +44,11 @@ class Wogg20240929 extends WebApiBase {
backData.error = pro.error;
let proData = pro.data;
this.checkVerify(webUrl, proData);
if (proData?.includes("js=slider")) {
await goToVerify(webUrl);
return JSON.stringify(backData);
}
if (proData) {
const $ = cheerio.load(proData);
let vodDetail = new VideoDetail();
@@ -121,6 +126,7 @@ class Wogg20240929 extends WebApiBase {
"---.html"
);
let repData = await req(searchUrl);
this.checkVerify(searchUrl, repData.data);
const $ = cheerio.load(repData.data);
let items = $(".module-search-item");
@@ -140,6 +146,17 @@ class Wogg20240929 extends WebApiBase {
return JSON.stringify(backData);
}
/**
* 检查是否需要验证码
* @param {string} webUrl
* @param {any} data
**/
async checkVerify(webUrl, data) {
if (typeof data === "string" && data.includes("js=slider")) {
await goToVerify(webUrl);
}
}
combineUrl(url) {
if (url === undefined) {
return "";