Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let fetch = require('node-fetch')
- let config = {
- headers: {
- 'Accept': '*',
- 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
- }
- }
- function numbFormat(int) {
- return Number(parseInt(int)).toLocaleString().replace(',', '.')
- }
- function analyze(url) {
- return new Promise(async(resolve, reject) => {
- let form = new URLSearchParams()
- form.append('url', url)
- let json = await (await fetch('https://api.tikmate.app/api/lookup', { method: 'POST', body: form, ...config })).json()
- if (!json.success) return resolve({ creator: '@neoxrs – Wildan Izzudin', status: false })
- let postInfo = {
- author: json.author_name + ' (@' + json.author_id + ')',
- publish: json.create_time,
- likes: numbFormat(json.like_count),
- comments: numbFormat(json.comment_count),
- shares: numbFormat(json.share_count),
- }
- let urlList = {
- videoSD: 'https://tikmate.app/download/' + json.token + '/' + json.id + '.mp4',
- videoHD: 'https://tikmate.app/download/' + json.token + '/' + json.id + '.mp4?hd=1'
- }; resolve({ creator: '@neoxrs – Wildan Izzudin', status: true, ...postInfo, data: urlList })
- })
- }
- analyze('https://vt.tiktok.com/ZSe2F5rTC/').then(res => console.log(res))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement