ok100 / lyvi Goto Github PK
View Code? Open in Web Editor NEW🎶 Command-line lyrics (and more!) viewer
Home Page: http://ok100.github.com/lyvi/
License: Do What The F*ck You Want To Public License
🎶 Command-line lyrics (and more!) viewer
Home Page: http://ok100.github.com/lyvi/
License: Do What The F*ck You Want To Public License
https://bbs.archlinux.org/viewtopic.php?id=125767
Advantage:
Disadvantage:
Try for example
glyrc lyrics -a Akrea -t Trugbild -p1 -v0 --callback "cat <path>" -c /tmp
Hello!
The package needs to be updated. See https://aur.archlinux.org/packages/lyvi-git/
Thanks for your job, this is great!
I get the following error with the AUR package:
Traceback (most recent call last):
File "/usr/bin/lyvi", line 5, in
from pkg_resources import load_entry_point
File "/usr/lib/python3.4/site-packages/pkg_resources.py", line 2876, in
working_set = WorkingSet._build_master()
File "/usr/lib/python3.4/site-packages/pkg_resources.py", line 449, in _build_master
ws.require(requires)
File "/usr/lib/python3.4/site-packages/pkg_resources.py", line 745, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/lib/python3.4/site-packages/pkg_resources.py", line 639, in resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: Pillow
UPDATE: you can close the issue. I had to install the package python-pillow
When I play the song "Dangerous" by James Blunt using mocp, the only text I see is
James Blunt - Dangerous
Dangerous Songtext
I
I'm currently trying to install lyvi to use it with cmus on my Ubuntu 14.04.
After finding out that the whole process is python3 based (#34 ), I tried the following:
# download lyvi
cd ~/bin
git clone https://github.com/ok100/lyvi.git
cd lyvi
# download dependencies
sudo apt-get install python3-pip python-dbus python-gobject
sudo pip3 install cython
git clone https://github.com/sahib/glyr.git
mv glyr glyr-repo
# copy the header files so the compiler can find them
sudo cp -r glyr-repo/lib /usr/include/glyr/
sudo pip3 install plyr # /usr/bin/ld: cannot find -lglyr
For me it looks like the pip3 installation fails because it can't find the "glyr.h" which is located in ~/bin/lyvi/glyr/
and /usr/include/glyr/
.
I used the manual pip3 install <package>
instead of sudo pip3 install -r pip_requirements.txt --use-mirrors
because I wanted to make sure were exactly the error occurred.
Any help would be appreciated.
Thanks to the developers of Lyvi
I was curious where lyrics are saved by default. They seem to be saved somewhere because when offline, they still appear.
I could not solve that so I tried creating $HOME/.config/lyvi/lyvi.conf in which I placed one line:
save_lyrics:'/home/user/Music/lyvi-lyrics/'
When running lyvi, the lyrics appeared but the error below also appeared. Nothing appeared in '/home/user/Music/lyvi-lyrics/'
Exception in thread Thread-3 (get):
Traceback (most recent call last):
File "/usr/lib/python3.10/threading.py", line 1009, in _bootstrap_inner
self.run()
File "/usr/lib/python3.10/threading.py", line 946, in run
self._target(*self._args, **self._kwargs)
File "/usr/lib/python3.10/site-packages/lyvi/metadata.py", line 209, in get
setattr(self, type, data)
File "/usr/lib/python3.10/site-packages/lyvi/metadata.py", line 42, in lyrics
self.save('lyrics', lyvi.config['save_lyrics'])
File "/usr/lib/python3.10/site-packages/lyvi/metadata.py", line 146, in save
os.makedirs(os.path.dirname(file))
File "/usr/lib/python3.10/os.py", line 225, in makedirs
mkdir(name, mode)
FileNotFoundError: [Errno 2] No such file or directory: ''
Versions
$ uname -a
Linux tower 5.10.89-1-MANJARO #1 SMP PREEMPT Wed Dec 29 18:09:17 UTC 2021 x86_64 GNU/Linux
$ /usr/bin/lyvi --version
Lyvi 2.0.0, using libglyr 1.0.9
$ python -V
Python 3.10.1
Running cmus and actively playing music (or with song paused), tried calling cmus-lyrics in another window and got a traceback:
[2012.07.03]-[benito]-=(darkhouse)=-[pts/21]-[~]
[12:09:43]$ cmus-lyrics
Traceback (most recent call last):
File "/usr/bin/cmus-lyrics", line 654, in
curses.wrapper(main)
File "/usr/lib/python3.2/curses/wrapper.py", line 43, in wrapper
return func(stdscr, *args, **kwds)
File "/usr/bin/cmus-lyrics", line 592, in main
u = ui(stdscr, {'player': p, 'settings': settings})
File "/usr/bin/cmus-lyrics", line 439, in __init__
curses.init_pair(1, int(self.settings['color_title']), -1)
_curses.error: init_pair() returned ERR
Just installed cmus-lyrics through arch linux's AUR
-B
I'm using master, specifically the arch aur 'lyvi-git' package.
It fails to find lyrics for some songs that mpd ncmpcpp succeeds at.
I tried looking at the source code to figure out how lyvi finds the lyrics, but I didn't succeed.
Installing the package gives:
Traceback (most recent call last):
File "setup.py", line 3, in <module>
from pip.req import parse_requirements
ModuleNotFoundError: No module named 'pip.req'
Suggested fix looks simple
Is it possible to use pygobject instead of python-gobject?
I am using OSX 10.9 and I couldn't install python-gobject :(
setup.py
seems to rely on pip
's internal parsing tools to parse requirements from the pip_requirements.txt. However, pip
recently updated their implementation, which is likely why setup.py
fails on new versions of pip
now.
It's unclear from the documentation whether or not the save_lyrics option is intended to act as a local cache for lyrics and, perhaps, provide a local source for lyrics that do not appear in any of the providers used by glyr.
I've added save_lyrics = '/.lyric' to my lyvi.conf and it saves the lyrics as expected. If I then create a lyric file for a song that returns "No lyrics found". Lyvi does not use that file as a lyric source and thus continues to display "No lyrics found".
Is this the intended function? If so, what is the purpose of saving the lyrics locally if lyvi doesn't use the file?
Hi,
Could you please make a new release with current state? I'm writing a gentoo ebuild and this would help.
Thanks
fau
Launching lyvi now results in this series of tracebacks. I'm not sure how to remedy this. I have little experience with python, and if I need to download the 'plyr' distribution, I'm not sure where to look. Any help would be apreciated.
Traceback (most recent call last): File "/usr/bin/lyvi", line 6, in <module> from pkg_resources import load_entry_point File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3098, in <module> @_call_aside File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3082, in _call_aside f(*args, **kwargs) File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3111, in _initialize_master_working_set working_set = WorkingSet._build_master() File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 573, in _build_master ws.require(__requires__) File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 891, in require needed = self.resolve(parse_requirements(requirements)) File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 777, in resolve raise DistributionNotFound(req, requirers) pkg_resources.DistributionNotFound: The 'plyr' distribution was not found and is required by Lyvi
Some system info:
Linux ArchLinux 4.14.65-1-lts #1 SMP Sat Aug 18 12:17:05 CEST 2018 x86_64 GNU/Linux
Thank you.
Would it be possible to add a new tagged release?
I'd like to package lyvi for Void and this would help very much.
Thank you.
You should provide such list in order to avoid the user satisfying them by attempts, or using external tools just to find them.
Typing /
to search for text would be great. <CR>
then n
to cycle through matches. For instance:
/There's a starman<CR>
n
n
finds 3rd occurrence of "There's a starman".
Bonus points for case-insensitive, ignoring punctuation and newlines.
Often I find myself in lyvi with a split multiplexer pane having cmus below or next to it. I often forget which pane is left in focus and try to control cmus, only to find that that my inputs go unanswered. I'm wondering if it's feasible for lyvi to attempt to pass these commands onto the music player in some way.
Lyvi tries to look for an mpris player but I dont have any mpris player running(as far as I know) so it does not detect cmus, If I comment out the code that detect mpris it works fine.
any ideas?
def find():
"""Return the initialized player class, or None if no player was found."""
#if mpris:
# players.pop(players.index('mpris'))
if lyvi.config['default_player']:
if mpris and mpris.running(lyvi.config['default_player']):
return mpris.Player(lyvi.config['default_player'])
players.insert(0, players.pop(players.index(lyvi.config['default_player'])))
#if mpris:
# obj = mpris.find()
# if obj:
# return obj
for name in players:
obj = getattr(sys.modules[__name__], name).Player
if obj.running():
return obj()
return None
First of all, thanks for this wonderful tool.
I just wanted to say that recently, the lyrics of most of the tracks are not fetched, and it looks like a problem with glyr, see the related issue sahib/glyr#78.
I was trying to install lyvi on my Mac to run it with cmus... I have installed the dependencies pygobject and dbus using homebrew... now when I try to run this command,
sudo -H pip install -r pip_requirements.txt
I get the following error
Collecting Pillow (from -r pip_requirements.txt (line 4))
Using cached Pillow-4.3.0-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Collecting plyr (from -r pip_requirements.txt (line 5))
Using cached plyr-1.0.2.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/tmp/pip-build-_RLh7T/plyr/setup.py", line 3, in <module>
from Cython.Distutils import build_ext
ImportError: No module named Cython.Distutils
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/tmp/pip-build-_RLh7T/plyr/
I get this type of errors:
Exception in thread Thread-3:
Traceback (most recent call last):
File "/usr/lib64/python2.7/threading.py", line 810, in __bootstrap_inner
self.run()
File "/usr/lib64/python2.7/threading.py", line 763, in run
self.__target(*self.__args, **self.__kwargs)
File "build/bdist.linux-x86_64/egg/lyvi/metadata.py", line 191, in get
data = items[0].data.decode()
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 42: ordinal not in range(128)
Tested with cmus and mplayer. glyr 1.0.0, 1.0.1, plyr 1.0.2, python 2.7, 3.2 and 3.3
Hi ok100, I am using the latest version from the repository, 876c165, and lyvi is having trouble retrieving lyrics. It does not seem to matter which song is playing, anytime lyvi does the lyrics lookup it displays 'Searching...' after which it seems content with the search results and displays them. The result:
Massive Attack - Psyche
Amazon: search for... Massive Attack • Heligoland • Psyche
Hype Machine: search for... Massive Attack • Psyche
Last.fm: search for... Massive Attack • Heligoland • Psyche
Pandora: search for... Massive Attack • Psyche Wikipedia: search for... Massive Attack • Heligoland • Psyche allmusic: Psyche
MusicBrainz: Psyche
I am not sure what is going on; is this retrieved from a lyrics provider which decided to stop serving lyrics, or it an error from lyvi itself when the lookup fails.
If you have any instructions on generating some debugging information, for example with the libglyr backend, I would be happy to provide some better data.
can anyone help me to run lyvi under mac osx, thanks
Lyvi does not see any compatible players whenever I start cmus with --listen 0.0.0.0. I use cmus-remote on Android to control cmus. I cannot get lyvi to work when starting cmus --listen 0.0.0.0. Otherwise it works with no issues. Any suggestions?
Hi.
The titles containing quotes result in no lyrics being retrieved.
E.g.
Artist: Stevie Wonder
Title: Love's in Need of Love Today
The lyrics are available at least at this provider:
http://lyrics.wikia.com/Stevie_Wonder:Love%27s_In_Need_Of_Love_Today
Thank you
I'm trying to make the tmux-based arts & lyrics work and I'm having a hard time. In here it is written For other distributions, configuration and more information, see Wiki
. However the link to the Wiki ends up redirecting to the repo home, and there seems to be no Wiki.
Thanks for your time.
i installed all dependencies and lyvi fine, but when i run lyvi i get the following result on Mac OS10.9
lyrics AlException in thread Thread-1:
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 808, in __bootstrap_inner
self.run()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 761, in run
self.__target(*self.__args, **self.__kwargs)
File "/Library/Python/2.7/site-packages/Lyvi-2.0_git-py2.7.egg/lyvi/__init__.py", line 111, in watch_player
player.get_status()
File "/Library/Python/2.7/site-packages/Lyvi-2.0_git-py2.7.egg/lyvi/players/cmus.py", line 27, in get_status
for line in check_output('cmus-remote -Q').splitlines():
File "/Library/Python/2.7/site-packages/Lyvi-2.0_git-py2.7.egg/lyvi/utils.py", line 19, in check_output
return sp.check_output(command, shell=True, stderr=sp.DEVNULL).decode()
AttributeError: 'module' object has no attribute 'DEVNULL'
i can run lyvi -v fine, which results in the following
Lyvi 2.0.0, using libglyr 1.0.6
and lyvi -h results in the following
usage: lyvi [-h] [-c CONFIG_FILE] [-l] [-v] [command]
positional arguments:
command send a command to the player and exit
optional arguments:
-h, --help show this help message and exit
-c CONFIG_FILE, --config-file CONFIG_FILE
path to an alternate config file
-l, --list-players print a list of supported players and exit
-v, --version print version information and exit
Can you add tylyfy https://aur.archlinux.org/packages/tylyfy-git/ to players list?
Thanks! I like too much lyvi!
I think Lyvi should have a feature that allows one to easily refresh incorrect lyrics. #8
How can I add lyrics manually for songs which glyr
couldn't find?
Often song metadata is terrible. This causes lyvi to fail to fetch the lyrics. However, the user could easily fix the query for lyrics (or metadata) interactively if it was possible. Is this a feature that we might add to lyvi?
with mpris2 support tonnes of players will be able to utilize lyvi
artist contains word is
jör
hence
Traceback (most recent call last):
File "/usr/local/bin/lyvi", line 9, in <module>
load_entry_point('Lyvi==2.0-git', 'console_scripts', 'lyvi')()
File "/usr/local/lib/python3.3/dist-packages/Lyvi-2.0_git-py3.3.egg/lyvi/__init__.py", line 132, in main
File "/usr/local/lib/python3.3/dist-packages/Lyvi-2.0_git-py3.3.egg/lyvi/tui.py", line 261, in mainloop
File "/usr/local/lib/python3.3/dist-packages/urwid-1.1.1-py3.3-linux-x86_64.egg/urwid/main_loop.py", line 272, in run
self.screen.run_wrapper(self._run)
File "/usr/local/lib/python3.3/dist-packages/urwid-1.1.1-py3.3-linux-x86_64.egg/urwid/raw_display.py", line 242, in run_wrapper
return fn()
File "/usr/local/lib/python3.3/dist-packages/urwid-1.1.1-py3.3-linux-x86_64.egg/urwid/main_loop.py", line 337, in _run
self.event_loop.run()
File "/usr/local/lib/python3.3/dist-packages/urwid-1.1.1-py3.3-linux-x86_64.egg/urwid/main_loop.py", line 708, in run
self._loop()
File "/usr/local/lib/python3.3/dist-packages/urwid-1.1.1-py3.3-linux-x86_64.egg/urwid/main_loop.py", line 778, in _loop
self._entering_idle()
File "/usr/local/lib/python3.3/dist-packages/urwid-1.1.1-py3.3-linux-x86_64.egg/urwid/main_loop.py", line 697, in _entering_idle
callback()
File "/usr/local/lib/python3.3/dist-packages/urwid-1.1.1-py3.3-linux-x86_64.egg/urwid/main_loop.py", line 549, in entering_idle
self.draw_screen()
File "/usr/local/lib/python3.3/dist-packages/urwid-1.1.1-py3.3-linux-x86_64.egg/urwid/main_loop.py", line 563, in draw_screen
canvas = self._topmost_widget.render(self.screen_size, focus=True)
File "/usr/local/lib/python3.3/dist-packages/urwid-1.1.1-py3.3-linux-x86_64.egg/urwid/widget.py", line 141, in cached_render
canv = fn(self, size, focus=focus)
File "/usr/local/lib/python3.3/dist-packages/urwid-1.1.1-py3.3-linux-x86_64.egg/urwid/container.py", line 1058, in render
focus and self.focus_part == 'body')
File "/usr/local/lib/python3.3/dist-packages/urwid-1.1.1-py3.3-linux-x86_64.egg/urwid/widget.py", line 141, in cached_render
canv = fn(self, size, focus=focus)
File "/usr/local/lib/python3.3/dist-packages/urwid-1.1.1-py3.3-linux-x86_64.egg/urwid/decoration.py", line 564, in render
canv = self._original_widget.render((maxcol,)+size[1:], focus)
File "/usr/local/lib/python3.3/dist-packages/urwid-1.1.1-py3.3-linux-x86_64.egg/urwid/widget.py", line 141, in cached_render
canv = fn(self, size, focus=focus)
File "/usr/local/lib/python3.3/dist-packages/urwid-1.1.1-py3.3-linux-x86_64.egg/urwid/listbox.py", line 485, in render
canvas = widget.render((maxcol,))
File "/usr/local/lib/python3.3/dist-packages/urwid-1.1.1-py3.3-linux-x86_64.egg/urwid/widget.py", line 141, in cached_render
canv = fn(self, size, focus=focus)
File "/usr/local/lib/python3.3/dist-packages/urwid-1.1.1-py3.3-linux-x86_64.egg/urwid/widget.py", line 1007, in render
return apply_text_layout(text, attr, trans, maxcol)
File "/usr/local/lib/python3.3/dist-packages/urwid-1.1.1-py3.3-linux-x86_64.egg/urwid/canvas.py", line 1291, in apply_text_layout
text[s.offs:s.end])
File "/usr/local/lib/python3.3/dist-packages/urwid-1.1.1-py3.3-linux-x86_64.egg/urwid/util.py", line 121, in apply_target_encoding
s = s.encode( _target_encoding )
UnicodeEncodeError: 'latin-1' codec can't encode character '\u2022' in position 28: ordinal not in range(256)
somtimes #16
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf6 in position 2: invalid start byte
having upto date glyr plyr
On Arch Linux, Python 3.7.1
On fresh install of Lyvi, no mpris players (in my case auryo) can be found when lyvi.players
is loaded because importlib.import_module('lyvi.players.mpris')
raises an ImportError: No module named 'gi.repository'
Installing the package python-gobject solves the problem
Will it be too difficult to add support for automatic tags extraction, like %f into %a - %t?
Likewise specifying regex inside config, by which this extraction would take place, and from which tags.
Such option would allow to fetch lyrics for radio streams, which specify all tags in single one with some trash, so fetcher refuses to work.
Can you add support for xmms2?
Thanks.
$ lyvi
Lyvi only supports Python 3.
After all of the trouble that it took me to get it installed (as a Python n00b) it was quite an annoyance to realize that I had installed it into the wrong Python version. I'm attempting to maintain local python environments using pyenv (https://github.com/yyuu/pyenv).
$ pyenv versions
system
* 2.7.9 (set by /home/bambams/src/pyenv/version)
* 3.4.2 (set by /home/bambams/src/pyenv/version)
That way I know that they are up-to-date, and also it means that I can maintain personal packages distinct from distribution packages in /usr, etc. No risk harming system software with packages that I install or changes that I make within my $HOME
.
I guess that to get lyvi and its dependencies installed into the 3.4.2 environment I need to use pyenv local 3.4.2
from within the appropriate the root of the lyvi source tree and again issue pip install cython
, pip -r pip_requirements.txt
, and finally install lyvi
using python3 setup.py
. It would be nice to break the build in python2 with a descriptive error message so nobody wastes their time doing it again (a big notice in the readme(s) would help too), and it wouldn't hurt to add more detailed instructions for satisfying dependencies for those that lack experience with Python (again, emphasizing to use python3 during the whole process).
And if you personally recommend a "local python" management system then providing basic instructions for that would be handy (albeit, extra curricular) too.
I also attempted to install python-dbus and python-gobject into the 2.7.9 pyenv environment, but since neither seems to follow packaging conventions and are both simultaneously horrible to build I failed horribly. After much pain trying I realized that they were (I hope) optional. It might help to emphasize that as well (i.e., installing these is painful unless using a system python and supported distribution packages, but they're optional so don't bother unless you're sure you need them or are using the distribution packages).
Well I appear to have it running so hopefully I have nothing more than praise to say from now on. Thanks for your efforts.
Website just mentions tmux, which I only know by name. So, what exactly is it I need to show those? I'm assuming tmux, but something tells me just installing it will not be enough.
Knowing this is a support question rather than an atual bug report, I would be willing to create the documentation for future people like me who didn't get how that's supposed to work.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.