Update plugins/cloudflare-bypass.js
Browse files- plugins/cloudflare-bypass.js +15 -27
plugins/cloudflare-bypass.js
CHANGED
|
@@ -25,37 +25,25 @@ async function callBypassAPI(url, sitekey) {
|
|
| 25 |
|
| 26 |
await new Promise(resolve => setTimeout(resolve, 5000));
|
| 27 |
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
headers: {
|
| 35 |
-
'Accept': 'application/json'
|
| 36 |
-
}
|
| 37 |
-
});
|
| 38 |
-
|
| 39 |
-
const resultData = resultResponse.data;
|
| 40 |
-
|
| 41 |
-
if (resultData.value) {
|
| 42 |
-
return {
|
| 43 |
-
token: resultData.value,
|
| 44 |
-
solved_time: resultData.elapsed_time
|
| 45 |
-
};
|
| 46 |
-
}
|
| 47 |
-
|
| 48 |
-
} catch (error) {
|
| 49 |
-
if (error.response && error.response.status !== 404) {
|
| 50 |
-
console.error(error.message);
|
| 51 |
-
}
|
| 52 |
}
|
|
|
|
|
|
|
|
|
|
| 53 |
|
| 54 |
-
|
| 55 |
-
|
|
|
|
|
|
|
|
|
|
| 56 |
}
|
| 57 |
|
| 58 |
-
throw new Error('
|
| 59 |
|
| 60 |
} catch (error) {
|
| 61 |
throw error;
|
|
|
|
| 25 |
|
| 26 |
await new Promise(resolve => setTimeout(resolve, 5000));
|
| 27 |
|
| 28 |
+
const resultResponse = await axios.get(`${BASE_URL}/result`, {
|
| 29 |
+
params: {
|
| 30 |
+
id: taskId
|
| 31 |
+
},
|
| 32 |
+
headers: {
|
| 33 |
+
'Accept': 'application/json'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
}
|
| 35 |
+
});
|
| 36 |
+
|
| 37 |
+
const resultData = resultResponse.data;
|
| 38 |
|
| 39 |
+
if (resultData.value) {
|
| 40 |
+
return {
|
| 41 |
+
token: resultData.value,
|
| 42 |
+
solved_time: resultData.elapsed_time
|
| 43 |
+
};
|
| 44 |
}
|
| 45 |
|
| 46 |
+
throw new Error('Failed to get token from result');
|
| 47 |
|
| 48 |
} catch (error) {
|
| 49 |
throw error;
|