ytdown.js
javascript•Created 29 Mar 2026, 06:25•96 views
YouTube video and short downloader.
#downloader#tools#media
javascript
0 lines
/***
@ Base: https://app.ytdown.to/
@ Author: Shannz
@ Note: YouTube video and short downloader.
***/
import axios from 'axios';
import qs from 'qs';
export async function ytdown(url) {
const data = qs.stringify({url});
const config = {
method: 'POST',
url: 'https://app.ytdown.to/proxy.php',
headers: {
'User-Agent': 'Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.0.0 Mobile Safari/537.36',
'Accept-Encoding': 'gzip, deflate, br, zstd',
'sec-ch-ua-platform': '"Android"',
'sec-ch-ua': '"Chromium";v="146", "Not-A.Brand";v="24", "Google Chrome";v="146"',
'sec-ch-ua-mobile': '?1',
'x-requested-with': 'XMLHttpRequest',
'dnt': '1',
'content-type': 'application/x-www-form-urlencoded; charset=UTF-8',
'origin': 'https://app.ytdown.to',
'sec-fetch-site': 'same-origin',
'sec-fetch-mode': 'cors',
'sec-fetch-dest': 'empty',
'referer': 'https://app.ytdown.to/id23/',
'accept-language': 'id,en-US;q=0.9,en;q=0.8,ja;q=0.7,zh-CN;q=0.6,zh;q=0.5,ms;q=0.4',
'priority': 'u=1, i'
},
data: data
};
const api = await axios.request(config);
return api.data;
}
//ytdown('https://youtu.be/X5wAHKdonLQ?si=TLPWOgeSMZRb6r09').then(a => console.log(a));