Add actual files

This commit is contained in:
Quad 2020-09-30 22:54:28 +02:00
parent e1d31e99b9
commit c9a1a9ec72
5 changed files with 45 additions and 1 deletions

View File

@ -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

2
playlist.txt Normal file
View File

@ -0,0 +1,2 @@
https://www.youtube.com/watch?v=GLcoNJOjuic # Test
https://www.youtube.com/watch?v=nSKp2StlS6s # Test 2

9
run.sh Executable file
View File

@ -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

13
service.systemd Normal file
View File

@ -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

3
ytdlupdate.sh Executable file
View File

@ -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