robert-alfaro / genius-lyrics Goto Github PK
View Code? Open in Web Editor NEWHome Assistant custom component for fetching song lyrics from Genius.com
Home Assistant custom component for fetching song lyrics from Genius.com
Hi,
I logged into the api with my email and I created an app and copied the access token but when I saved the configuration file it does not create a sensor like the documentation says.
I tried adding the lovelace card and it says something about the media player entity missing.
I tried refreshing the token, creating a new app and even logging in with a google account instead.
Can anyone help?
version | core-2021.9.7 |
---|---|
installation_type | Home Assistant OS |
dev | false |
hassio | true |
docker | true |
user | root |
virtualenv | false |
python_version | 3.9.7 |
os_name | Linux |
os_version | 5.10.17-v8 |
arch | aarch64 |
timezone | America/New_York |
GitHub API | ok |
---|---|
Github API Calls Remaining | 3634 |
Installed Version | 1.18.0 |
Stage | running |
Available Repositories | 913 |
Installed Repositories | 22 |
logged_in | false |
---|---|
can_reach_cert_server | ok |
can_reach_cloud_auth | ok |
can_reach_cloud | ok |
host_os | Home Assistant OS 6.4 |
---|---|
update_channel | stable |
supervisor_version | supervisor-2021.10.8 |
docker_version | 20.10.7 |
disk_total | 28.6 GB |
disk_used | 8.4 GB |
healthy | true |
supported | true |
board | rpi4-64 |
supervisor_api | ok |
version_api | ok |
installed_addons | File editor (5.3.2), Terminal & SSH (9.1.3), AirCast (3.1.1), AdGuard Home (4.2.0), eufy_security_addon (0.3.3) |
dashboards | 3 |
---|---|
resources | 14 |
views | 6 |
mode | storage |
api_endpoint_reachable | ok |
---|
ERROR (MainThread) [homeassistant.loader] No 'version' key in the manifest file for custom integration 'genius_lyrics'. As of Home Assistant 2021.6, this integration will no longer be loaded. Please report this to the maintainer of 'genius_lyrics'
Got several warnings about it. Please correct this....
Hello,
Thanks for this component it is awesome.
The problem I have, since 2022.7 HA, it's that I don't get any lyrics.
I tried to reinstall the custom component but, the same problem...
This is the error I get in HA log:
Logger: homeassistant.helpers.entity
Source: custom_components/genius_lyrics/sensor.py:211
Integration: Genius Lyrics (documentation)
First occurred: 11:36:16 (7 occurrences)
Last logged: 11:57:56Update for sensor.volumio_lyrics fails
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 515, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 710, in async_device_update
raise exc
File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/genius_lyrics/sensor.py", line 119, in update
self._genius.fetch_lyrics()
File "/config/custom_components/genius_lyrics/sensor.py", line 211, in fetch_lyrics
song = self.__genius.search_song(self.__title, self.__artist, get_full_info=False)
File "/usr/local/lib/python3.10/site-packages/lyricsgenius/genius.py", line 436, in search_song
lyrics = self.lyrics(song_url=song_info['url'])
File "/usr/local/lib/python3.10/site-packages/lyricsgenius/genius.py", line 131, in lyrics
html = BeautifulSoup(
File "/usr/local/lib/python3.10/site-packages/bs4/init.py", line 228, in init
self._feed()
File "/usr/local/lib/python3.10/site-packages/bs4/init.py", line 289, in _feed
self.builder.feed(self.markup)
File "/usr/local/lib/python3.10/site-packages/bs4/builder/_htmlparser.py", line 215, in feed
parser.feed(markup)
File "/usr/local/lib/python3.10/html/parser.py", line 110, in feed
self.goahead(0)
File "/usr/local/lib/python3.10/html/parser.py", line 178, in goahead
k = self.parse_html_declaration(i)
File "/usr/local/lib/python3.10/html/parser.py", line 269, in parse_html_declaration
self.handle_decl(rawdata[i+2:gtpos])
File "/usr/local/lib/python3.10/site-packages/bs4/builder/_htmlparser.py", line 160, in handle_decl
self.soup.endData(Doctype)
File "/usr/local/lib/python3.10/site-packages/bs4/init.py", line 365, in endData
self.object_was_parsed(o)
File "/usr/local/lib/python3.10/site-packages/bs4/init.py", line 370, in object_was_parsed
previous_element = most_recent_element or self._most_recent_element
File "/usr/local/lib/python3.10/site-packages/bs4/element.py", line 1054, in getattr
return self.find(tag)
File "/usr/local/lib/python3.10/site-packages/bs4/element.py", line 1292, in find
l = self.find_all(name, attrs, recursive, text, 1, **kwargs)
File "/usr/local/lib/python3.10/site-packages/bs4/element.py", line 1313, in find_all
return self._find_all(name, attrs, text, limit, generator, **kwargs)
File "/usr/local/lib/python3.10/site-packages/bs4/element.py", line 528, in _find_all
strainer = SoupStrainer(name, attrs, text, **kwargs)
File "/usr/local/lib/python3.10/site-packages/bs4/element.py", line 1610, in init
self.text = self._normalize_search_value(text)
File "/usr/local/lib/python3.10/site-packages/bs4/element.py", line 1615, in _normalize_search_value
if (isinstance(value, str) or isinstance(value, collections.Callable) or hasattr(value, 'match')
AttributeError: module 'collections' has no attribute 'Callable'
Any help?
Love this integration and I hope it can be just a bit more awesome with this:
Currently the lyrics entity has the following attributes:
media_artist:
media_title:
media_lyrics:
friendly_name:
Would it be possible to add one more attribute with the url to the album art? On genius.com I find next to the lyrics also an image of the album art, like this one https://t2.genius.com/unsafe/327x327/https%3A%2F%2Fimages.genius.com%2Ff1f8afb7f05089e0c2f1e2fd234c37c1.1000x998x1.jpg
which is from this song https://genius.com/Supertramp-breakfast-in-america-lyrics
I (and perhaps other people also) would like to display this album art on the dash.
Many thanks for still supporting this integration.
first -- awesome custom component. I was just going to sit down and write one myself and saw yours! Excited to get it up and running...
I have the component added and configuration in place -- on restart the "lyrics sensor" is auto created, but when a new song is started, the lyrics remain "null". Artist and Title attributes populate on the "lyrics sensor", but the lyrics do not.
In the logs, each new song invokes this error: "Missing artist and/or title", but like i noted above, the sensor does have correct information pulled from the media_player.
When I try and invoke the service from dev tools with the example JSON data in github ("Mind of a King"), I get a different error: "search_lyrics. 'bool' object is not callable":
Failed to call service genius_lyrics/search_lyrics. 'bool' object is not callable
'bool' object is not callable
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 133, in handle_call_service
connection.context(msg),
File "/usr/src/homeassistant/homeassistant/core.py", line 1236, in async_call
await asyncio.shield(self._execute_service(handler, service_call))
File "/usr/src/homeassistant/homeassistant/core.py", line 1263, in _execute_service
await self._hass.async_add_executor_job(handler.func, service_call)
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
TypeError: 'bool' object is not callable
Hello! Just a quick one - I've just installed genius-lyrics
- and it's fantastic!
The one thing I've noticed though - it's prepending <song title> Lyrics
to the start of the lyrics which looks a tad strange.
I'm not sure if it's an issue with the underlying lyricsgenius
library but being as I've only used it here, I didn't think it fair to raise an issue there first ๐
not working after update :(
Supplying the platform with a list of media_player entities would enable tracking of each player to allow the genius-lyrics
component to automatically search content and update sensors. Additionally, the sensors can be created from the platform instead of user created template sensors.
Add support for using custom_updater
component
Hi, I found this entry in the Home Assistant log file asking to be reported to the author. I believe that means I have to create this ticket here.
Logger: homeassistant.helpers.entity
Source: helpers/entity.py:583
First occurred: 09:10:21 (3 occurrences)
Last logged: 09:10:21
Entity sensor.keuken_lyrics (<class 'custom_components.genius_lyrics.sensor.GeniusLyricsSensor'>) implements device_state_attributes. Please report it to the custom component author.
Had this working a few days ago but had to rebuild some stuff and lost it. During the rebuild, I did update to core-2022.4.1 so that may have played a part in my troubles. I'm still fairly new at this so it is also possible I'm overlooking something obvious.
Logger: homeassistant.helpers.template
Source: helpers/template.py:1828
First occurred: 11:38:37 AM (72 occurrences)
Last logged: 11:47:55 AM
Template variable warning: 'homeassistant.util.read_only_dict.ReadOnlyDict object' has no attribute 'media_artist' when rendering '## {{ states.sensor.kitchen_lyrics.attributes.media_artist }} - {{ states.sensor.kitchen_lyrics.attributes.media_title }} {{ states.sensor.kitchen_lyrics.attributes.media_lyrics }}'
Template variable warning: 'homeassistant.util.read_only_dict.ReadOnlyDict object' has no attribute 'media_title' when rendering '## {{ states.sensor.kitchen_lyrics.attributes.media_artist }} - {{ states.sensor.kitchen_lyrics.attributes.media_title }} {{ states.sensor.kitchen_lyrics.attributes.media_lyrics }}'
Template variable warning: 'homeassistant.util.read_only_dict.ReadOnlyDict object' has no attribute 'media_lyrics' when rendering '## {{ states.sensor.kitchen_lyrics.attributes.media_artist }} - {{ states.sensor.kitchen_lyrics.attributes.media_title }} {{ states.sensor.kitchen_lyrics.attributes.media_lyrics }}'
Logger: homeassistant.helpers.template
Source: helpers/template.py:1840
First occurred: 11:33:09 AM (6 occurrences)
Last logged: 11:33:09 AM
Template variable error: 'None' has no attribute 'attributes' when rendering '## {{ states.sensor.kitchen_lyrics.attributes.media_artist }} - {{ states.sensor.kitchen_lyrics.attributes.media_title }} {{ states.sensor.kitchen_lyrics.attributes.media_lyrics }}'
Template variable error: 'None' has no attribute 'attributes' when rendering '## {{ states.sensor.kitchen_lyrics.attributes.media_artist }} - {{ states.sensor.kitchen_lyrics.attributes.media_title }} {{ states.sensor.kitchen_lyrics.attributes.media_lyrics }}'
hi,
version 0.155.2
dosent work.
will not generate the foomedia player
In the latest release of the core, core 2021.6.3, genius-lyrics integration stopped working. I had to remove the genius configuration linesfrom the configuration.yaml to restart the server.
First of all I want to express my gratitude for the creator of this very nice piece of software. I have used it now for a year or so and love it.
I do get a fair number of false hits, where quite common songs are not found in the genius database. Instead it finds some non song text pieces of text which appear book chapters or lists. I noticed this is almost always the case when the song title had a hyphen "-" followed by some text like "live at..." or "featuring...", "Remastered", etc. When searching manually on the Genius webpage, I get the same results.
I think if the software uses only the first part of the song title until the hyphen, and would ignore the rest, the success rate of finding a proper song text would increase a lot.
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.