Commit cdcd9f11 authored by S. Zeid's avatar S. Zeid

First commit

parents
*.pyc
*.pyo
artwork-cache/generic/*
artwork-cache/library/*
leviathan/.git*
leviathan/leviathan.yaml
uwsgi.xml
webleviathan.yaml
Leviathan Music Player
A Web-based music player based on the Leviathan music library manager.
Copyright (C) 2010-2011 Scott Zeid
http://me.srwz.us/leviathan/web
Installation Instructions
(When running shell commands, leave out the backticks.)
1. Make sure you have all of the server dependencies installed. See the
README file for the list of requirements.
2. Copy webleviathan.yaml.dist to webleviathan.yaml and edit the settings.
3. Run `chmod 600 webleviathan.yaml` if you don't want other users to see
your Last.fm password. Also make sure that the file is not publicly
accessible on the Internet.
4. Copy leviathan/leviathan.yaml.dist to leviathan.yaml and edit the
settings. Alternatively, you can edit the leviathan.yaml setting in
webleviathan.yaml to point to an already existing leviathan.yaml file.
5. Run `./leviathan.py cache` to load your music library into the database.
Then run `./leviathan.py to-mp3` to convert your music to MP3 format.
6. Start the server using the instructions for your Web server under
Starting the Server.
7. If you are running this on a public-facing server, it is strongly
recommended to set up HTTPS and HTTP authentication on your server. I am
NOT liable if you get sued, arrested, or prosecuted for copyright
infringement based on your use of this program.
8. Open Leviathan Music Player in your favorite standards-compliant Web
browser and enjoy your music.
Starting the server
===================
Standalone server
-----------------
Run `./webleviathan.py` to start the server. You can specify a custom host
name and/or port to listen on using the -h / --host and -p / --port switches,
respectively.
Under Apache
------------
To run Leviathan Music Player under Apache:
1. Add these lines to your VHost's configuration file:
WSGIDaemonProcess <process group> python-path=<directory the app is in> display-name=%{GROUP}
WSGIScriptAlias /<desired path> <app directory>/webleviathan.py
<Directory <app directory>>
WSGIProcessGroup <process group>
WSGIApplicationGroup %{RESOURCE}
</Directory>
And if you want a subdomain with mod_rewrite:
RewriteCond %{HTTP_HOST} ^<fully-qualified domain name>$
RewriteRule ^(.+)$ /<desired path>$1 [PT,QSA]
<process group> is a unique (to mod-wsgi) name that describes your
app. This can be basically anything you want (but stick to
letters/numbers/periods/dashes to be safe).
<desired path> is the directory you want Leviathan Music Player to
appear in for URLs.
The rest should be self-explanatory.
2. If your server is publicly accessible, it is strongly recommended to
enable HTTPS and HTTP authentication.
3. When you're done, restart Apache (`sudo service apache2 restart` on
Ubuntu).
Under Cherokee
--------------
To run Leviathan Music Player under Cherokee:
1. Copy uwsgi.xml.dist to uwsgi.xml and change python-path to point to
the directory where webleviathan.py is located.
2. Make sure cherokee-admin is installed (if you're using the Cherokee
PPA, run `sudo apt-get install cherokee-admin`).
3. Start cherokee-admin (`sudo cherokee-admin`), go to the URL it gives
you, and copy/paste the one-time password.
4. Go to the vServers.
5. If you want to make a new server, click on + > Platforms > uWSGI.
To use an existing server, click on it and go to Behavior > Rule
Management > + > Platforms > uWSGI.
6. Click Next, and type `<directory of app>/uwsgi.xml` (no backticks).
7. Choose whatever you want for the Web Directory, and click Create.
8. Change the Rule if you want to. For example, to use a subdomain,
change Rule Type to Header, set Header to Host, Type to Matches a
Regular Expression, and Regular Expression to:
^subdomain\.example\.com\.?(:[0-9]+)?$
Change the domain to be what you want it to be, but remember the
backslashes before the periods.
9. If your server is publicly accessible, it is strongly recommended to
enable HTTPS and HTTP authentication.
10. Click Save and then Graceful Restart.
Leviathan Music Player
A Web-based music player based on the Leviathan music library manager.
Copyright (C) 2010-2011 Scott Zeid
http://me.srwz.us/leviathan/web
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Except as contained in this notice, the name(s) of the above copyright holders
shall not be used in advertising or otherwise to promote the sale, use or
other dealings in this Software without prior written authorization.
The icon is licensed under the terms of the GNU Lesser General Public License.
This program contains the following libraries or portions of them:
* pylast (http://code.google.com/p/pylast/):
Copyright 2008-2010 Amr Hassan
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Leviathan Music Player
A Web-based music player based on the Leviathan music library manager.
Copyright (C) 2008-2011 Scott Zeid
http://me.srwz.us/leviathan/player
Leviathan Music Player is a Web-based music player. It uses the Leviathan
music library manager to find your songs and playlists. Both the music player
and the library manager use configuration files to store their settings, and
these files must be edited manually.
Requirements
============
* On the server:
* Python 2.6 or 2.7
* Mutagen
* FFmpeg (proprietary codecs recommended)
* LAME
* Bottle
* pylast
* mod-wsgi (for Apache only)
To install these packages on Ubuntu, run:
$ sudo apt-get install python python-mutagen python-setuptools \
ffmpeg libavcodec-extra-\* libavdevice-extra-\* libavfilter-extra-\* \
libavformat-extra-\* libavutil-extra-\* libpostproc-extra-\* \
libswscale-extra-\* lame
$ sudo easy_install -U bottle pylast
If you're using Apache, also run:
$ sudo apt-get install libapache2-mod-wsgi
* On the client:
* A standards-compliant Web browser that supports HTML5/CSS3/JavaScript.
Firefox 4+, Google Chrome, Safari, and Opera 10.5+ should work. IE9
might work. IE7 works but is very buggy. IE6 and earlier will
probably NOT work.
* Adobe Flash Player 9.0+
Installation
============
See the INSTALL file for installation instructions.
Configuration
=============
Leviathan Music Player uses two configuration files:
* leviathan/leviathan.yaml
This contains settings for the music manager. Here is where you enter the
paths to your music collection, your playlist folders, FFmpeg, and LAME,
as well as the quality settings for MP3 encoding. Also specify what you
want album art files to be called (use albumart.jpg if you intend to sync
your music collection with an Android device).
If you already have another copy of Leviathan Music Manager already set up,
you can change the leviathan.yaml setting in webleviathan.yaml to point to
the path of the configuration file you already have.
* webleviathan.yaml
This contains settings for the music player. You can:
* Set whether repeat, shuffle, and Last.fm scrobbling are on or off by
default.
* Enter your Last.fm username and password if you wish to scrobble your
music. If you do this, make sure nobody can access this file except you.
* Choose a color theme for the music player. Color themes are contained
in the themes directory. Enter the name of the theme you want to use
without the .yaml extension.
config.yaml is used internally and you do not need to edit it. It will
probably be removed at a later time.
Artwork Cache
=============
Cover art is cached under the artwork-cache/library/ directory. All sizes
that have ever been displayed in the music player are stored here. However,
most of the files here are 16x16 pixels (shown in the lists) and 92x92 pixels
(shown in the toolbar). In my testing, with a library of around 700 songs and
heavy use over the course of three months, the size of these files is only
around 24 megabytes.
Usage
=====
After installing Leviathan Music Player, use your Web browser to go to the URL
that you set up the player on.
The top of the screen contains a toolbar which displays the title, artist,
album, and cover art of the currently playing song, and it also has playback
controls. The section underneath the toolbar is split into two parts: the
library and the now playing section.
The library shows the artists, albums, playlists, and songs in your music
collection and lets you drill down to find the song you want to listen to.
Clicking on a song in the library section will replace the now playing section
with all of the songs in the artist, album, playlist, or songs list that you
clicked in. To just add a song to the now playing section, click on the plus
sign next to the song.
The now playing section shows all of the songs that may be played after the
current song finishes. Clicking on a song here will cause that song to be
played with no changes to the list. Clicking on the X next to a song will
remove it from the list. The next song in the list will be played, or if
shuffle is enabled, a random song will be chosen. Clicking on Clear at the
top of the list will remove all songs from the Now Playing list and stop
playback.
# Display name of your app
name: Leviathan Music Player
# Base directory of your app without a trailing slash
root: /home/scottywz/Projects/Software/WebLeviathan
# Development settings (development mode = run_if_main(__name__, True))
development:
host: 127.0.0.1
port: 8080
debug: True # This is always False in production modes
icon/16.png

697 Bytes

This diff is collapsed.
icon/48.png

2.87 KB

icon/64.png

4.29 KB

icon/96.png

7.24 KB

The WebLeviathan icon is based on the Orca icon by Stephen Brandt
(http://www.stephenbrandt.com/).
The icon is available under the terms of the GNU Lesser General Public License.
http://www.gnu.org/licenses/lgpl.html
This diff is collapsed.
This diff is collapsed.
images/add.png

396 Bytes

This diff is collapsed.
Leviathan Music Manager
A command-line utility to manage your music collection.
Copyright (C) 2010-2011 Scott Zeid
http://me.srwz.us/leviathan
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Except as contained in this notice, the name(s) of the above copyright holders
shall not be used in advertising or otherwise to promote the sale, use or
other dealings in this Software without prior written authorization.
# Leviathan Music Manager
# A command-line utility to manage your music collection.
#
# Copyright (C) 2010-2011 Scott Zeid
# http://me.srwz.us/leviathan
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
# Except as contained in this notice, the name(s) of the above copyright holders
# shall not be used in advertising or otherwise to promote the sale, use or
# other dealings in this Software without prior written authorization.
__author__ = "Scott Zeid <s@srwz.us>"
__version__ = "0.1"
from leviathan import *
This diff is collapsed.
###########################
# Leviathan configuration #
###########################
# Library settings
library: /path/to/music/library
playlists: /path/to/playlists
playlists_mp3: /path/to/mp3-only-playlists
playlist_db: /path/to/database
albumart_filename: albumart.jpg
# List of playlists to ignore
# Replace [] with a list of playlists to ignore, like this:
# - Playlist 1
# - Playlist 2
# ...
db_ignore_playlists:
[]
# MP3 encoding settings
ffmpeg: ffmpeg # Path to FFmpeg
lame: lame # Path to LAME
constant_bitrate: 256k # ignored if you're using VBR
vbr_quality: 0 # Set to Null if you're using constant bitrate
# Possible values for vbr_quality:
# 0: 220-260 kbps (highest quality; largest file size)
# 1: 190-250 kbps
# 2: 170-210 kbps
# 3: 150-195 kbps
# 4: 140-185 kbps
# 5: 120-150 kbps
# 6: 100-130 kbps
# 7: 80-120 kbps
# 8: 70-105 kbps
# 9: 45-85 kbps (lowest quality; smallest file size)
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<uwsgi>
<python-path>/webleviathan/directory</python-path>
<app mountpoint="/webleviathan"></app>
<module>webleviathan</module>
<processes>4</processes>
<master/>
<harakiri>90</harakiri>
<limit-as>32</limit-as>
<memory-report/>
</uwsgi>
This diff is collapsed.
%# Leviathan Music Player
%# A Web-based music player based on the Leviathan music library manager.
%#
%# Copyright (C) 2010-2011 Scott Zeid
%# http://me.srwz.us/leviathan/web
%#
%# Permission is hereby granted, free of charge, to any person obtaining a copy
%# of this software and associated documentation files (the "Software"), to deal
%# in the Software without restriction, including without limitation the rights
%# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
%# copies of the Software, and to permit persons to whom the Software is
%# furnished to do so, subject to the following conditions:
%#
%# The above copyright notice and this permission notice shall be included in
%# all copies or substantial portions of the Software.
%#
%# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
%# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
%# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
%# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
%# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
%# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
%# THE SOFTWARE.
%#
%# Except as contained in this notice, the name(s) of the above copyright holders
%# shall not be used in advertising or otherwise to promote the sale, use or
%# other dealings in this Software without prior written authorization.
%#
<div id="content">
%for line in content.splitlines():
{{!line}}
%end
</div>
%rebase base **tplvars
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment