Update index.js
Browse files
index.js
CHANGED
@@ -43,8 +43,7 @@ app.get('/', async (req, res) => {
|
|
43 |
const matchcib = htmlContent.match(regex);
|
44 |
if (matchcib) {
|
45 |
// return matchcib[0];
|
46 |
-
|
47 |
-
console.log(htmlContent);
|
48 |
// 使用正则表达式提取所有的JS文件URL
|
49 |
const allregex = /\/([a-zA-Z0-9_-]+\.br\.js)'/g
|
50 |
const matches = htmlContent.match(allregex)
|
@@ -56,14 +55,13 @@ app.get('/', async (req, res) => {
|
|
56 |
scripts += `<script src="https://sokwith-proxybing.hf.space/rp${scriptUrl}"></script>\n`
|
57 |
})
|
58 |
}
|
59 |
-
|
60 |
-
}
|
61 |
-
return '没有找到匹配的字符串';
|
62 |
-
});
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
res.send(result);
|
67 |
// 关闭浏览器
|
68 |
await browser.close();
|
69 |
|
|
|
43 |
const matchcib = htmlContent.match(regex);
|
44 |
if (matchcib) {
|
45 |
// return matchcib[0];
|
46 |
+
const cibname = matchcib[0];
|
|
|
47 |
// 使用正则表达式提取所有的JS文件URL
|
48 |
const allregex = /\/([a-zA-Z0-9_-]+\.br\.js)'/g
|
49 |
const matches = htmlContent.match(allregex)
|
|
|
55 |
scripts += `<script src="https://sokwith-proxybing.hf.space/rp${scriptUrl}"></script>\n`
|
56 |
})
|
57 |
}
|
58 |
+
return { scripts, cibname };
|
59 |
+
}
|
60 |
+
return { scripts: '没有找到匹配的字符串', cibname };
|
61 |
+
});
|
62 |
+
console.log(result.cibname); // 在此处输出 htmlContent
|
63 |
+
res.set('Content-Type', 'text/plain');
|
64 |
+
res.send(result.scripts); // 发送 scripts 的纯文本响应
|
|
|
65 |
// 关闭浏览器
|
66 |
await browser.close();
|
67 |
|