- Node.js installed
- yt-dlp installed (
pip install yt-dlp
) - A valid YouTube cookies file (youtube_cookies.txt) in the root directory
-
Install dependencies:
npm install
-
Create a youtube_cookies.txt file in the root directory with your YouTube cookies: https://github.com/yt-dlp/yt-dlp/wiki/FAQ#how-do-i-pass-cookies-to-yt-dlp
-
Update the VIDEO_ID_HERE constant in test.ts with your desired YouTube video ID (e.g., for https://www.youtube.com/watch?v=dQw4w9WgXcQ, the ID is 'dQw4w9WgXcQ')
-
Run the script:
npx ts-node test.ts