If this project has been useful to you and you want to help me to keep contributing to the open source with projects, examples, plugins,... collaborate and buy me a coffee.
Project that allows you to download a youtube video as mp4 or convert the video to mp3.
Technologies
- Client side: Angular, Ionic, Typescript.
- Server side: NestJS, Typescript.
In order to convert the youtube video to mp3, two strategies have been followed:
On the one hand, I decided to check if it was feasible to perform the conversion on the client side (making use of the lamejs library). The source code for this conversion has been obtained from the following link:
I have encapsulated this code in an angular service to make it easier to call the method to convert the video to mp3.
The truth is that it works quite well. The only drawback is that there is no support for the lamejs library for typescript and it hasn't been updated for 4 years. It would be necessary to add the types.
To convert YouTube video to mp3 on the server side, ffmpeg and fluent-ffmpeg package are used.
This is the most common way to perform the conversion and the one that is explained/developed in most posts or repositories.
The Front end is developed in Angular and Ionic.
Some of the dependencies used in the Front project are rjxs, lamejs, trasloco,...
Run ionic serve
for a dev server. Navigate to http://localhost:8100/
. The app will automatically reload if you change any of the source files.
Run npm run start:dev
for a dev server. Navigate to http://localhost:3000/
.
Currently both Front and Back are deployed in Vercel.
Also Back is deployed to Heroku.