jerc

A jukebox in the form of a werc app.

Usage

jerc depends on MPD, mpc, and youtube-dl.

Set musicdir in your /etc/initrc.local to wherever you want MP3s to be stored. Set MPD's music_directory to the same location. If you want the jerc interface on a page other than the site root, change if(~ $req_path /) in app.rc to if(~ $req_path /wherever/else) and change post_redirect $baseurl to post_redirect $baseurl/wherever/else.

The intended use case is MPD and a web server on a server with speakers serving the jerc interface to clients (mobile phones, laptops, etc.) on the local network to queue songs and control MPD. Clients can enter anything in the queue box and jerc will queue the first YouTube search result's audio track. You could trivially modify this setup to, for example, run MPD and jerc on separate machines (share a filesystem for musicdir and configure mpc to connect to the other host's MPD server) or operate an Internet radio station with public controls (configure MPD's built-in HTTP streaming server).

Note that posting the queue form takes a very long time since jerc waits for youtube-dl to finish downloading the video. You may need to (1) be patient and/or (2) increase your web server's timeout.

You will probably want a cronjob to delete old MP3s from musicdir.

For a simpler jukebox app that queues uploaded files instead of YouTube videos, see werchan's radio.

License

Distributed under the public domain as well as the MIT and ISC licenses.