mirror of
https://github.com/akashrchandran/spotify-lyrics-api.git
synced 2026-04-27 10:05:53 +03:00
[GH-ISSUE #2] Error on Hosting the API #1
Labels
No labels
UPDATES
bug
bug
documentation
enhancement
hacktoberfest
help wanted
pull-request
question
todo
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/spotify-lyrics-api#1
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @robsw on GitHub (Oct 5, 2022).
Original GitHub issue: https://github.com/akashrchandran/spotify-lyrics-api/issues/2
/lyrics/index.php
PHP Parse error: syntax error, unexpected ':', expecting ')' in /lyrics/index.php on line 24
@akashrchandran commented on GitHub (Oct 6, 2022):
It seems that you might have edited the code, could you send screenshot of index.php at line 24.
@robsw commented on GitHub (Oct 6, 2022):
@akashrchandran commented on GitHub (Oct 6, 2022):
You're using older version of PHP, please upgrade to
PHP version >= 8.1@robsw commented on GitHub (Oct 6, 2022):
Thanks, do you have an example of the config.json correct layout?
@akashrchandran commented on GitHub (Oct 6, 2022):
The config.json is an auto generated cache file used to save token from spotify (they expire in an hour). You only need to set an environment variable
SP_DC. SP_DC is cookie which is used to to authenticate against Spotify in order to have access to the required services. you can use this guide to find it.github.com/akashrchandran/spotify-lyrics-api@9dbb9de5be/spotify.php (L9)@akashrchandran commented on GitHub (Oct 6, 2022):
I will add deployment part to the documentation (README) soon. That will make it lot easier for peeps who want to host it themselves.
@robsw commented on GitHub (Oct 6, 2022):
Thanks its generated a config.json with an accessToken but when i try to make a call with an ID or URL it says lyrics not available but they get found on your api.
@akashrchandran commented on GitHub (Oct 6, 2022):
Have you set SP_DC, otherwise the generated token will be a anonymous token (not linked to an account). You can check by opening the config.json file and checking the value of isAnonymous key. for example if token is not linked to an account the isAnonymous will be

True.If that's the case then check your SP_DC cookie and if it is correct, then delete the config.json file. It will make the script generate new token.
@robsw commented on GitHub (Oct 6, 2022):
Ah thanks, I made a mistake setting up the environment variable, its all working now thank you so much!!!