notmebotz-tools
Version:
Sebuah Tools yang berfungsi untuk mendownload Video atau Foto dari media sosial, serta sebagai tools yang berguna untuk aplikasi kamu seperti untuk BOT
38 lines (32 loc) • 1.05 kB
JavaScript
/* TIKTOK SEARCH
DONT DELETE WM
FROM https://whatsapp.com/channel/0029VaGVOvq1iUxY6WgHLv2R
PLEASE JOIN MY CHANNEL
FOLLOW MY GITHUB
https://github.com/herzonly
DONT DELETE WM PLEASE
*/
const axios = require("axios");
const FormData = require("form-data");
async function ttSearch(query, count = 50) {
try {
let d = new FormData();
d.append("keywords", query);
d.append("count", count);
d.append("cursor", 0);
d.append("web", 1);
d.append("hd", 1);
let BASE_URL = "https://tikwm.com";
let h = { headers: { ...d.getHeaders() } };
let { data } = await axios.post("https://tikwm.com/api/feed/search", d, h);
if (!data.data || !data.data.videos) return { author: "Herza", status: 200, results: [] };
return {
author: "Herza",
status: 200,
results: data.data.videos.map(video => BASE_URL + video.play)
};
} catch {
return { author: "Herza", status: 500, results: [] };
}
};
module.exports = { ttSearch }