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

App won't open #2

Closed
jakecolon3 opened this issue Jul 3, 2024 · 11 comments
Closed

App won't open #2

jakecolon3 opened this issue Jul 3, 2024 · 11 comments
Labels
bug Something isn't working

Comments

@jakecolon3
Copy link

jakecolon3 commented Jul 3, 2024

Describe the bug
I found and set my client ID in the settings.ini file, but when I run the exe this tab opens in my browser (Firefox):
"https://accounts.spotify.com/authorize?client_id=<my client id here, don't know if it's dangerous to share>&response_type=code&redirect_uri=http%3A%2F%2Flocalhost%3A8888%2Fcallback&code_challenge_method=S256&code_challenge=CpfoBs8911s7h-Jbmh-n3P8WXaDe9Wyor1wMJgnVdKA&scope=user-read-currently-playing"

which displays in plain text:
"INVALID_CLIENT: Invalid client".

Nothing else happens.

Expected behavior
The app opens and works as expected.

Real behavior
The app doesn't open.

To Reproduce
List the steps needed to reproduce the bug:

  1. Set your client ID.
  2. Run the exe.

Context/Environment
Write here the information about the environment in which the bug happens, such as:

  • Your operating system: Windows 11
  • Your python version: Python 3.12.0

Screenshots
If applicable, add screenshots to help explain your problem.
image

Additional context
I am using Firefox and a cracked Spotify client (BlockTheSpot), but it also doesn't seem to work if I have the web player open.

@jakecolon3 jakecolon3 added the bug Something isn't working label Jul 3, 2024
@jakecolon3
Copy link
Author

jakecolon3 commented Jul 3, 2024

Alright I figured out I needed to remove the <> from around the id, but now it's giving me a different error:

image

Traceback (most recent call last):
  File "spotipy\oauth2.py", line 923, in get_access_token
  File "requests\models.py", line 1021, in raise_for_status
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://accounts.spotify.com/api/token

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "main.py", line 4, in <module>
  File "gui.py", line 41, in __init__
  File "spotify_client.py", line 15, in create_spotify_client
  File "spotipy\oauth2.py", line 929, in get_access_token
  File "spotipy\oauth2.py", line 146, in _handle_oauth_error
spotipy.oauth2.SpotifyOauthError: error: invalid_client, error_description: Invalid client

This happens both on the app and on the web player.

@Mews
Copy link
Owner

Mews commented Jul 6, 2024

Can you show what's inside your settings.ini file? You can include the client id its not sensitive info but if you don't want to just delete some random characters from it

@jakecolon3
Copy link
Author

jakecolon3 commented Jul 6, 2024

Here's my settings.ini file:

[theme]
; available themes: https://ttkbootstrap.readthedocs.io/en/latest/themes/
theme = cyborg

[spotify]
client_id = f9519738aec64ab5ac6d3a992eed328a
redirect_uri = http://localhost:8888/callback

[lyrics]
empty_lyric_replacement = ♫

@Mews
Copy link
Owner

Mews commented Jul 7, 2024

That's weird, I can't replicate this error.
In fact, when I try using your client id I can authenticate without any issues. After that it crashes because my spotify account isn't registered on your app, but the step that's failing for you isn't failing for me.
I don't know if its an issue with the spotify api wrapper I'm using, I'll have to come back to this later on, but for now I'll try to add a workaround so that you can use the app 👍

@jakecolon3
Copy link
Author

My mom acrually got a premium duo plan out of nowhere the other day so I don't need the app anymore, don't worry about the workaround.
Thank you anyways, good luck on fixing the issue!

@Mews
Copy link
Owner

Mews commented Jul 7, 2024

I'll add the workaround anyway if anyone has the same issue lol but good for you :)

@Mews
Copy link
Owner

Mews commented Jul 7, 2024

Wait did you maybe copy your client secret instead of your client id?
If so that explains it, but also please change it asap in the dashboard as that is sensitive info

@Mews
Copy link
Owner

Mews commented Jul 7, 2024

Also another thing you can try is deleting the .cache file and trying again

@Mews
Copy link
Owner

Mews commented Jul 7, 2024

If none of that works, as of v0.6.0 you can also authenticate the app using your client secret.
Just copy your client secret from the same page where you got your client id and add it to the settings.ini file in front of client_secret =

Caution

Your client secret is very sensitive information and you should be very careful with it, so only do this if the other options fail 👍

Also I still haven't been able to replicate the error so I'm not 100% sure this will fix the issue.
I'll close it for now but if anyone runs into this again please comment here :)

@Mews Mews closed this as completed Jul 7, 2024
@justalittlemango
Copy link

Although the client secret is placed in your settings.ini file, it doesn't work if your localhost is at 8888, so what I did to enable it was to change the redirect URI from http://localhost:8888/callback to like e.g. http://localhost:8080. You still have to manually edit it in the developer page of Spotify and the settings.ini file. What I do think atm is that prolly the localhost:8888 could be used by other services though since I'm running a VM alongside Windows 11 and that apparently happened. Hope this helps a lot!

@Mews
Copy link
Owner

Mews commented Jul 8, 2024

Oh I didn't think of that yeah maybe the 8888 port is already used by something else :P
Thanks for the comment ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants