@@imdadcodes not really, I just like how well everything was explained. Although I did really like how you talked about environment variables, because beginner programmers would simply just pass the auth key directly to the class.
I have a problem, because I logged into the developer's dashboard, I created a new app, but I don't know where is API token. I will be really grateful for your help.
Hey I'm looking for a way to have python tell the spotify application on my computer to play a certain song of my choice, does anyone know if this is possible or know how to do it?
Hi love you videos however i am unable to export my Spotify token for the last step or run the program and the error is always " not recognized as an external or internal command " the same issue occurs for the other video you made as well. I am using a window 10 computer perhaps that makes a difference? Really appreciate the help thank you so much
Hi Zhu, glad you enjoyed the video 😀 Try getting the Spotify token from an input instead of setting it in the environment. So instead of `spotify_token = SpotifyClient('SPOTIFY_AUTH_TOKEN')` do: ``` spotify_token = input('Please enter your Spotify Token: ') spotify_client = SpotifyClient(spotify_token) ```
@@imdadcodes I believe that's not what he meant, I have the same problem too, but I was very confused as to which pre-commands that were necessary to export the 'SPOTIFY_AUTH_TOKEN="
Hey! So i am trying to fetch ALL playlists belonging to a user using the API. However, each api hit will only return a maximum of 50 playlists. If the user has 50+ playlists, another API call needs to be made using an offset. How do I write the logic for this? I am trying, but its turning out to be a bit hardcoded. Any insights?
Access tokens expire after one hour. This expiry time is set on Spotify's side and can't be changed by the client. You can refresh an access token if you're retrieving it using the Authorization Code flow. (The refresh token is practically valid forever, or until it has been manually revoked.) More info here: developer.spotify.com/documentation/general/guides/authorization-guide/
@@imdadcodes i have succesfully executed the code and understood it too. but i am not able to understand where to mention the value of SPOTIFY_AUTH_TOKEN...Please answer it as i am workin first time with integrating Api in my project
Hi Varun, I'm note quite sure, worth having a look at the docs here: developer.spotify.com/documentation/web-api/reference/ Do let me know what you find 👍
Hello Imdad, Fantastic tutorial. I'm getting a KeyError: 'tracks' on line 27, spotify_client.py. I'm not sure what is going wrong, but it's challenging. I'm glad I have some bugs to squash :D EDIT: print(response_json) reveals this: {'error': {'status': 401, 'message': 'Invalid access token'}}. ahhh, deeper we go lol.
@@imdadcodes This error comes because the api key expires so the json respose doesn't find the key, how do you keep refreshing the api key, the docs say that it expires every 1 hour
Hey Gabriel, Thanks 😀 Any chance you can post your question here? My Instagram is pretty flooded with messages - find it difficult to go through them all 😛
MORE SPOTIFY API TUTORIALS: ua-cam.com/video/2if5xSaZJlg/v-deo.html
you wont stop being awesome i promise, now from the notifications gang
Hey Aivin, thanks for the support and that's really awesome 💪
@@imdadcodes sorry, i meant now instead of not, really sorry
What I don't understand is this: we can download playlists, but can we add our own song to other playlists?
Fantastic video, very helpful. I'm curious: why does the program always return 20 tracks? This doesn't appear to be hardcoded anywhere?
How do i env | grev in windows cmd
Oh I finally got this to work! Thank you!
Great, what error were you having?
@@imdadcodes key error on tracks. I did not have it indented correctly
Great tutorial you deserve alot keep up brother
Thanks 😊 Will do!
it is important to note that the spoity web api only supports 30 seconds of playback.
wait what really? how come
hey can you please share the font name used here in the sublime text editor? please BTW very great video LOVED IT
hey! this is a really well made tutorial! you explained everything really well and it was enjoyable to watch!
this helped me a ton, thanks dude.
Hey man, thanks for the kind comment! Any particular bit that you really liked?
@@imdadcodes not really, I just like how well everything was explained.
Although I did really like how you talked about environment variables, because beginner programmers would simply just pass the auth key directly to the class.
Awesome, that’s good to know. I’ll keep those things in mind for the future too.
line 4 spotify_client = SpotifyClient i have a eror NameError: name 'SpotifyClient' is not defined
That's a class which we r supposed to create , as he mentioned
I have a problem, because I logged into the developer's dashboard, I created a new app, but I don't know where is API token. I will be really grateful for your help.
How do we change the code if we want an artist to play randomly from their songs?
Issue is theres apparent'y a key error with the tracks key word
Same here. print(response_json) shows that it's an invalid access token.
So good! *subscribed*
Thanks for that Samuel, next video out soon 💪
Hey I'm looking for a way to have python tell the spotify application on my computer to play a certain song of my choice, does anyone know if this is possible or know how to do it?
Hey, what monitor do you use?
Samsung U32R592
Hi love you videos however i am unable to export my Spotify token for the last step or run the program and the error is always " not recognized as an external or internal command " the same issue occurs for the other video you made as well. I am using a window 10 computer perhaps that makes a difference? Really appreciate the help thank you so much
Hi Zhu, glad you enjoyed the video 😀 Try getting the Spotify token from an input instead of setting it in the environment.
So instead of `spotify_token = SpotifyClient('SPOTIFY_AUTH_TOKEN')` do:
```
spotify_token = input('Please enter your Spotify Token: ')
spotify_client = SpotifyClient(spotify_token)
```
@@imdadcodes I believe that's not what he meant, I have the same problem too, but I was very confused as to which pre-commands that were necessary to export the 'SPOTIFY_AUTH_TOKEN="
Are you running the code from GIT Bash? That makes all the diference.
Hey! So i am trying to fetch ALL playlists belonging to a user using the API. However, each api hit will only return a maximum of 50 playlists. If the user has 50+ playlists, another API call needs to be made using an offset. How do I write the logic for this? I am trying, but its turning out to be a bit hardcoded. Any insights?
Check out this thread: stackoverflow.com/questions/39086287/spotipy-how-to-read-more-than-100-tracks-from-a-playlist
The token keeps expiring, how do you refresh it in the code?
Access tokens expire after one hour. This expiry time is set on Spotify's side and can't be changed by the client.
You can refresh an access token if you're retrieving it using the Authorization Code flow. (The refresh token is practically valid forever, or until it has been manually revoked.) More info here: developer.spotify.com/documentation/general/guides/authorization-guide/
@@imdadcodes I'm having trouble getting the refresh token, how do I do that?
Edit: I'm specifically having problems getting a redirect uri
what is you keybord name please
man, his keyboard sounds sooooo gooood!
Haha thanks
Awesome video and project, it was very helpful, thank u
Thank you, any particular bit that you liked?
Anyone got any fix for that keyError : tracks
Good Job!!
Thanks, another tutorial being published in 15 minutes 😛
@@imdadcodes i have succesfully executed the code and understood it too. but i am not able to understand where to mention the value of SPOTIFY_AUTH_TOKEN...Please answer it as i am workin first time with integrating Api in my project
Make a video on how to scrap Spotify and gaana website song
Can I play music using this api?
Hi Varun,
I'm note quite sure, worth having a look at the docs here: developer.spotify.com/documentation/web-api/reference/
Do let me know what you find 👍
NOt working
Great video but the process shudve been done vice versa😅😅
Hello Imdad,
Fantastic tutorial. I'm getting a KeyError: 'tracks' on line 27, spotify_client.py. I'm not sure what is going wrong, but it's challenging. I'm glad I have some bugs to squash :D
EDIT: print(response_json) reveals this: {'error': {'status': 401, 'message': 'Invalid access token'}}. ahhh, deeper we go lol.
Are you still facing this issue? Do you have the credentials file in the directory?
I got the same error keyError: 'tracks'
@@imdadcodes This error comes because the api key expires so the json respose doesn't find the key, how do you keep refreshing the api key, the docs say that it expires every 1 hour
Hey pal, did you figure out how to resolve this bug ?
Great video! How did it add 20 tracks even when you didn't mentioned 20 anywhere?
i think the spotify api default for a search query is set to 20 items
PLEASE EXPLAIN THE KEY ERROR
PLEASE EXPLAIN THE KEY ERROR
I assume you are getting the key error for "tracks", try and indent tracks once more. That fixed the issue for me.
Hello Imdad!
I love this video!
Please do check your Instagram chats. I need some help!
Hey Gabriel,
Thanks 😀
Any chance you can post your question here? My Instagram is pretty flooded with messages - find it difficult to go through them all 😛
@@imdadcodes Can u please tell me the terminal you are using in this video.
Sure thing, I’m using iTerm with zsh.
@@imdadcodes Can I use it on windows?
I'm not sure to be honest as I don't use Windows. If you have a search around to see iTerm is available on Windows, do let me know - quite curious 😛