Path: blob/master/node_modules/@bochilteam/scraper/lib/esm/social-media/aiovideodl.js
1126 views
import got from 'got';1import { load } from 'cheerio';2export default async function aiovideodl(url) {3var _a;4const resToken = await got('https://aiovideodl.ml/');5const cookie = (_a = resToken.headers['set-cookie']) === null || _a === void 0 ? void 0 : _a.map(v => v.split(';')[0]).join('; ').trim();6const $$ = load(resToken.body);7const token = $$('#token').val();8const body = new URLSearchParams();9body.append('url', url);10body.append('token', token);11return await got('https://aiovideodl.ml/wp-json/aio-dl/video-data/', {12method: 'post',13headers: {14'content-type': 'application/x-www-form-urlencoded',15cookie: cookie || 'pll_language=en; _ga=GA1.2.946338805.1646539824; PHPSESSID=f5ec5a6eb553bf3a55508ad4ce2ed200; _gid=GA1.2.425279475.1647856193; _gat_gtag_UA_46116261_21=1',16origin: 'https://aiovideodl.ml',17referer: 'https://aiovideodl.ml/',18'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'19},20body: body.toString()21}).json();22}23//# sourceMappingURL=aiovideodl.js.map2425