Commit 31e19efd authored by S. Zeid's avatar S. Zeid

Update Leviathan to c8b947e; clarify that Mutagen is not imported by the Web...

Update Leviathan to c8b947e; clarify that Mutagen is not imported by the Web app; update copyright notices; rename some license/notice files

WebLeviathan prior to this commit should have been licensed under the
GNU GPL version 2 (or GPLv3+ after Mutagen was relicensed) because
Leviathan unconditionally imported Mutagen.  The Leviathan commit prior
to 575de03 adds an `enable_gpl()` function which allows Mutagen to be
imported.  Since WebLeviathan has no need to use Mutagen-dependent
features, it does not call that function when importing Leviathan,
and so Mutagen is not imported.  This allows WebLeviathan's license
to remain the X11 License.

My apologies to the Mutagen developers.

This commit also incorporates these changes to Leviathan:

* `leviathan.yml` is now the preferred name for the config file; the old
  name (`leviathan.yaml`) still works if the former does not exist.

* Ogg files with `.opus` extensions are supported for adding and
  converting to MP3.  (Not applicable to WebLeviathan.)
parent 05b63a77
Leviathan Music Player
A free software, minimalist, Web-based music player.
Copyright (C) 2010-2012 Scott Zeid
http://me.srwz.us/leviathan/web
Copyright (C) 2010-2012 S. Zeid
https://code.s.zeid.me/leviathan-player
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
......@@ -30,6 +30,13 @@ The icon is licensed under the terms of the GNU Lesser General Public License.
This program contains the following libraries or portions of them:
* Leviathan Music Manager (https://code.s.zeid.me/leviathan)
See `leviathan/LICENSE.txt`.
Note: Leviathan Music Player does not need to be licensed under the GPL
because no GPL-dependent code in Leviathan Music Manager is enabled, and
the music manager's license allows for this.
* IE9.js (http://code.google.com/p/ie7-js/)
IE7/IE8/IE9.js - copyright 2004-2010, Dean Edwards
http://code.google.com/p/ie7-js/
......
......@@ -3,8 +3,8 @@ Leviathan Music Player
A free software, minimalist, Web-based music player.
Copyright (C) 2010-2012 Scott Zeid
http://leviathan.srwz.us/
Copyright (C) 2010-2012 S. Zeid
http://code.s.zeid.me/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
......@@ -23,7 +23,7 @@ Requirements
### On the server ###
* Python 2.6 or 2.7
* Mutagen
* Mutagen (only for managing the music library; not needed for the Web app)
* Python Imaging Library
* PyYAML
* Bottle
......
......@@ -3,8 +3,8 @@
# Leviathan Music Player
# A free software, minimalist, Web-based music player.
#
# Copyright (C) 2010-2011 Scott Zeid
# http://leviathan.srwz.us/
# Copyright (C) 2010-2011 S. Zeid
# https://code.s.zeid.me/leviathan-player
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
......
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
The WebLeviathan icon is based on the GNOME Orca icon by Stephen Brandt.
From <https://gitlab.gnome.org/GNOME/orca/-/blob/f538dc1dcb2b2fa3a925c7eee15a4143272aeaf3/icons/AUTHORS>:
```
Orca icon created by Stephen Brandt.
[email protected]
http://www.stephenbrandt.com/
This artwork is available under the terms of the GNU Lesser General Public License.
http://www.gnu.org/licenses/lgpl.html
This icon follows the Tango visual guidelines.
http://tango-project.org/
```
The WebLeviathan icon is licensed under the terms of the GNU Lesser General
Public License, version 2.1.
......@@ -21,6 +21,8 @@
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:contributor>Modified by S. Zeid in 2010 or 2011 from the original GNOME Orca icon by Stephen Brandt.</dc:contributor>
<dc:rights>GNU Lesser General Public License, version 2.1, per [https://gitlab.gnome.org/GNOME/orca/-/blob/f538dc1dcb2b2fa3a925c7eee15a4143272aeaf3/icons/AUTHORS].</dc:rights>
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
......
This diff is collapsed.
Leviathan Music Manager
A command-line utility to manage your music collection.
Copyright (C) 2010-2013 Scott Zeid
http://code.s.zeid.me/leviathan
Copyright (C) 2010-2013, 2020 S. Zeid
https://code.s.zeid.me/leviathan
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
EXCEPTION: Any version of this program, modified or otherwise, or any portion
or modified portion of this program, which does not use or import the Mutagen
audio tagging library may (at your option) be used under the following X11
License instead of the GNU General Public License (this condition is also
satisfied when this program is imported and used as a library without calling
its `enable_gpl()` function):
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
......
# Leviathan Music Manager
# A command-line utility to manage your music collection.
#
# Copyright (C) 2010-2011 Scott Zeid
# http://me.srwz.us/leviathan
# Copyright (C) 2010-2011, 2020 S. Zeid
# https://code.s.zeid.me/leviathan
#
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
#
# EXCEPTION: Any version of this program, modified or otherwise, or any portion
# or modified portion of this program, which does not use or import the Mutagen
# audio tagging library may (at your option) be used under the following X11
# License instead of the GNU General Public License (this condition is also
# satisfied when this program is imported and used as a library without calling
# its `enable_gpl()` function):
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
......@@ -26,7 +48,9 @@
# 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 <[email protected]>"
__author__ = "S. Zeid <[email protected]>"
__version__ = "0.1"
from leviathan import *
#!/usr/bin/env python
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
# Leviathan Music Manager
# A command-line utility to manage your music collection.
#
# Copyright (C) 2010-2013 Scott Zeid
# http://code.s.zeid.me/leviathan
# Copyright (C) 2010-2013, 2020 S. Zeid
# https://code.s.zeid.me/leviathan
#
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
#
# EXCEPTION: Any version of this program, modified or otherwise, or any portion
# or modified portion of this program, which does not use or import the Mutagen
# audio tagging library may (at your option) be used under the following X11
# License instead of the GNU General Public License (this condition is also
# satisfied when this program is imported and used as a library without calling
# its `enable_gpl()` function):
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
......@@ -29,6 +51,7 @@
# shall not be used in advertising or otherwise to promote the sale, use or
# other dealings in this Software without prior written authorization.
import codecs
import collections
import ConfigParser as configparser
......@@ -45,10 +68,18 @@ import types
import UserDict
import unicodedata
import mutagen
import yaml
from mutagen.easyid3 import EasyID3
def enable_gpl():
"""Enable the use of functions that depend on Mutagen.
Mutagen will not be imported unless this function was called first.
"""
global _GPL
_GPL = True
_GPL = False
Format = collections.namedtuple("Format", ["ffmpeg_codec"])
......@@ -65,6 +96,7 @@ EXTENSIONS = dict(
m4a = Format("libfaac"),
mp3 = Format("libmp3lame"),
ogg = Format("libvorbis"),
opus = Format("libopus"),
wav = Format("pcm_s16le"),
wma = Format("wmav2")
)
......@@ -1175,6 +1207,11 @@ class Library(object):
self.playlists = Playlists(self)
def _get_song_info(self, relpath):
if _GPL:
import mutagen
else:
raise ImportError("adding or updating songs requires a GPL-licensed library,"
" and `leviathan.enable_gpl()` has not been called")
title, ext = os.path.splitext(os.path.basename(relpath))
title = [title]
artist = album = [""]
......@@ -1440,6 +1477,11 @@ class PlaylistFormatSettings(dict):
self._default = path
def apic_extract(mp3, jpg=None):
if _GPL:
import mutagen
else:
raise ImportError("extracting cover art requires a GPL-licensed library,"
" and `leviathan.enable_gpl()` has not been called")
try:
tags = mutagen.mp3.Open(mp3)
except:
......@@ -1460,6 +1502,13 @@ def apic_extract(mp3, jpg=None):
def convert_to_mp3(in_file, out_file, ffmpeg_path, lame_path,
constant_bitrate=None, vbr_quality=None):
if _GPL:
import mutagen
from mutagen.easyid3 import EasyID3
else:
raise ImportError("preserving metadata when converting songs to MP3 requires"
" a GPL-licensed library, and `leviathan.enable_gpl()` has"
" not been called")
ffmpeg_cmd = [ffmpeg_path, "-i", in_file, "-vn", "-acodec", "pcm_s16le",
"-f", "wav", "-"]
lame_cmd = [lame_path, "-m", "s", "--noreplaygain"]
......@@ -1567,7 +1616,7 @@ help|-h|--help
print "Please specify a configuration file or omit --config-file."
return 2
else:
conf_file = os.path.expanduser("~/.leviathan.yaml")
conf_file = get_default_config_path()
cmd = argv[1]
......@@ -1864,9 +1913,17 @@ def strip_latin_diacritics(source):
ret = ret.replace(variant, letter)
return ret
def get_default_config_path():
conf_file = os.path.expanduser("~/.leviathan.yml")
if not os.path.exists(conf_file):
conf_file_yaml = os.path.expanduser("~/.leviathan.yaml")
if os.path.exists(conf_file_yaml):
conf_file = conf_file_yaml
return conf_file
def test(conf_file=None):
if not conf_file:
conf_file = os.path.expanduser("~/.leviathan.yaml")
conf_file = get_default_config_path()
library = Library(conf_file)
return library
......@@ -1882,6 +1939,7 @@ def yes_no_prompt(prompt="Are you sure?"):
return True if r == "yes" else False
if __name__ == "__main__":
enable_gpl()
try:
sys.exit(main(sys.argv))
except KeyboardInterrupt:
......
# Leviathan Music Player
# A free software, minimalist, Web-based music player.
#
# Copyright (C) 2010-2012 Scott Zeid
# http://leviathan.srwz.us/
# Copyright (C) 2010-2012 S. Zeid
# https://code.s.zeid.me/leviathan-player
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
......
# Leviathan Music Player
# A free software, minimalist, Web-based music player.
#
# Copyright (C) 2010-2012 Scott Zeid
# http://leviathan.srwz.us/
# Copyright (C) 2010-2012 S. Zeid
# https://code.s.zeid.me/leviathan-player
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
......
# Leviathan Music Player
# A free software, minimalist, Web-based music player.
#
# Copyright (C) 2010-2012 Scott Zeid
# http://leviathan.srwz.us/
# Copyright (C) 2010-2012 S. Zeid
# https://code.s.zeid.me/leviathan-player
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
......
# Leviathan Music Player
# A free software, minimalist, Web-based music player.
#
# Copyright (C) 2010-2012 Scott Zeid
# http://leviathan.srwz.us/
# Copyright (C) 2010-2012 S. Zeid
# https://code.s.zeid.me/leviathan-player
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
......
......@@ -10,8 +10,8 @@
Leviathan Music Player
A free software, minimalist, Web-based music player.
Copyright (C) 2010-2012 Scott Zeid
http://leviathan.srwz.us/
Copyright (C) 2010-2012 S. Zeid
https://code.s.zeid.me/leviathan-player
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
......
%# Leviathan Music Player
%# A free software, minimalist, Web-based music player.
%#
%# Copyright (C) 2010-2012 Scott Zeid
%# http://leviathan.srwz.us/
%# Copyright (C) 2010-2012 S. Zeid
%# https://code.s.zeid.me/leviathan-player
%#
%# Permission is hereby granted, free of charge, to any person obtaining a copy
%# of this software and associated documentation files (the "Software"), to deal
......
%# Leviathan Music Player
%# A free software, minimalist, Web-based music player.
%#
%# Copyright (C) 2010-2012 Scott Zeid
%# http://leviathan.srwz.us/
%# Copyright (C) 2010-2012 S. Zeid
%# https://code.s.zeid.me/leviathan-player
%#
%# Permission is hereby granted, free of charge, to any person obtaining a copy
%# of this software and associated documentation files (the "Software"), to deal
......
......@@ -2,8 +2,8 @@
* Leviathan Music Player
* A free software, minimalist, Web-based music player.
*
* Copyright (C) 2010-2012 Scott Zeid
* http://leviathan.srwz.us/
* Copyright (C) 2010-2012 S. Zeid
* https://code.s.zeid.me/leviathan-player
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
......
%# Leviathan Music Player
%# A free software, minimalist, Web-based music player.
%#
%# Copyright (C) 2010-2012 Scott Zeid
%# http://leviathan.srwz.us/
%# Copyright (C) 2010-2012 S. Zeid
%# https://code.s.zeid.me/leviathan-player
%#
%# Permission is hereby granted, free of charge, to any person obtaining a copy
%# of this software and associated documentation files (the "Software"), to deal
......
......@@ -2,8 +2,8 @@
* Leviathan Music Player
* A free software, minimalist, Web-based music player.
*
* Copyright (C) 2010-2012 Scott Zeid
* http://leviathan.srwz.us/
* Copyright (C) 2010-2012 S. Zeid
* https://code.s.zeid.me/leviathan-player
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
......
......@@ -5,8 +5,8 @@
Leviathan Music Player
A free software, minimalist, Web-based music player.
Copyright (C) 2010-2012 Scott Zeid
http://leviathan.srwz.us/
Copyright (C) 2010-2012 S. Zeid
https://code.s.zeid.me/leviathan-player
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
......
......@@ -4,8 +4,8 @@
# Leviathan Music Player
# A free software, minimalist, Web-based music player.
#
# Copyright (C) 2010-2012 Scott Zeid
# http://leviathan.srwz.us/
# Copyright (C) 2010-2012 S. Zeid
# https://code.s.zeid.me/leviathan-player
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
......
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