Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on Hosting the API #2

Closed
robsw opened this issue Oct 5, 2022 · 9 comments
Closed

Error on Hosting the API #2

robsw opened this issue Oct 5, 2022 · 9 comments
Labels
question Further information is requested

Comments

@robsw
Copy link

robsw commented Oct 5, 2022

/lyrics/index.php
PHP Parse error: syntax error, unexpected ':', expecting ')' in /lyrics/index.php on line 24

@akashrchandran
Copy link
Owner

It seems that you might have edited the code, could you send screenshot of index.php at line 24.

@akashrchandran akashrchandran added the unknown No idea wth it is lol label Oct 6, 2022
@robsw
Copy link
Author

robsw commented Oct 6, 2022

image

@akashrchandran
Copy link
Owner

You're using older version of PHP, please upgrade to PHP version >= 8.1

@robsw
Copy link
Author

robsw commented Oct 6, 2022

Thanks, do you have an example of the config.json correct layout?

@akashrchandran
Copy link
Owner

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.

$sp_dc = getenv('SP_DC');

@akashrchandran
Copy link
Owner

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
Copy link
Author

robsw commented 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
Copy link
Owner

akashrchandran commented 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.
image

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
Copy link
Author

robsw commented Oct 6, 2022

Ah thanks, I made a mistake setting up the environment variable, its all working now thank you so much!!!

@akashrchandran akashrchandran added question Further information is requested and removed unknown No idea wth it is lol labels Oct 7, 2022
@akashrchandran akashrchandran pinned this issue Oct 7, 2022
@akashrchandran akashrchandran changed the title index.php syntax error Error on Hosting the API Nov 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants