-
Notifications
You must be signed in to change notification settings - Fork 58
update lyrics library #92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,8 +8,10 @@ | |
| import textwrap | ||
| import datetime | ||
| from subprocess import Popen, PIPE | ||
| import logging | ||
| import lyriq | ||
|
|
||
| import lyricwikia | ||
| logging.getLogger("lyriq.lyriq").setLevel(logging.CRITICAL) | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this call neded?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Without it the lyriq library will print a 404 error when it does not found the song specified on it's database. So to make the logging more clean i added that call.
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok |
||
|
|
||
| from jeepney import DBusAddress, new_method_call | ||
| from jeepney.io.blocking import open_dbus_connection | ||
|
|
@@ -229,14 +231,15 @@ def show_song_short(): | |
|
|
||
| def show_lyrics(): | ||
| artist, title = get_song() | ||
| try: | ||
| lyrics = lyricwikia.get_all_lyrics(artist, title) | ||
| except lyricwikia.LyricsNotFound: | ||
| raise SpotifyCLIException( | ||
| 'Lyrics not found or could not connect' | ||
| ) from None | ||
| lyrics = ''.join(lyrics[0]) | ||
| print(lyrics) | ||
| lyrics = lyriq.get_lyrics(title, artist) | ||
|
|
||
| if lyrics is None: | ||
| # Lyrics not found | ||
|
||
| print(f"Lyrics for '{title}' by {artist} were not found.") | ||
| print("This could happen if the track is missing from the lyrics database or is unsupported.") | ||
| return | ||
|
|
||
| print(lyrics.plain_lyrics) | ||
|
|
||
|
|
||
| def show_artist(): | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this import needed?