diff --git a/README.md b/README.md index dcf2c80..778c229 100644 --- a/README.md +++ b/README.md @@ -1 +1,18 @@ -# Placeholder +# Officemusic + +Extremely basic music player that I run on a raspberry pi at my office. + +It's just a loop that updates the git repo (containing the playlist) and then feeds said playlist (which is just a list of YouTube URLs) into mpv. + +Why use a proper music player like mpd when you can just cram YouTube URLs into mpv + +# Install + +1. Get a raspberry pi +2. Bring it to work +3. Find some old speakers to plug into it +4. Install mpv and updated youtube-dl on pi +5. Clone this repo +6. Run mpv with my playlist I guess +7. Maybe use the service file so it starts being noisy on boot fuck if i know +8. Go fill your coffee mug and get back to work i'm not paying you to mess around with a raspberry pi and some speakers diff --git a/playlist.txt b/playlist.txt new file mode 100644 index 0000000..ad639a2 --- /dev/null +++ b/playlist.txt @@ -0,0 +1,2 @@ +https://www.youtube.com/watch?v=GLcoNJOjuic # Test +https://www.youtube.com/watch?v=nSKp2StlS6s # Test 2 diff --git a/run.sh b/run.sh new file mode 100755 index 0000000..309379c --- /dev/null +++ b/run.sh @@ -0,0 +1,9 @@ +#! /usr/bin/env bash + +# Sleep for a while because crap wifi coverage at office so network connection takes ages to come online +sleep 5 + +while true; do + git pull + mpv --shuffle --ytdl-format="bestaudio" --playlist=playlist.txt +done diff --git a/service.systemd b/service.systemd new file mode 100644 index 0000000..7e9681f --- /dev/null +++ b/service.systemd @@ -0,0 +1,13 @@ +[Unit] +Description=Music Player + +[Service] +ExecStart=/home/pi/officemusic/run.sh +User=pi +Group=pi +TimeoutStopSec=25 +KillMode=process +Restart=on-failure + +[Install] +WantedBy=multi-user.target diff --git a/ytdlupdate.sh b/ytdlupdate.sh new file mode 100755 index 0000000..829cbd7 --- /dev/null +++ b/ytdlupdate.sh @@ -0,0 +1,3 @@ +sudo curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /usr/local/bin/youtube-dl + +sudo chmod +x /usr/local/bin/youtube-dl