akashrchandran / spotify-lyrics-api

A Rest API for fetching lyrics from Spotify which is powered by Musixmatch. Commandline version is available at akashrchandran/syrics.
http://github.akashrchandran.in/spotify-lyrics-api/
GNU General Public License v3.0
348 stars 28 forks source link

API stopped working #26

Closed yagdev closed 8 months ago

yagdev commented 9 months ago

As of 28/9 the API no longer works.

Springhunk commented 9 months ago

I thought it was my network that's causing the error, the API no longer works.

yagdev commented 9 months ago

I thought it was my network that's causing the error, the API no longer works.

It's funny because it was the day after I finished my project. Regardless, I am trying to understand how the updated spotify api works, but so far I discovered that lyric-related responses from requests made by the Spotify Web Client remain the same format as the ones on the API. I now plan on discovering how to make requests to this API directly.

yagdev commented 9 months ago

Okay so after further research, to query https://spclient.wg.spotify.com/color-lyrics/v2/track/(trackid)/, the required headers and values are: 'accept'='application/json' 'app-platform'='Win32' 'authorization'='Bearer (token)'

Where it says (token), replace it with the value https://open.spotify.com/get_access_token?reason=transport&productType=web_player gives you for accessToken.

Lambada10 commented 9 months ago

@yagdev any way to make it return .lrc format?

yagdev commented 9 months ago

@yagdev any way to make it return .lrc format?

I haven't experimented with that in particular, but I assume you can by changing a header. You can do further research into this by analyzing the Spotify app's HTTP requests made to https://spclient.wg.spotify.com/color-lyrics/v2/track/ with fiddler everywhere (to achieve this play a song with lyrics and make sure to press on the lyrics button on the Spotify app.

maxrave-dev commented 9 months ago

@yagdev any way to make it return .lrc format?

I haven't experimented with that in particular, but I assume you can by changing a header. You can do further research into this by analyzing the Spotify app's HTTP requests made to https://spclient.wg.spotify.com/color-lyrics/v2/track/ with fiddler everywhere (to achieve this play a song with lyrics and make sure to press on the lyrics button on the Spotify app.

I use Web API to get Authentication AccessToken but when I get https://spclient.wg.spotify.com/color-lyrics/v2/track/ request, it always return 403 error. How to fix?

akashrchandran commented 9 months ago

Hey, my bad for the delayed response—I've been caught up in real life stuff. I've just kicked the dynos back into action, updating the account in the process. Quick heads up, though—Spotify rolled out a policy tweak. Free accounts don't get full access to all lyrics anymore; you'll need premium for that. Check out the info below for more details! Some song lyrics are still accessible for free.

image

https://www.theverge.com/2023/9/5/23860124/spotify-lyrics-premium-only-feature https://techcrunch.com/2023/09/05/spotify-lyrics-free-tier-premium-test/


Hey, if anyone's got a premium account they're willing to share for the API, shoot me a message!

iammohammedaamir commented 9 months ago

It is possible to add itunes link support?

akashrchandran commented 9 months ago

It is possible to add itunes link support?

I have commented on the issue you had opened. https://github.com/akashrchandran/syrics-web/issues/12#issuecomment-1742601882

yagdev commented 9 months ago

Hey, my bad for the delayed response—I've been caught up in real life stuff. I've just kicked the dynos back into action, updating the account in the process. Quick heads up, though—Spotify rolled out a policy tweak. Free accounts don't get full access to all lyrics anymore; you'll need premium for that. Check out the info below for more details! Some song lyrics are still accessible for free.

image

https://www.theverge.com/2023/9/5/23860124/spotify-lyrics-premium-only-feature https://techcrunch.com/2023/09/05/spotify-lyrics-free-tier-premium-test/

Hey, if anyone's got a premium account they're willing to share for the API, shoot me a message!

I wonder if they'll implement the check on the API end or just the client end...

aviwad commented 9 months ago

I bet they'll check on the API end. Probably check if the account associated with the token is subscribed to Premium or not. For now the API has started working again though....

yagdev commented 9 months ago

I bet they'll check on the API end. Probably check if the account associated with the token is subscribed to Premium or not. For now the API has started working again though....

If you don't mind could you tell me what happened to your API to make it stop working?

aviwad commented 9 months ago

my API? i'm using this repo's api in my project (more specifically, @akashrchandran's heroku instance). what do you mean my api?

yagdev commented 9 months ago

my API? i'm using this repo's api in my project (more specifically, @akashrchandran's heroku instance). what do you mean my api?

Oh sorry, I mistook you for the repo owner

akashrchandran commented 9 months ago

If you don't mind could you tell me what happened to your API to make it stop working?

The API stopped working because the old token expired. I didn't notice it had expired because I was focused on my exams and wasn't online that much. But now I have replaced it with a new one.

I am still using a token from my free account, so API has limited Free tier lyrics. If you have a premium account then you can either host the API yourself or share the token with me. I will add it to the public API.

yagdev commented 9 months ago

If you don't mind could you tell me what happened to your API to make it stop working?

The API stopped working because the old token expired. I didn't notice it had expired because I was focused on my exams and wasn't online that much. But now I have replaced it with a new one.

I am still using a token from my free account, so API has limited Free tier lyrics. If you have a premium account then you can either host the API yourself or share the token with me. I will add it to the public API.

Thanks for the reply!

I unfortunately use Spotify free though, so I can't share a premium token, but if I ever get access to one I'll make sure to share it with you so you can add it to the API. I'd also like to report a strange finding I've made on the Spotify API (I am pulling directly from Spotify now), which is that some weeks ago a lot of songs stopped having their lyrics available, but for some reason sometimes (like twice a day) I'm able to get them through the API.

Paxsenix0 commented 9 months ago

Hello! @yagdev @akashrchandran @maxrave-dev (sorry for tag)

I'm beginner and doing some searching and i have found MusixMatch API for getting synced lyrics, and i'm trying making it in php. I have it done, you can check my repo :)

https://github.com/Paxsenix0/MusixMatch-Lyrics

And big thanks to @akashrchandran for making spotify lyrics api! :)

maxrave-dev commented 9 months ago

Hello! @yagdev @akashrchandran @maxrave-dev (sorry for tag)

I'm beginner and doing some searching and i have found MusixMatch API for getting synced lyrics, and i'm trying making it in php. I have it done, you can check my repo :)

https://github.com/Paxsenix0/MusixMatch-Lyrics

And big thanks to @akashrchandran for making spotify lyrics api! :)

How do you research the API?

Paxsenix0 commented 9 months ago

How do you research the API?

I'm doing research on Github, and found this https://github.com/fashni/MxLRC https://github.com/0x7d4/syncedlyrics

So i'm trying to make it on php :)

yagdev commented 9 months ago

Hello! @yagdev @akashrchandran @maxrave-dev (sorry for tag)

I'm beginner and doing some searching and i have found MusixMatch API for getting synced lyrics, and i'm trying making it in php. I have it done, you can check my repo :)

https://github.com/Paxsenix0/MusixMatch-Lyrics

And big thanks to @akashrchandran for making spotify lyrics api! :)

Hey! I definitely appreciate your efforts, but something has me confused. If I recall correctly, didn't MusixMatch have lots of limits for free API usage and if so, how did you bypass those? (Synced lyrics were not a free feature I think)

Paxsenix0 commented 9 months ago

Hey! I definitely appreciate your efforts, but something has me confused. If I recall correctly, didn't MusixMatch have lots of limits for free API usage and if so, how did you bypass those? (Synced lyrics were not a free feature I think)

If I'm not mistaken, to get the lyrics / search track, require parameter usertoken

And for doing this i need to doing request to this url

https://apic-desktop.musixmatch.com/ws/1.1/token.get?app_id=web-desktop-app-v1.0

and i will get response like this

{
  "message": {
    "header": {
      "status_code": 200,
      "execute_time": 0.757,
      "pid": 35,
      "surrogate_key_list": []
    },
    "body": {
      "user_token": "231007a34e149af2971c68af864dca419f440b4ada543546fceb6e",
     ....
      "app_config": {
         ....
        "missions": {
          "enabled": true,
          "community": [
            "all",
            "contribute_section"
          ]
        }
.....
     }
}

And If i'm not mistaken, this token will expire after 10 minutes.

Correct me if i wrong, because i still beginner:)

maxrave-dev commented 9 months ago

Hey! I definitely appreciate your efforts, but something has me confused. If I recall correctly, didn't MusixMatch have lots of limits for free API usage and if so, how did you bypass those? (Synced lyrics were not a free feature I think)

If I'm not mistaken, to get the lyrics / search track, require parameter usertoken

And for doing this i need to doing request to this url

https://apic-desktop.musixmatch.com/ws/1.1/token.get?app_id=web-desktop-app-v1.0

and i will get response like this

{
  "message": {
    "header": {
      "status_code": 200,
      "execute_time": 0.757,
      "pid": 35,
      "surrogate_key_list": []
    },
    "body": {
      "user_token": "231007a34e149af2971c68af864dca419f440b4ada543546fceb6e",
     ....
      "app_config": {
         ....
        "missions": {
          "enabled": true,
          "community": [
            "all",
            "contribute_section"
          ]
        }
.....
     }
}

And If i'm not mistaken, this token will expire after 10 minutes.

Correct me if i wrong, because i still beginner:)

Thanks for your research. It's working. Cheers 🥂

Paxsenix0 commented 9 months ago

Thanks for your research. It's working. Cheers 🥂

You're welcome! 🥂

maja0270558 commented 9 months ago

Hey @Paxsenix0 good job. but I saw MusixMatch API free user can only access to 30% of lyrics per song is that ture?

maxrave-dev commented 9 months ago

Thanks for your research. It's working. Cheers 🥂

You're welcome! 🥂

I have tried to find translations API, but I found nothing. Did you know any references @Paxsenix0 ?

Paxsenix0 commented 9 months ago

I have tried to find translations API, but I found nothing. Did you know any references @Paxsenix0 ?

Sorry, but i didn't get any references, i'm also tried to find, but the translate result is weird. :/

but if i found one, I'll let you know

Paxsenix0 commented 9 months ago

Hey @Paxsenix0 good job. but I saw MusixMatch API free user can only access to 30% of lyrics per song is that ture?

Hmm, i can't say is that true or not, but so far I got the full lyrics and it was synched.

PeterStark000 commented 8 months ago

Apparently, the API has stopped providing song lyrics :(, but I believe there's a way to scrape lyrics for free using a token from a free account. I use a modified version of Spotify called Spicetify, which gives me extensions and lets me see the lyrics of songs. image

alecvl08 commented 8 months ago

@akashrchandran The API is up now but I get "lyrics for this track is not available on spotify!" for about 98% of responses starting sometime in the last week. Is this related to the Spotify account being free and not premium? Would you be willing to buy a premium account if people contributed money for it? I have invested significantly in a project that relies heavily on this API, so it would be unfortunate for that to go to waste. Thanks

yagdev commented 8 months ago

@akashrchandran The API is up now but I get "lyrics for this track is not available on spotify!" for about 98% of responses starting sometime in the last week. Is this related to the Spotify account being free and not premium? Would you be willing to buy a premium account if people contributed money for it? I have invested significantly in a project that relies heavily on this API, so it would be unfortunate for that to go to waste. Thanks

I have noticed that Spotify in general has lost a lot of song lyrics. This is not something related to the way I've programmed my API in my usage, so I assume this is the same with this project, but it mirrors the lyrics availability of the normal Spotify client.

akashrchandran commented 8 months ago

Please check the issue #29