Fetches the currently playing song from Spotify on Windows, Linux and macOS and displays the lyrics in the command-line, browser tab or in a desktop application.
Refreshes automatically when song changes. The lyrics are fetched from Genius.
Turns out Deezer already has this feature in-built but with swaglyrics
, you can have it in Spotify as well.
I'm mainly trying to build this project as far as I can, for practice and to learn and work with more technologies and platforms.
Initially developed this for personal use. Pretty much functionality oriented -- I usually develop something that I can see helping me and other users in the same situation. Packaged so I can first hand handle production-ready code to an extent and to make distribution and usage easier.
SwagLyrics is the fastest and the most accurate package for getting lyrics.1
Provided optimal internet, SwagLyrics can fetch lyrics for a track in as less as 0.28s.2
It also does not require the user to generate any sort of API token (Spotify or Genius) and serves functionality right off the bat. This is possible as the song identification is done using our in-house library SwSpotify which does it locally for all operating systems.
The enhanced user experience is possible due to the backend which manages creating issues for unsupported songs and then adding support for them where possible by employing various techniques. Any song with lyrics on Genius can be supported without any user interaction owing to the backend. If say, lyrics do not exist for a track then subsequent playings of that track will not waste your resources in trying to fetch lyrics, this is done by a master list of unsupported songs which is handled by the backend as well.
Requires Python 3.6+. Use pip or pip3 depending on your installation. You might want to use the --user
flag on Linux to
avoid using pip as root.
pip install swaglyrics
Arch Linux users can directly install SwagLyrics from AUR (swaglyricsAUR). Using yay
:
yay -S swaglyrics
Nix users on any Linux distro and NixOS can install SwagLyrics from Nixpkgs.
nix-env -i swaglyrics
usage: swaglyrics [-h] [-t] [-c] [-n]
Either the tab or cli argument is required to output lyrics.
Arguments:
-h, --help show this help message and exit
-t, --tab Display lyrics in a browser tab.
-c, --cli Display lyrics in the command-line.
-n, --no-issue Disable issue-making on cli.
You can quit by pressing Ctrl+C.
Before using, you should check USING.txt to comply with the Genius ToS. There's a copy included inside the package as well.
Note: If you have trouble displaying Japanese/Chinese characters on the command-line, simply type chcp 936
to change your code page. List of code pages can be found here: https://en.wikipedia.org/wiki/Code_page
See CHANGES.md for prior release notes.
git clone https://github.com/SwagLyrics/SwagLyrics-For-Spotify.git
or use ssh.cd
into the cloned repo.pip install -e .
the -e flag installs it locally in editable mode.