It has been written in python3. It is a CLI music player that downloads audios from youtube videos, and then plays them.
Also It works with youtube lists.
- Install VLC player, python 3, pip3 and virtualenv.
- Download the project.
- Give execution permissions to all scripts that are in linux folder (
chmod +x ./linux/*
). - Open linux folder in console (
cd ./linux
). - Execute the script named create-virtenv.sh (
./create-virtenv.sh
) to create the virtual enviroment, where all dependencies will be installed. - Execute the script named install-dependencies.sh (
./install-dependencies.sh
) to install required dependencies, that are defined in requirements.txt.
- Install VLC player and a release of python3 with pip3.
- Make sure the option "Add Python to environment variables" is checked in the step named Advanced Options of the python3 installation wizard.
- Download the project.
- Execute the script named install-dependencies.bat, that is in windows folder. And it will install dependencies of requirements.txt file.
It is necessary a text file with all urls of youtube videos that you want to play.
EXAMPLE
https://www.youtube.com/watch?v=jgpJVI3tDbY
https://www.youtube.com/watch?v=8Z5EjAmZS1o
https://www.youtube.com/watch?v=d7hVQpyKLGg
You should name the file urls.list.
In windows It is mandatory that the encoding format be ANSI.
The configuration of the player is in the file youtubePlayer.conf.
By default this file contains this:
[youtubePlayerConfiguration]
urlFile=./urls.list
audioFolder=./audio
loop=true
random=true
- The field urlFile contains the path to file that contains the list with urls of youtube.
- The field audioFolder contains the path where music downloaded will be saved.
- The field random is a boolean value that plays the list of music randomly (true) or according to the order of the file defined in urlFile (false).
- Open the console in linux folder.
- Execute exec.sh script.
If you want to add this script as usable command in your console, you will edit the file ~/.bashrc
and add to the end of the file the next line alias youtube-player='cd /path/of/your/installation/youtube_music_player/linux;./exec.sh'
.
Execute the script ./windows/exec.bat
.
Now this project is in beta, the management of signals to properly close resources is not yet implemented.
And in a future I want to implement a GUI.
I want to thank the creators of VLC (VideoLan), pafy library ( mps-youtube) and youtube-dl library.
Any contributions are highly appreciated. The best way to contribute code is to open a pull request on gitHub.
GPL v3 License.