import axios from "axios";
import FormData from "form-data";
import * as cheerio from "cheerio";
const likeeDl = {
base: {
download: "https://getof.net/wp-json/aio-dl/video-data/",
token: "https://getof.net/en/likee-video-downloader/"
},
hash: (url, salt) => {
return btoa(url) + (url.length + 1_000) + btoa(salt);
},
token: async () => {
let { data } = await axios.get(likeeDl.base.token)
let $ = cheerio.load(data);
return $("#token").val()
},
download: async (url) => {
let hashh = await likeeDl.hash(url, "aio-dl");
let tkns = await likeeDl.token();
let d = new FormData();
d.append("url", url);
d.append("token", tkns);
d.append("hash", hashh)
let headers = {
headers: {
...d.getHeaders()
}
}
let { data: download } = await axios.post(likeeDl.base.download, d, headers)
return download
}
}
likeeDl.download("https://l.likee.video/v/6qW3uQ").then(console.log)