A tool that synchronizes your YouTube playlists and other music providers with your Cloud Storage like Nextcloud as MP3s.
The Music Service is a microservice application and runs as a Docker container. Because of using Docker, every installation runs the same, for everyone. This brings programming efficiency and improves reliability. Docker image release
:warning: You must have Docker installed: Either the Docker Desktop (with GUI) or Engine (no GUI) installed on your system.
:information_source: Tip: If you just want to test this application, luckily there is a good tool to use. 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. And you can continue to follow the steps below!
:information_source: Recommendation: For the best experience, install this container on a computer/server which runs 24/7, so you will always have your music in sync.
docker run -d \
--name musicservice \
--restart=always \
-v config:/config \
-v musiccache:/music \
-e URL=https://demo2.nextcloud.com/remote.php/dav/files/kA2kSpbk2tMwCPpB/ \
-e DIRECTORY=/some/01%20my%20music \
-e USERNAME=kA2kSpbk2tMwCPpB \
-e PASSWORD=demo \
-e INTERVAL=5 \
thijstakken/musicservice:latest
Before you can run the docker-compose or docker run command, you will first have to make a few changes.
Configure URL
(required):
URL=
Configure DIRECTORY
(required):
-e DIRECTORY= \
, then it will save the files to the root directory off your cloud storage. (not recommended)dir=
and the &fileid=2274
/some/01%20my%20music
USERNAME
(required):
Configure PASSWORD
(required):
Settings
Devices & sessions
musicservice
Create new app password
INTERVAL
(optional): 10
will represent 10 minutes. The program will then run with intervals of 10 minutes.0
and then the script will not run on shedule and just stop after one run.docker compose up -d
(make sure your command line interface is active in the same directory as where the docker-compose.yml file lives).That’s all! If everything is correct, it will create the container, mount the volumes with the configuration and then do it’s first run. Let it run for a minute or so. If everything works you should see a new folder and song in your cloud storage. If that happened everything is working fine.
But if this is not the case, the program crashed or it’s taking longer then 5 minutes, then you should check out the logs.
docker logs musicservice
and it will display the logs for you. This is how you can do debugging, find out if everything is working like it should or if there are any errors.:information_source: Tip: You can update the playlists file while the container is running. If you made any changes, they will be in effect the next time it checks for newly added music. Default
INTERVAL
is 5 minutes.
/config/playlists
docker volume inspect config
you can see the directory location of the volume._data
directory and there you will find the playlists
file,playlists
file with your favorite editor like Nano :), and add every playlist/song that you want to add as a new line. Like this:
youtube.com/playlist1
youtube.com/playlist2
youtube.com/video3
If you where already using youtube-dl with the archive function, you probably have an downloaded.txt or similar file with all the songs you have already downloaded.
:warning: Shut down the musicservice container first
To migrate, just copy the contents of the old file over to the /config/downloaded
file. You can find that file at the musicdatabase volume
Run docker volume inspect config
at your command line to find the location of that volume on your disk
Open the file, paste the old information in and save it.
That’s it!
Feel free to contribute, you can submit issues here and fix issues/bugs, improve the application!
System requirements: Have Docker (Desktop or Engine) installed on your system
Techniques: Python, Docker, YT-DLP and WebDAV
git clone https://github.com/thijstakken/MusicService.git
docker build -t musicservice:dev .
docker run -d -p 8080:80 nextcloud
to start a fresh Nextcloud environment. When started, go to http://localhost:8080/
in some cases you have to replace localhost
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
git commit -m ":bug: fixed #21 Your commit message"
🚀 Wait for it to be reviewed and merged!
docker rm musicservice
docker volume rm config
docker volume rm musiccache
Use at your own risk, never trust the code of a random dude on the internet without first checking it yourself :)