Spaces:
Runtime error
Runtime error
Update app.js
Browse files
app.js
CHANGED
|
@@ -11,7 +11,7 @@ puppeteer.use(StealthPlugin());
|
|
| 11 |
const wait = (ms) => new Promise(resolve => setTimeout(resolve, ms));
|
| 12 |
|
| 13 |
// Random delay to appear more human-like
|
| 14 |
-
const randomWait = (min, max) => wait(Math.floor(Math.random() * (max - min + 1)) + min)
|
| 15 |
|
| 16 |
// Function to upload image to catbox.moe
|
| 17 |
async function uploadToCatbox(filePath) {
|
|
@@ -267,7 +267,7 @@ function loadCookies(cookieFilePath) {
|
|
| 267 |
// Take initial screenshot
|
| 268 |
console.log('\n๐ธ Taking initial screenshot...');
|
| 269 |
await page.screenshot({
|
| 270 |
-
path: '/
|
| 271 |
fullPage: true
|
| 272 |
});
|
| 273 |
|
|
@@ -337,7 +337,7 @@ function loadCookies(cookieFilePath) {
|
|
| 337 |
|
| 338 |
console.log('\n๐ธ Taking final screenshot...');
|
| 339 |
await page.screenshot({
|
| 340 |
-
path: '/
|
| 341 |
fullPage: true
|
| 342 |
});
|
| 343 |
console.log('โ Screenshot saved to betking-final.png');
|
|
@@ -345,7 +345,7 @@ function loadCookies(cookieFilePath) {
|
|
| 345 |
// Upload screenshot to catbox
|
| 346 |
console.log('\n๐ค Uploading screenshot to Catbox...');
|
| 347 |
try {
|
| 348 |
-
const catboxUrl = await uploadToCatbox('/
|
| 349 |
console.log('โ Upload successful!');
|
| 350 |
console.log('\n๐ Download link:');
|
| 351 |
console.log(catboxUrl);
|
|
@@ -353,7 +353,7 @@ function loadCookies(cookieFilePath) {
|
|
| 353 |
console.log(catboxUrl);
|
| 354 |
} catch (uploadError) {
|
| 355 |
console.error('โ Failed to upload to Catbox:', uploadError.message);
|
| 356 |
-
console.log('Screenshot is still saved locally at: /
|
| 357 |
}
|
| 358 |
|
| 359 |
} catch (error) {
|
|
@@ -362,7 +362,7 @@ function loadCookies(cookieFilePath) {
|
|
| 362 |
|
| 363 |
try {
|
| 364 |
await page.screenshot({
|
| 365 |
-
path: '/
|
| 366 |
fullPage: true
|
| 367 |
});
|
| 368 |
console.log('Error screenshot saved to betking-error.png');
|
|
|
|
| 11 |
const wait = (ms) => new Promise(resolve => setTimeout(resolve, ms));
|
| 12 |
|
| 13 |
// Random delay to appear more human-like
|
| 14 |
+
const randomWait = (min, max) => wait(Math.floor(Math.random() * (max - min + 1)) + min);
|
| 15 |
|
| 16 |
// Function to upload image to catbox.moe
|
| 17 |
async function uploadToCatbox(filePath) {
|
|
|
|
| 267 |
// Take initial screenshot
|
| 268 |
console.log('\n๐ธ Taking initial screenshot...');
|
| 269 |
await page.screenshot({
|
| 270 |
+
path: './betking-initial.png',
|
| 271 |
fullPage: true
|
| 272 |
});
|
| 273 |
|
|
|
|
| 337 |
|
| 338 |
console.log('\n๐ธ Taking final screenshot...');
|
| 339 |
await page.screenshot({
|
| 340 |
+
path: './betking-final.png',
|
| 341 |
fullPage: true
|
| 342 |
});
|
| 343 |
console.log('โ Screenshot saved to betking-final.png');
|
|
|
|
| 345 |
// Upload screenshot to catbox
|
| 346 |
console.log('\n๐ค Uploading screenshot to Catbox...');
|
| 347 |
try {
|
| 348 |
+
const catboxUrl = await uploadToCatbox('./betking-final.png');
|
| 349 |
console.log('โ Upload successful!');
|
| 350 |
console.log('\n๐ Download link:');
|
| 351 |
console.log(catboxUrl);
|
|
|
|
| 353 |
console.log(catboxUrl);
|
| 354 |
} catch (uploadError) {
|
| 355 |
console.error('โ Failed to upload to Catbox:', uploadError.message);
|
| 356 |
+
console.log('Screenshot is still saved locally at: ./betking-final.png');
|
| 357 |
}
|
| 358 |
|
| 359 |
} catch (error) {
|
|
|
|
| 362 |
|
| 363 |
try {
|
| 364 |
await page.screenshot({
|
| 365 |
+
path: './betking-error.png',
|
| 366 |
fullPage: true
|
| 367 |
});
|
| 368 |
console.log('Error screenshot saved to betking-error.png');
|