Coder Social home page Coder Social logo

aviwad / lyricfever Goto Github PK

View Code? Open in Web Editor NEW
56.0 2.0 3.0 59.28 MB

Spotify & Apple Music Lyrics app for macOS menubar (spiritual successor to LyricsX)

Home Page: https://lyricfever.com

License: MIT License

Swift 100.00%
lyrics macos spotify swiftui apple-music applescript menubar menubar-app menubarapp menubarextra musickit swift

lyricfever's Introduction

Lyric Fever

Logo

Live Spotify & Apple Music lyrics in your macOS menubar. It Just Works.

Downloads

Download from releases.

Requirements

  • macOS Ventura or higher
  • Spotify Desktop Client (if using Spotify)

Features

  • It Just Works.
  • Offline caching! Lyrics are automatically stored offline efficiently using CoreData
  • Play some music on the Spotify / Apple Music app and watch the lyrics play on the menu bar automatically.

Screenshots

First Screenshot

Second Screenshot

Technical Details

  • UI is built using SwiftUI.
  • The lyrics are updated and fetched using Swift Concurrency and Swift Tasks
  • The lyrics are stored into disk using CoreData.
  • I interface with Spotify & Apple Music using their AppleScript methods as well as by subscribing to their playback state change notifications.
  • I interface with Spotify and Apple Music's AppleScript methods by using Apple's provided ScriptingBridge interface.
  • I additionally use private APIs to get the currently playing Apple Music song's iTunes ID, and use MusicKit to map that to an ISRC code
  • I map Apple Music songs to equivalent Spotify ID using ISRC to display Lyrics fetched from Spotify for either platform
  • Spiritual successor to LyricsX (95% more efficient, 0.1% CPU usage of Lyric Fever vs 3% of LyricsX)
  • Technical write-up coming soon

Acknowledgements / Special Thanks

lyricfever's People

Contributors

aviwad avatar

Stargazers

Narasimha Yaddanapudi avatar  avatar HoHoHo avatar Quốc Khánh avatar Leon Lee avatar 代码即是地狱 avatar  avatar Juan Alvarez avatar  avatar likeai avatar Lee avatar  avatar Kami avatar Junkai Zheng avatar  avatar  avatar Fangzheng Lin avatar 名前ないし avatar Nick Imanzi avatar Adil Akhmetov avatar Sergio Soto avatar ramit ^-^ avatar 小新 avatar  avatar Saurav Banna avatar Lu yun avatar  avatar  avatar Miraculous Owonubi avatar Carlos Valencia avatar KissShot avatar ᴊᴜʟɪᴇ ʟᴀᴍ avatar Gabriel Napoleão avatar Karl Lee avatar  avatar 枯白子 avatar Oliver Busch avatar Paul Lardet avatar Luis Toledo avatar Russian Rebouças avatar romp6032 avatar Reynard avatar Sean Lee avatar  avatar  avatar Pedro Navarrete avatar Sailing avatar Peter avatar Aris Setiawan avatar  avatar  avatar  avatar  avatar Narcis avatar  avatar C. Mazaya avatar

Watchers

Miraculous Owonubi avatar  avatar

lyricfever's Issues

CHANGE LYRIC PROVIDER

the main heroku instance run by the spotify-lyric-api guy is basically shut. need to host my own spotify-lyric-api server asap.

Apple Music inefficient behaviour

Lyric Fever on Spotify: 0.1 to 1% CPU usage
Lyric Fever on Apple Music: 0.1 to 6% CPU usage
The lyric updater is duplicating in xcode logs. don't know why.

[Help Needed] Translation support

Need to start translating the menu bar strings as well as the onboarding window strings. In all the languages App Store and LyricsX (the ancestor) supports.

Lyrics Content Translation

Check for network calls made on Spotify on iOS and enable translated lyrics. Alternatively, use third party API to translate the lyrics. Enable option to display these translated lyrics instead of original (where translation required).

Can't read Spotify track if playing before application is opened

No spotify distributed notification available if song was already playing before the app is opened. Using the LyricsX MusicPlayer API is garbage because no data for currentTrack is returned. A solution could be to use AppleScript to read the Spotify current track on init.

Feature request: "Subtitles" mode

Awesome work! I've only been using it for 30 minutes and I already love your app. One feature I would love to have would be displaying the lyrics as "subtitles", similar to how LyricsX does. That is, "floating", windowless text that can be dragged around the screen and displays on top of all other apps.

Improve onboarding experience

Prevent Spotify and Apple Music from opening up on first use. Detect permissions in onboarding before continuing. Remove crossfades info page (not necessary.)

Title doesn't show for a long lyrics

I found a new issue in here:
image
So, if the lyrics it's too long, it will not appear.

I think it will be hard to do the code where the lyrics isn't timestamp per word :D

Anyway, on the tiktok Music it can appear like this, the lyrics will be slowly moving to left (I didn't use if because the sound quality isn't great for me)
image

Apple Music support

integrate apple music applescript + usernotifications -> convert apple music id to ISRC -> use spotify api to convert to spotify ID

More efficient lyric change

Instead of a 1 second timer running during song (with lyric) playback, instead update the index on the next lyric's timestamp. the only problem is i can't receive any notification for the user scrubbing the playback position during playback, and so a timer is necessary. perhaps a combination of using the lyric's timestamp to maintain a timeline of updates, alongside a 5 second timer to reset the timeline if the user scrubs playback

prevent concurrent lyrics fetching, concurrent lyrics timers

rapidly skipping through spotify leads to multiple async Tasks running in parallel, fetching lyrics for songs that were skipped in milliseconds, and then the the lyrics fetcher running the lyric updater for the song. this leads to multiple timers running in parallel, each recursively calling itself again. even calling stop does nothing. this leads to redundant timers running a few milliseconds away from each other for the same update, as well as timers spamming the CPU when the song is paused / spotify is closed

truncate song title

truncation should be enabled for song names too, or the menubarextra disappears suddenly on low space

Deal with spdc cookie expiration

The cookie expires a year after generation. Right now I don't account for this. User may be blind sided by it not working. I don't check for the cookie working or not. All access token generation errors are currently lumped together (network error, incorrect cookie, expired cookie, etc)

Potentially use Spotify cookie stored from desktop prefs file

The Spotify desktop app stores its preferences (including an "autologin blob") in ~/Library/Application Support/Spotify/prefs

Need to figure out how to decode this and use it as compared to the spDc -> auth token process I'm using right now... maybe some Wireshark sniffing?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.