One of the (many) music server implementations for UWCS. While the other options out there may be shinier, music-get is intended to be an easily maintainable alternative prioritising simplicity over extra features. Playing works on a round robin system - each bucket contains at most one item queued by a single IP address.
##Browser Extensions The extension source is available at https://github.com/mcnutty26/music-get-autoqueue
The chrome extension is available at https://chrome.google.com/webstore/detail/music-get-autoqueue/iomcfpdngiolnefjdehdaoanlilbjiml.
The Firefox extension is available at https://addons.mozilla.org/en-GB/firefox/addon/music-get-autoqueue
##Setup
- Create
config.properties
indist
, and optionally have it contain the following key=value pairs:- password (the admin password, no default)
- buckets (the maximum number of tracks queued by each user, default is 4)
- timeout (the maximum number of seconds a song can play for, default is 547)
- directory (the location on disk where uploaded songs are stored, default is
/tmp/musicserver/
)
- Create an Apache virtualhost with the document root pointed at the music-get
dist
folder (a sample config is provided indist/apache
) - Enable
mod_rewrite
,mod_proxy
, andmod_proxy_html
in Apache (a2enmod proxy
etc.) - Run
music.get
(this will pull any repo updates, build the project, update youtube-dl, and start the server back end)
##API: ###The API is exposed on port 8080, and proxied though Apache as /api/ on port 80.
curl music.lan/api/list
curl music.lan/api/last
curl music.lan/api/current
curl music.lan/api/add -F "file=@/path/to/file.mp3"
curl music.lan/api/url -F "url=https://www.youtube.com/watch?v=QcIy9NiNbmo"
curl music.lan/api/downloading
/alias accepts an IP address and returns 'canalias' or 'cannotalias' depending on whether that IP has an alias set
curl music.lan/api/alias?ip=10.0.0.1
curl music.lan/api/alias/add -F "alias=myalias"
/remove accepts a guid as multipart/form-data (obtained from /list) and removes the associated item from the queue if the requesting ip queued that item
curl music.lan/api/remove -F "guid=3c0a7a25-ffc5-4654-8e96-f8dc5dc70f5c"
curl music.lan/api/admin/kill -F "pw=letmein123"
/admin/remove accepts a guid (obtained from /list) and a password as multipart/form-data and removes the associated item from the queue if the password matches the one in config.properties
.
curl music.lan/api/admin/remove -F "guid=3c0a7a25-ffc5-4654-8e96-f8dc5dc70f5c" -F "pw=letmein123"
/admin/alias accepts an ip address, a password, and optionally an alias as multipart/form-data and sets (or resets) the alias for that ip if the password matches the one in config.properties
.
curl music.lan/api/admin/alias -F "ip=192.168.1.0" [-F "alias=newalias"] -F "pw=letmein123"
##Dependencies (with links to source code):
- Flat-UI (included in the
dist
directory) - Jetty (included in the dist directory)
- JSON-java (included in the dist directory)
- youtube-dl (included in the
dist
directory) - JRE 8
- mpv
- Apache
- PHP
##Licenses:
- music-get is distributed under the GNU GPL v3
- Flat-UI is licensed under the Creative Commons Attribution 3.0 Unported license (CC BY 3.0)
- youtube-dl is public domain
- Jetty is licenced under the Apache Licence 2.0
- JSON-java is licensed under a bespoke license