Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,12 @@ if you don't use any parameters, you'll enter the shell mode, where you'll be ab
solving problems
----------------

### lyricwikia
### lyriq

When, you're missing `lyricwikia` dependency, run the following command:
When, you're missing `lyriq` dependency, run the following command:

```
pip install lyricwikia
pip install lyriq
```

usage with tmux
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
autopep8
jeepney
lyricwikia
lyriq
pycodestyle
pylint
setuptools
Expand Down
20 changes: 11 additions & 9 deletions spotifycli/spotifycli.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
import textwrap
import datetime
from subprocess import Popen, PIPE
import logging
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this import needed?

import lyriq

import lyricwikia
logging.getLogger("lyriq.lyriq").setLevel(logging.CRITICAL)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this call neded?

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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.

Copy link
Owner

Choose a reason for hiding this comment

The 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
Expand Down Expand Up @@ -229,14 +231,14 @@ 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:
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():
Expand Down
Loading