Request Anti-Captcha / Alarm Captcha L2 Adrenaline
-
Posts
-
Чтобы скачать файлы с сайта Akumu, вы можете использовать этот код на Node.js. Понадобятся два пакета: axios и cheerio. это медленно, но делает свою работу P.S. пропускает файл, если он присутствует и не изменен const axios = require("axios"); const cheerio = require("cheerio"); const fs = require("fs/promises"); const path = require("path"); const BASE_URL = "http://akumu.ru/lineage2/L2NA/P746/"; const OUTPUT_DIR = "./downloaded"; async function delay(ms) { return new Promise((res) => setTimeout(res, ms)); } async function downloadFile(url, filepath) { // Skip download if file already exists and was not modified today try { const stat = await fs.stat(filepath); const mtime = stat.mtime; const today = new Date(); if ( mtime.getFullYear() === today.getFullYear() && mtime.getMonth() === today.getMonth() && mtime.getDate() === today.getDate() ) { // File was modified today, do not skip } else { console.log(`File exists, skipping: ${filepath}`); return false; // Indicate skipped } } catch (e) { // File does not exist, proceed to download } const writer = await fs.open(filepath, "w"); const response = await axios({ url, method: "GET", responseType: "stream" }); const totalLength = parseInt(response.headers['content-length'], 10); let downloadedLength = 0; let lastLogged = Date.now(); let lastDownloaded = 0; const lastModified = response.headers["last-modified"]; const mtime = lastModified ? new Date(lastModified) : new Date(); return new Promise((resolve, reject) => { const stream = writer.createWriteStream(); response.data.on('data', (chunk) => { downloadedLength += chunk.length; const now = Date.now(); if (now - lastLogged > 1000 || downloadedLength === totalLength) { const percent = totalLength ? ((downloadedLength / totalLength) * 100).toFixed(2) : 'N/A'; const speed = ((downloadedLength - lastDownloaded) / ((now - lastLogged) / 1000)) / 1024; // KB/s process.stdout.write(`\rDownloading ${path.basename(filepath)}: ${percent}% (${(downloadedLength/1024).toFixed(1)} KB/${totalLength ? (totalLength/1024).toFixed(1) : '?'} KB) ${(speed).toFixed(1)} KB/s `); lastLogged = now; lastDownloaded = downloadedLength; } }); response.data.pipe(stream); response.data.on("end", async () => { await writer.close(); process.stdout.write("\n"); // Set mtime and atime try { await fs.utimes(filepath, mtime, mtime); } catch (e) { console.warn( `Failed to set file timestamp for ${filepath}:`, e.message ); } resolve(true); // Indicate downloaded }); response.data.on("error", async (err) => { await writer.close(); reject(err); }); }); } async function crawlAndDownload(url, localPath) { console.log("Visiting:", url); // Ensure local path exists await fs.mkdir(localPath, { recursive: true }); const { data } = await axios.get(url); const $ = cheerio.load(data); const links = $("tbody a") .toArray() .map((el) => $(el).attr("href")) .filter((href) => href && href !== "../"); for (const href of links) { const fullUrl = new URL(href, url).href; const decodedHref = decodeURIComponent(href); const targetPath = path.join(localPath, decodedHref); if (href.endsWith("/")) { // It's a folder, recurse normally await crawlAndDownload(fullUrl, targetPath); } else { // It's a file, retry download indefinitely on failure while (true) { try { console.log("Downloading file:", fullUrl); const downloaded = await downloadFile(fullUrl, targetPath); if (downloaded) { await delay(1000); // Delay only if file was downloaded } break; // Success or skipped, exit retry loop } catch (err) { console.error( `Failed to download ${fullUrl}, retrying... Error: ${err.message}` ); // Optionally wait before retrying to be gentle on server await delay(3000); } } } } } crawlAndDownload(BASE_URL, OUTPUT_DIR) .then(() => console.log("Done!")) .catch((err) => console.error("Error:", err));
-
By Meissgenry · Posted
I ran into the same problem and tried a few workarounds, but what finally made things smooth for me was to Buy Static Residential Proxies. They gave me consistent IPs that didn’t rotate or get flagged, which helped with stability and avoided unnecessary disconnects. Way better than messing with too many free tools that just don’t hold up over time. -
Special offer each product only 120 euros
-
➡ Discount for your purchase: JUNE2025 (10% discount) ➡ Our Online Shop: https://socnet.store ➡ Our SMM-Boosting Panel: https://socnet.pro ➡ Telegram Shop Bot: https://socnet.shop ➡ Telegram Support: https://t.me/solomon_bog ➡ Telegram Channel: https://t.me/accsforyou_shop ➡ Discord Support: @AllSocialNetworksShop ➡ Discord Server: https://discord.gg/y9AStFFsrh ➡ WhatsApp Support: https://wa.me/79051904467 ➡ WhatsApp Channel: https://whatsapp.com/channel/0029Vau0CMX002TGkD4uHa2n ➡ Email Support: solomonbog@socnet.store
-
-
Topics
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.