| const axios = require('axios'); | |
| async function likee(url) { | |
| try { | |
| const apiResponse = await axios.post( | |
| 'https://steptodown.com/wp-json/aio-dl/video-data/', | |
| { url: url }, | |
| { | |
| headers: { | |
| 'Content-Type': 'application/json', | |
| 'Origin': 'https://steptodown.com', | |
| 'Referer': 'https://steptodown.com/', | |
| 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36', | |
| 'Accept': 'application/json, text/plain, */*', | |
| 'Accept-Language': 'en-US,en;q=0.9', | |
| 'Sec-Fetch-Dest': 'empty', | |
| 'Sec-Fetch-Mode': 'cors', | |
| 'Sec-Fetch-Site': 'same-origin' | |
| }, | |
| timeout: 15000 | |
| } | |
| ); | |
| const apiData = apiResponse.data; | |
| return { | |
| url: apiData.url || url, | |
| title: apiData.title || null, | |
| thumbnail: apiData.thumbnail || null, | |
| duration: apiData.duration || null, | |
| source: apiData.source || 'likee', | |
| medias: apiData.medias || [], | |
| sid: apiData.sid || null | |
| }; | |
| } catch (error) { | |
| throw new Error(error.message); | |
| } | |
| } | |
| const handler = async (req, res) => { | |
| try { | |
| const { url } = req.query; | |
| if (!url) { | |
| return res.status(400).json({ | |
| author: 'Herza', | |
| success: false, | |
| error: 'Missing required parameter: url', | |
| message: 'Please provide a Likee video URL' | |
| }); | |
| } | |
| if (!url.includes('likee.video') && !url.includes('likee.com')) { | |
| return res.status(400).json({ | |
| author: 'Herza', | |
| success: false, | |
| error: 'Invalid URL', | |
| message: 'Please provide a valid Likee video URL' | |
| }); | |
| } | |
| const result = await likee(url); | |
| res.json({ | |
| author: 'Herza', | |
| success: true, | |
| data: result | |
| }); | |
| } catch (error) { | |
| res.status(500).json({ | |
| author: 'Herza', | |
| success: false, | |
| error: error.message | |
| }); | |
| } | |
| }; | |
| module.exports = { | |
| name: 'Likee Downloader', | |
| description: 'Download Likee videos without watermark using steptodown API', | |
| type: 'GET', | |
| routes: ['api/download/likee'], | |
| tags: ['tools', 'likee', 'downloader', 'social-media'], | |
| main: ['Downloader'], | |
| parameters: ['url', 'key'], | |
| enabled: true, | |
| handler | |
| }; |