-
Notifications
You must be signed in to change notification settings - Fork 4
Development technical
System requirements: Have Docker (Desktop or Engine) installed on your system
Tech stack:
-
Backend: Python
-
Web framework: Flask
-
Database: Flask-SQLAlchemy
-
Using this for frontend Bootstrap v5.3
-
For the icons, using Bootstrap Icons 1.11.2
-
For the sheduler (schedules playlist downloads) Schedule
- π€ Git clone the project with
git clone https://github.com/thijstakken/MusicService.git
- π Pick a issue from the list or create a new issue and use that one
- π Start editing the code (Python)
- π To build your new image, open a command line in the project folder and run
docker build -t musicservice:dev .
- π§ͺ For testing with Nextcloud, just do
docker run -d -p 8080:80 nextcloud
to start a fresh Nextcloud environment. When started, go tohttp://localhost:8080/
in some cases you have to replacelocalhost
with your computers IP.
Use the docker compose file or use this Docker run command, and change it to your needs to get started:
docker run \
--name musicservice \
--restart=no \
-v config:/config \
-v musiccache:/music \
-e URL=https://demo1.nextcloud.com/remote.php/dav/files/wpS97kPjnDJo6gGQ/ \
-e DIRECTORY= \
-e USERNAME=wpS97kPjnDJo6gGQ \
-e PASSWORD=demo \
-e INTERVAL=0 \
musicservice:dev
-
π Create a branch and make your changes. When committing changes please use Gitmoji and close the corresponding issue with "fixed" and the number of the issue
git commit -m ":bug: fixed #21 Your commit message"
-
β¬ Create a pull request
-
π Wait for it to be reviewed and merged!
-
Cleaning up, or starting over with testing:
- Delete the container with:
docker rm musicservice
- Delete the config volume with:
docker volume rm config
- Delete the musiccache volume with:
docker volume rm musiccache
youtube-dlp documentation The most handy part of the documentation: developer instructions on youtube-dlp
All available command line options (yt-dl original): parameters and options
YouTube does not currently have support for higher then 192kbps bitrate audio. This is way I've left out the explicit bitrate from the YT-DLP settings, this way, no conversion is being made to a higher pointless bitrate. It will just download the highest, original quality without making an extra conversion. Upscaling does not make a hearable difference, and could, because of the extra conversion, even make the quality slightly worse.
Adding thumbnail to the MP3 files: StackOverflow how to After testing, I found that this adds on average about 0.1MB to each MP3 file.
'format': 'bestaudio[asr<=44100]/best[asr<=44100]', de prio is links, de beste audio indien beschikbaar en anders de één na hoogste gaat ie downloaden op max 44100 hertz De ASR is belangrijk voor de sample rate, deze mag niet boven de 44100 komen, want dan laden ze niet meer lekker in op de Pioneer CDJ'sample
De 'preferredquality': '192' staat uitgecomment. Omdat het niet relevant is om een bitrate te forceren. Door dat los te laten gebruikt het de sample rate van de orignele audio. Daardoor blijft er meer kwaliteit overe omdat het weer een extra vrij nuttelose conversie scheelt. Het neemt nu gewoon de sample rate van de originele audio over. https://www.h3xed.com/web-and-internet/youtube-audio-quality-bitrate-240p-360p-480p-720p-1080p
Er gaan fouten komen denk ik als ik een map zoals Soul|Funk etc... ga doen. want "|" tekens zijn niet beschikabaar op windows voor foldernamen
Om het voor elkaar te krijgen dat ik enviroment variabelen van het OS oppak en in Python code als variabele kan gebruiken. Hiervoor heb ik dit gevolgd: https://able.bio/rhett/how-to-set-and-get-environment-variables-in-python--274rgt5#:~:text=To%20set%20and%20get%20environment%20variables%20in%20Python%20you%20can,Get%20environment%20variables%20USER%20%3D%20os.
To get ffmpeg on the image, I installed it on the image directly: ffmpeg for linux ffmpeg source
Docker build and push task for DevOps pipeline: DevOps pipelines