Skip to content

Instantly share code, notes, and snippets.

@ONLym22
Created December 20, 2025 18:45
Show Gist options
  • Select an option

  • Save ONLym22/77e0885affe6108138765754df71203f to your computer and use it in GitHub Desktop.

Select an option

Save ONLym22/77e0885affe6108138765754df71203f to your computer and use it in GitHub Desktop.
ONLym BOT Gist Uploaded
/*
πŸ“Œ Name : Youtube Downloader
🏷️ Type : Takut di gorenk njing
πŸ“¦ Saluran : https://whatsapp.com/channel/0029Vb4HHTJFCCoYgkMjn93K
πŸ“‘ Noted : Pikirkan secara logika, btw follow bang
πŸ”— Base Url : https://www.ytbsaver.com
πŸ‘€ Creator : Hazel
*/
const puppeteer = require('puppeteer-extra');
const StealthPlugin = require('puppeteer-extra-plugin-stealth');
puppeteer.use(StealthPlugin());
async function ytbVideoDetail(videoUrl) {
const browser = await puppeteer.launch({
headless: 'new',
args: [
'--no-sandbox',
'--disable-setuid-sandbox',
'--disable-dev-shm-usage',
'--disable-blink-features=AutomationControlled'
]
});
const page = await browser.newPage();
await page.setUserAgent(
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 ' +
'(KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36'
);
await page.setViewport({ width: 1366, height: 768 });
await page.goto('https://www.ytbsaver.com', {
waitUntil: 'networkidle2'
});
await new Promise(r => setTimeout(r, 2000));
const result = await page.evaluate(async (url) => {
const res = await fetch(
'https://api.ytbvideoly.com/api/thirdvideo/parse',
{
method: 'POST',
headers: {
'content-type': 'application/x-www-form-urlencoded'
},
body: new URLSearchParams({
url,
from: 'ytbdownload'
})
}
);
return await res.json();
}, videoUrl);
await browser.close();
if (result.errno !== 0) {
throw new Error('parse gagal');
}
const v = result.data;
return {
title: v.title,
thumbnail: v.thumbnail,
duration: v.duration,
best: {
url: v.best_down_url,
manifest: v.best_manifest_url
},
videos: v.videos || {},
audios: v.audios || {}
};
}
// USAGE
ytbVideoDetail('https://www.youtube.com/watch?v=CfdkLVxVJC0')
.then(console.log)
.catch(console.error);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment