Spaces:
Sleeping
Sleeping
Upload 2 files
Browse files
index.js
CHANGED
|
@@ -11,7 +11,7 @@ app.get('/', (req, res) => {
|
|
| 11 |
});
|
| 12 |
|
| 13 |
app.post('/solve', async (req, res) => {
|
| 14 |
-
const { url, waitForCookie } = req.body;
|
| 15 |
if (!url) {
|
| 16 |
return res.status(400).json({ error: 'URL parameter is required' });
|
| 17 |
}
|
|
|
|
| 11 |
});
|
| 12 |
|
| 13 |
app.post('/solve', async (req, res) => {
|
| 14 |
+
const { url, waitForCookie } = req.body || {};
|
| 15 |
if (!url) {
|
| 16 |
return res.status(400).json({ error: 'URL parameter is required' });
|
| 17 |
}
|
solve.js
CHANGED
|
@@ -241,7 +241,7 @@ async function solveCloudflare({ url, headless = false, proxy = null, proxyFile
|
|
| 241 |
|
| 242 |
await browser.close();
|
| 243 |
|
| 244 |
-
if (!clearance
|
| 245 |
return {
|
| 246 |
url,
|
| 247 |
success: false,
|
|
|
|
| 241 |
|
| 242 |
await browser.close();
|
| 243 |
|
| 244 |
+
if (!clearance || !targetCookieFound) {
|
| 245 |
return {
|
| 246 |
url,
|
| 247 |
success: false,
|