Automatically find and download the lyrics of your current offline playing song from Spotify-Musixmatch and display it with LyricsX. Currently works only on Mac OS.
lyricsx-musixmatch.mp4
- LyricsX
- SpotiPy
- nowplaying-cli
- Syrics
- Alfred (Optional: Only if you want to run the script with a hotkey or a keyword.)
- Make sure you have LyricsX, SpotiPy and Syrics installed. Modify the .command file to add your client_id, client_secret and the path to nowplaying-cli-1.1.0.command.
- Make the .command file executable and execute it. It should do what it's supposed to do.
- Additionaly, you can add a trigger for its execution as an Alfred workflow.
It reads your current playing song using 'nowplaying-cli-1.1.0', searches for its trackID on Spotify using 'SpotiPy', downloads the corresponding .lrc lyrics file using 'Syrics', changes its extension to '.lrcx', moves it to default LyricsX folder, relaunches LyricsX for it to notice it's already got the lyrics file.
Run nohup python3 background-daemon.py
to have it running in the background. It repeatedly watches to see if you've changed your current playing song. When it detects change, it launches the fetch-lyrics-from-musixmatch.command, which fetches and shows the lyrics. It keeps watching for change until, UNTIL you stop listening to music altogether for 4 minutes. In that case it automatically breaks its loop and exits. Make sure to run the daemon again in your next listening session. Add an Alfred workflow for convenience. One is appended.
My personal Alfred workflow is appended. It needs a bit of configuring on your side. Note that in it, daemon.py
points to that same background-daemon.py
file.
![Screenshot 2023-10-12 at 16 00 12](https://private-user-images.githubusercontent.com/59469654/274598898-18a0b744-62c2-405a-9c23-03ad21c82eb1.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQxNTc2MDUsIm5iZiI6MTcyNDE1NzMwNSwicGF0aCI6Ii81OTQ2OTY1NC8yNzQ1OTg4OTgtMThhMGI3NDQtNjJjMi00MDVhLTljMjMtMDNhZDIxYzgyZWIxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODIwVDEyMzUwNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWU5ODM0NTQ5YjgzYThkZDA1YjhhYzUzMWM3ODU3MDQ0NmYxODEwN2QwOGMyYTVkMmY4ZDhkYmVhNjE2NDYwNjMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.ivhVVQkQJuFB6jkQZDw7F_7i7Qi2OX7Y6LqZ5HS07MI)