fent / node-ytdl-core

YouTube video downloader in javascript.
MIT License
4.54k stars 804 forks source link

Question #1266

Open Nodalailama opened 11 months ago

Nodalailama commented 11 months ago

Hi,

I just want to get the downloadable url of a video, how can I simply do this ? Sorry, I am not super confortable with js.

Thanks in advance, even if it may be a newbie question.

Best regards,

TheMineWay commented 6 months ago

Hi! I guess you are asking for the code you have to write to download a video.

I am using this code:

const ytdl = require('ytdl-core');

const vid = await ytdl(
  'https://www.youtube.com/watch?v=q0GCdwpdXzQ&ab_channel=LASS-Studios',
  { filter: (format) => format.container === 'mp4' },
);
vid.pipe(fs.createWriteStream('/downloads/test.mp4'));