const puppeteer = require('puppeteer'); async function downloadFromTerabox() { const browser = await puppeteer.launch({ headless: false }); // headless: false => browser visible rahega const page = await browser.newPage(); // Step 1: Open Terabox Login Page await page.goto('https://1024terabox.com/login', { waitUntil: 'domcontentloaded' }); // Step 2: Login (replace with actual login credentials) await page.type('#email', 'YOUR_EMAIL'); // Your Terabox email here await page.type('#password', 'YOUR_PASSWORD'); // Your Terabox password here await page.click('.login-button'); // Button to login await page.waitForNavigation(); console.log('Logged in successfully!'); // Step 3: Go to the file share page const shareLink = 'https://1024terabox.com/s/1CExrWRgXZgHrFXNXMW72qQ?op_source=goldsharelink'; // Replace with user input link await page.goto(shareLink); // Step 4: Wait for the page to load (You might have to handle ads here) await page.waitForSelector('.download-button'); // Make sure to wait for download button // Step 5: Click the download button await page.click('.download-button'); console.log('Download started!'); // Wait until download starts (you can also use more specific events here) await page.waitForTimeout(5000); // 5 seconds wait, change as per file size console.log('Download complete (or still in progress)!'); await browser.close(); } downloadFromTerabox().catch(console.error);