selfdebrid/extractors/voe.js

40 lines
937 B
JavaScript

const axios = require("axios");
const cheerio = require("cheerio");
const lib = require("../lib");
module.exports = {
get: get,
hostnames: ["voe.sx", "matriculant401merited.com"],
tests: []
};
async function get(url, options) {
lib.log(`voe`, `Fetching page...`, [], true, options);
let resp = await axios({
url: url,
headers: lib.defaultHeaders
});
lib.log(`voe`, `Parsing page...`, [], true, options);
let $ = cheerio.load(resp.data);
let script = $(".player-wrapper > div").text();
let dlLink = script.split(`var sources = `)[1].split(`;`)[0].split(`'mp4': '`)[1].split(`',`)[0];
let dlName = $(".mt-1").text();
lib.log(`voe`, `Extractor got link, downloading...`, [], true, options);
lib.log(`voe`, `Link:`, [script], false, options)
return {
axiosData: {
headers: lib.defaultHeaders,
url: dlLink
},
metadata: {
fileName: dlName
},
type: "file"
};
}