Path: blob/master/node_modules/@bochilteam/scraper/lib/cjs/social-media/aiovideodl.js
1126 views
"use strict";1var __importDefault = (this && this.__importDefault) || function (mod) {2return (mod && mod.__esModule) ? mod : { "default": mod };3};4Object.defineProperty(exports, "__esModule", { value: true });5const got_1 = __importDefault(require("got"));6const cheerio_1 = require("cheerio");7async function aiovideodl(url) {8var _a;9const resToken = await (0, got_1.default)('https://aiovideodl.ml/');10const cookie = (_a = resToken.headers['set-cookie']) === null || _a === void 0 ? void 0 : _a.map(v => v.split(';')[0]).join('; ').trim();11const $$ = (0, cheerio_1.load)(resToken.body);12const token = $$('#token').val();13const body = new URLSearchParams();14body.append('url', url);15body.append('token', token);16return await (0, got_1.default)('https://aiovideodl.ml/wp-json/aio-dl/video-data/', {17method: 'post',18headers: {19'content-type': 'application/x-www-form-urlencoded',20cookie: cookie || 'pll_language=en; _ga=GA1.2.946338805.1646539824; PHPSESSID=f5ec5a6eb553bf3a55508ad4ce2ed200; _gid=GA1.2.425279475.1647856193; _gat_gtag_UA_46116261_21=1',21origin: 'https://aiovideodl.ml',22referer: 'https://aiovideodl.ml/',23'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.74 Safari/537.36'24},25body: body.toString()26}).json();27}28exports.default = aiovideodl;29//# sourceMappingURL=aiovideodl.js.map3031