zotify
Docker How to
Docker Build
I had to add the git dependency to the Dockerfile
at line
RUN apk --update add ffmpeg git
for it to build without errors
docker build -t zotify .
run.sh
Let Docker create the /mnt/media/zotify
directory
#!/bin/bash
## $1 allows to directly input url i.e. `./run.sh http://****`
docker run --rm \
-v "/mnt/media/zotify:/root/Music" \
-v "/home/username/docker/zotify-googolFork/env/config:/root/.config/zotify" \
-p "4381:4381" \
-it zotify python3 -m zotify $1
#-it zotify /bin/sh
Authenticate
I've been using this fork of zotify by Googolplexed0 to authenticate via magic link.
- Input your username (email)
- open link in browser (where you are already logged into same account)
- "Continue to the App" button
http://127.0.0.1:4381/login?code=***
change to server's IP directly in address bar and press enter
Changing REDIRECT_ADDRESS
to my server's hostname or IP caused an invalid link. I just had to manually change 127.0.0.1
to my server's hostname/IP (in browser's address bar) after clicking spotify auth link.
Commands
docker run --rm -v "$PWD/Zotify Music:/root/Music/Zotify Music" -v "$PWD/Zotify Podcasts:/root/Music/Zotify Podcasts" -it zotify /bin/sh
/app # python3 -m zotify --help
Troubleshooting
zsh
zotify https://open.spotify.com/track/7ICNV0qtWVWvSmoFxQcU7g?si=1a2e7e43c3a44098
zsh: no matches found: https://open.spotify.com/track/7ICNV0qtWVWvSmoFxQcU7g?si=1a2e7e43c3a44098
This is a shell escaping issue with zsh (Z shell). The problem occurs because zsh interprets the ?
and &
characters in the URL as special shell characters for pattern matching.
1. Quote the URL
Wrap the URL in quotes to prevent zsh from interpreting special characters:
zotify "https://open.spotify.com/track/7ICNV0qtWVWvSmoFxQcU7g?si=1a2e7e43c3a44098"
3. Remove the tracking parameter
The ?si=...
part is just Spotify's tracking parameter and isn't needed for downloading:
zotify https://open.spotify.com/track/7ICNV0qtWVWvSmoFxQcU7g