This repo is an example on how to use ytdl to convert YouTube video into audio file.
It included javascript and python version.
It mainly used ytdl-core and ffmepg package to convert the video to audio. It is recommended to install NodeJS.
cd javascript
- Install packages with
npm i
- Compile the code
node convert.js
Same logic as JavaScript
cd typescript
- Install packages with
npm i
- Compile the code
npm run start
It is suggested to use virtual environment to compile the code. Python virtual environment can refer to here
py -m venv python
or
python -m venv python
source <venv>/bin/activate
cd python
Scripts\activate