brentvollebregt / spotify-lyrics-viewer

View the lyrics of the current playing Spotify song in your browser
https://spotify-lyrics-viewer.nitratine.net/
45 stars 8 forks source link

Timestamped Lyrics #4

Closed jbienz closed 3 years ago

jbienz commented 3 years ago

Hey @brentvollebregt, just curious if it would be possible to get timestamped lyrics added? It looks like Genius might not have timestamped data. Wondering if you've looked at any other data sources or how hard it might be to add it?

P.S. Thank you for your project! I'm using it in my Tesla and I posted your project on Reddit:

https://www.reddit.com/r/teslamotors/comments/l11c1e/lyrics_for_spotify/

Thanks!

brentvollebregt commented 3 years ago

If we can find a reliable data source that contains timestamped lyrics, then I would be happy to use it. I was looking at the start of this project and could not find anything that was free and reliable. Do you have any recommendations?

Also cheers for the recognition! I see a few others like it which is awesome 👍

jbienz commented 3 years ago

Ah yes, I do see the problem now.

I was able to find this list of 21 music and lyric related APIs:

https://www.programmableweb.com/category/lyrics/api

But digging into some of the most popular ones I couldn't find any that were free. It's really unfortunate that all of these services bill the consumer of the API for it's usage. Spotify does a much better job of this, billing the end user rather than the API consumer. I sign into your web page with my Spotify credentials, but Spotify is billing me and not you. I wish there was a similar option for lyrics. I'd be willing to pay some nominal fee each year to MusixMatch in order to use their capabilities in other apps.

At any rate, thanks for considering the feature. We can close this feature request for now if you like and I can follow up later if I end up finding a free service to recommend.

brentvollebregt commented 3 years ago

I'll close it for now but if someone has a good recommendation, we can re-open it 👍

morelandjo commented 1 year ago

music.163.com (chinese) has what seems to be a public free api. Unsure of any rate limits:

First you need to get a songs id:

curl --location --request GET 'http://openapi.music.163.com/api/search/get/?s=thriller&type=1&limit=10' \ --header 'Content-Type: application/x-www-form-urlencoded' \ --header 'Cookie: NMTID=00OU4tREj5nwi3W60epkNGNxb86ofsAAAGFz3rIhQ' \ --data-urlencode 'hlpretag=%3Cspan+class%3D%22s-fc56%22%3E' \ --data-urlencode 'hlposttag=%3C%2Fspan%3E' \ --data-urlencode 's=thriller' \ --data-urlencode 'type=1' \ --data-urlencode 'offset=0' \ --data-urlencode 'total=false' \ --data-urlencode 'limit=10'

returns:

image

Then get timestamped lyrics:

curl --location --request GET 'http://openapi.music.163.com/api/song/lyric?id=1999367017&lv=-1' \ --header 'Content-Type: application/x-www-form-urlencoded' \ --header 'Cookie: NMTID=00OU4tREj5nwi3W60epkNGNxb86ofsAAAGFz3rIhQ' \ --data-urlencode 'id=1999367017'

returns:

{"sgc":false,"sfy":false,"qfy":false,"transUser":{"id":33153245,"status":99,"demand":1,"userid":313363053,"nickname":"Earthquake_EQ","uptime":1668752729190},"lyricUser":{"id":33132501,"status":99,"demand":0,"userid":1499770348,"nickname":"Camendes","uptime":1668700817998},"lrc":{"version":2,"lyric":"[00:00.000] 作词 : ROD TEMPERTON\n[00:01.000] 作曲 : ROD TEMPERTON\n[00:59.25]It's close to midnight\n[01:01.49]\n[01:02.02]Something evil's lurking in the dark\n[01:05.05]\n[01:07.40]Under the moonlight\n[01:10.09]You see a sight that almost stops your heart\n[01:13.50]You try to scream\n[01:15.36]\n[01:15.97]But terror takes the sound before you make it\n[01:19.54]\n[01:21.65]You start to freeze\n[01:23.57]\n[01:24.08]As horror looks you right between the eyes\n[01:26.88]\n[01:27.40]You're paralyzed\n[01:29.04]\n[01:29.76]'Cause this is thriller thriller night\n[01:34.27]And no one's gonna save you\n[01:35.93]From the beast about to strike\n[01:37.94]You know it's thriller thriller night\n[01:42.51]You're fighting for your life inside a killer\n[01:45.67]Thriller tonight yeah\n[01:50.21]\n[01:53.29]Ooh\n[01:54.38]\n[01:56.12]You hear the door slam\n[01:58.88]And realize there's nowhere left to run\n[02:01.49]\n[02:04.22]You feel the cold hand\n[02:06.86]And wonder if you'll ever see the sun\n[02:09.58]\n[02:10.32]You close your eyes\n[02:12.92]And hope that this is just imagination\n[02:15.79]\n[02:17.53]Girl\n[02:18.55]But all the while\n[02:20.87]You hear a creature creeping up behind\n[02:23.56]\n[02:24.19]You're out of time\n[02:25.92]\n[02:26.48]'Cause this is thriller thriller night\n[02:31.04]There ain't no second chance\n[02:32.54]Against the thing with 40 eyes girl\n[02:35.33]Thriller\n[02:36.34]Ooh\n[02:36.84]\n[02:37.74]Thriller night\n[02:39.15]You're fighting for your life\n[02:40.88]Inside a killer thriller tonight\n[02:45.49]Night creatures call\n[02:46.91]And the dead start to walk in their masquerade\n[02:52.04]\n[02:53.37]There's no escaping the jaws of the alien this time\n[02:58.44]They're open wide\n[02:59.77]This is the end of your life ooh\n[03:05.15]\n[03:06.97]They're out to get you\n[03:09.60]There's demons closing in on every side\n[03:12.60]\n[03:13.62]Ooh\n[03:14.09]\n[03:15.09]They will possess you\n[03:17.76]Unless you change that number on your dial\n[03:21.05]Now is the time\n[03:23.72]For you and I to cuddle close together yeah\n[03:28.41]\n[03:29.21]All through the night\n[03:31.37]\n[03:31.87]I'll save you from the terror on the screen\n[03:34.59]\n[03:35.21]I'll make you see\n[03:36.85]\n[03:37.50]That this is thriller thriller night\n[03:41.88]'Cause I can thrill you more\n[03:43.42]Than any ghoul would ever dare try\n[03:46.46]Thriller\n[03:47.23]Ooh\n[03:47.75]\n[03:48.25]Thriller night\n[03:50.03]So let me hold you tight\n[03:51.77]And share a killer thriller chiller\n[03:54.81]Thriller here tonight\n[03:57.78]'Cause this is thriller thriller night\n[04:02.19]Girl I can thrill you more\n[04:03.87]Than any ghoul would ever dare try\n[04:06.58]Thriller\n[04:07.39]Ooh\n[04:08.00]\n[04:08.54]Thriller night\n[04:10.28]So let me hold you tight\n[04:11.75]And share a killer thriller\n[04:14.09]Vincent Price/Michael Jackson:\n[04:14.76]\n[04:21.97]I'm gonna thrill you tonight\n[04:23.51]\n[04:24.38]Darkness falls across the land\n[04:26.83]\n[04:27.99]The midnight hour is close at hand\n[04:30.56]\n[04:31.62]Creatures crawl in search of blood\n[04:34.31]\n[04:35.29]To terrorize y'all's neighborhood\n[04:37.48]\n[04:38.29]I'm gonna thrill you tonight\n[04:39.03]And whosoever shall be found\n[04:41.60]\n[04:42.46]Without the soul for getting down\n[04:45.27]\n[04:46.26]Must stand and face the hounds of hell\n[04:49.67]\n[04:50.23]And rot inside a corpse's shell\n[04:54.13]I'm gonna thrill you tonight\n[04:56.19]Thriller ooh babe\n[04:58.04]Thriller\n[04:58.27]I'm gonna thrill you tonight\n[04:59.18]Thriller night\n[05:00.02]Thriller oh darling\n[05:01.94]Oh baby\n[05:02.34]I'm gonna thrill you tonight\n[05:03.35]\n[05:04.04]Thriller\n[05:04.97]Ooh babe\n[05:06.25]Thriller night\n[05:06.53]I'm gonna thrill you tonight\n[05:08.16]Thriller\n[05:08.96]Oh darling\n[05:10.04]Oh baby\n[05:10.83]Thriller night babe\n[05:11.84]Thriller night babe\n[05:13.29]Ooh\n[05:13.78]\n[05:14.49]The foulest stench is in the air\n[05:17.15]The funk of forty thousand years\n[05:19.49]Thriller night thriller\n[05:20.53]And grisly ghouls from every tomb\n[05:23.16]\n[05:23.93]Are closing in to seal your doom\n[05:27.31]\n[05:28.30]And though you fight to stay alive\n[05:30.82]\n[05:31.62]Your body starts to shiver\n[05:34.70]I'm gonna thrill you tonight\n[05:35.57]For no mere mortal can resist\n[05:38.29]\n[05:39.32]The evil of the thriller\n[05:43.15]\n[05:44.81]Ahahahahahahahaha\n[05:47.69]Ahahahahahahahaha\n"},"code":200}

Documentation: https://developer.music.163.com/st/developer/document?docId=13ddbaab86854b18903bf73dadf84c0d