Add media - agrbin/songuess GitHub Wiki
Adding a media server to songuess is a hard and unwelcoming experience.
Requirements
- First of all you need a linux machine (or a mac with gcc and homebrew) and some music stored as mp3 files.
- You need to install
node
andnpm
. How to install node.js - Then you will need some packages:
apt-get install lame ffmpeg
(orbrew install lame
) - Lots of CPU time. We need to re-encode every song, cca 5s for a single mp3.
- Public IP or port-forwarding to your machine
Creating a media database
-
git clone https://github.com/agrbin/songuess/; cd songuess/media/
-
npm install
-
in current dir (
songuess/media/
) create a symbolic link to a music directory you want share with your friends.ln -s /path/to/your/music/ mp3
-
cd utils; make;
-
node rescan_library.js
Some warnings on output are normal. rescan_library.js
must be called every time when song is deleted or added to a music directory. If mp3 file has the same INODE re-encoding won't be done.
Reporting database to master server
-
change dir to
songuess/media/server
-
open up a browser, navigate to songuess and enter the
/token
command. Copy the output. -
create file
songuess/media/server/config.override.js
(it is git-ignored)
module.exports = function (exports) {
exports.masterServer = 'http://songuess.jit.su';
exports.media.name = 'NAME-THIS-SERVER';
exports.media.owner = 'YOUR-EMAIL-ADDRESS';
exports.media.token = 'TOKEN-ECHOED-BY-GAME-FOR-THIS-EMAIL';
exports.media.acl = [
['allow', 'email', 'YOUR-EMAIL-ADDRESS']
];
};
-
start a server!
node app.js
-
if you see
Hello: i see you.
you are done!
Troubleshoot
If you want to re-encode everything you can.
rm -rf songuess/media/chunks songuess/media/library/library.json
node songuess/media/utils/rescan_library.js