update
Browse files- index.js +17 -3
- package.json +1 -0
index.js
CHANGED
|
@@ -46,8 +46,8 @@ function writeCache(key, value) {
|
|
| 46 |
saveCache(cache);
|
| 47 |
}
|
| 48 |
|
| 49 |
-
app.use(express.json());
|
| 50 |
-
app.use(express.urlencoded({ extended: true }));
|
| 51 |
|
| 52 |
app.get("/", (req, res) => {
|
| 53 |
res.json({
|
|
@@ -140,7 +140,7 @@ app.post('/cloudflare', async (req, res) => {
|
|
| 140 |
break;
|
| 141 |
|
| 142 |
case "antibot":
|
| 143 |
-
result = await antibot();
|
| 144 |
break;
|
| 145 |
|
| 146 |
default:
|
|
@@ -156,6 +156,20 @@ app.post('/cloudflare', async (req, res) => {
|
|
| 156 |
res.status(result.code ?? 200).json(result);
|
| 157 |
});
|
| 158 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 159 |
app.use((req, res) => {
|
| 160 |
res.status(404).json({ message: 'Not Found' });
|
| 161 |
});
|
|
|
|
| 46 |
saveCache(cache);
|
| 47 |
}
|
| 48 |
|
| 49 |
+
app.use(express.json({ limit: "50mb" }));
|
| 50 |
+
app.use(express.urlencoded({ extended: true, limit: "50mb" }));
|
| 51 |
|
| 52 |
app.get("/", (req, res) => {
|
| 53 |
res.json({
|
|
|
|
| 140 |
break;
|
| 141 |
|
| 142 |
case "antibot":
|
| 143 |
+
result = await antibot(data);
|
| 144 |
break;
|
| 145 |
|
| 146 |
default:
|
|
|
|
| 156 |
res.status(result.code ?? 200).json(result);
|
| 157 |
});
|
| 158 |
|
| 159 |
+
app.post("/antibot", async (req, res) => {
|
| 160 |
+
const data = req.body;
|
| 161 |
+
|
| 162 |
+
if (!data || !data.main || !Array.isArray(data.bots))
|
| 163 |
+
return res.status(400).json({ message: "Invalid body" });
|
| 164 |
+
|
| 165 |
+
try {
|
| 166 |
+
const result = await antibot(data);
|
| 167 |
+
res.json(result);
|
| 168 |
+
} catch (err) {
|
| 169 |
+
res.status(500).json({ message: err.message });
|
| 170 |
+
}
|
| 171 |
+
});
|
| 172 |
+
|
| 173 |
app.use((req, res) => {
|
| 174 |
res.status(404).json({ message: 'Not Found' });
|
| 175 |
});
|
package.json
CHANGED
|
@@ -9,6 +9,7 @@
|
|
| 9 |
"dependencies": {
|
| 10 |
"express": "^5.1.0",
|
| 11 |
"puppeteer-real-browser": "^1.4.0",
|
|
|
|
| 12 |
"tesseract.js": "^5.0.3",
|
| 13 |
"jimp": "^0.22.10"
|
| 14 |
},
|
|
|
|
| 9 |
"dependencies": {
|
| 10 |
"express": "^5.1.0",
|
| 11 |
"puppeteer-real-browser": "^1.4.0",
|
| 12 |
+
"axios": "1.9.0",
|
| 13 |
"tesseract.js": "^5.0.3",
|
| 14 |
"jimp": "^0.22.10"
|
| 15 |
},
|