This is a simple Youtube Downloader, in Python and Flask, that allows everyone to download mp3s and mp4s from individual Youtube videos or even from playlists. It also gives the user the ability to do a basic trim, cutting unnecessary parts from the beginning or/and the end, and to edit metadata like album, artists, cover art etc with a metadata editor. All this are possible by using some awesome open-source libraries.
Programs we need to install:
- Python 3
- Virtualenv (https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/) Linux installation: "sudo apt install python3-virtualenv" Windows installation: "python -m pip install --user virtualenv", but before in Powershell (as administrator) "Set-ExecutionPolicy RemoteSigned". To init virtual environment type inside the project directory: For Linux "virtualenv env" and for Windows "py -m venv env". To start virtual environment type inside the project directory for Linux "source env/bin/activate" and for Windows ".\env\Scripts\activate"
- Flask: pip3 install flask To execute the main python file type: for Linux "python3 app.py" or for Windows "python app.py"
- Pytube: to install pytube inside the virtual environment type "pip3 install pytube" (https://pypi.org/project/pytube/)
- For metadata editor install eyeD3 inside virtual environment, type "pip install eyed3"
- For trimmer install trimmer inside virtual environment, type "pip3 install trimmer" (https://pypi.org/project/trimmer/)
- For trimmer we also need to install something extra inside the virtual environment: For Linux: "sudo apt install ffmpeg libavcodec-extra" For Windows put ffmpeg binaries to PATH
- Inside virtual environment install ffmpeg: For Linux: "sudo apt install ffmpeg" For Windows download ffmpeg exe and add it to PATH (if not already done it)
- Inside virtual environment install dependency ffmpeg-python a python wrapper of ffmpeg, type "pip install ffmpeg-python"
- For the mp4 trimmer install moviepy library: "pip install moviepy"