"music_flask" Web application is what you need to make downloading youtube music easier!
Based on the Flask framework, it is entirely developped in Python3.
Python3 pip3 Flask flask_wtf wtforms youtube_dl ffmpeg
!! WORK IN PROGRESS !!
- Add a cli arguments parser
- Fill up the logger class
- send logs to logfile when downloads fail.
- Add a API call to musicbrainz to retrieve tag informations and music names + update file with it.
- Find a way to add a progress-bar
- Add youtube-dl progession informations too
- Improve and add more flash information
- Improve music files list design
- Add audio balise to stream online
- Add a way to delete musics
- Add a database simplistic system to store URL:file_name downloaded (use youtube ID as 'uniq' info)
- Avoid downloading of a previously downloaded file still present in 'data'
- Change download mechanism to be able to download in a async manner.async-io
- Add a check for the local disk available space before download. Print a warning icon when disk space is low.
You can build the docker image with the bash script included:
$ cd Docker/
$ bash -c ./build-image.shYou must run it with user flask:
Please pay attention to the flag --rm$ docker run -p 80:1080 -d --user flask -h musicFlask --name music_flask --rm music_flask:latestIf you want to manage the downloaded files on disk, you can mount the data directory into a volume with -v option:
$ mkdir $(pwd)/musics
$ docker run -p 80:1080 -d --user flask -h musicFlask --name music_flask -v $(pwd)/musics:/home/flask/music_flask/music_flask/data --rm music_flask:latest- show logs
- attach to it
- stop it
$ docker logs -f music_flask
$ docker exec -it music_flask sh
$ docker stop music_flaskCreate a Python virtual environnement
Install music_flask:
$ python3 setup.py installNow run the application:
$ python3 music_flask/music_flask.py| Variable Name | Description | Default value |
|---|---|---|
| TLS | Enable or disable HTTPS support | False |
| TLS_CERTIFICATE | Absolute path to a PEM TLS certificate file | '' |
| TLS_KEY | Absolute path to a PEM TLS private key file | '' |
| PORT | Listening port for the WEB interface | 1080 |
| LISTEN | Listening IP address for the WEB interface | '0.0.0.0' |
| DEBUG | Enable flask debug | False |
| CSRF_KEY | CSRF key used by Flask to secure the HTTP(S) exchanges | "powerful secretkey" |
| CSRF_FORM_TOKEN | Secret token set in the main page formulary to be send to Flask engine | "a csrf secret key" |
| DATA_DIRECTORY | MP3 download destination directory if no value are set, the data will be put in [the music_flask project's directory/data] | False |
You can find youtube-dl python call options here Python'call options