OnKey only listens to what you play through your other apps, then it uses what it's heard to learn the notes and then discards the song and never saves it to disk.
This means that you need to let it listen to the song the first time it plays. You can sing to that song blind (no pitch track) and it will still score you at the end.
What I do is let it listen while a playlist plays through, then when I re-listen it lines up the pitch track with the music as it plays through my music source again.
IANAL, but I think that by listening to the music that people already have access to through their subscriptions, not distributing any music, lyrics, or learned melodies i.e. keeping everything for personal use only (see https://github.com/dsmurrell/onkey#using-onkey-fairly), rights aren't required.
I might do the ranking thing later but this brings some form of centralisation to the project which it currently doesn't have, and I haven't worked out how to stop people gaming that.