Automate Your Music With Python (Spotify API)

Поділитися
Вставка
  • Опубліковано 13 гру 2024

КОМЕНТАРІ • 76

  • @imdadcodes
    @imdadcodes  4 роки тому +1

    MORE SPOTIFY API TUTORIALS: ua-cam.com/video/2if5xSaZJlg/v-deo.html

  • @Aivin
    @Aivin 4 роки тому +2

    you wont stop being awesome i promise, now from the notifications gang

    • @imdadcodes
      @imdadcodes  4 роки тому +1

      Hey Aivin, thanks for the support and that's really awesome 💪

    • @Aivin
      @Aivin 4 роки тому

      @@imdadcodes sorry, i meant now instead of not, really sorry

  • @okanoner845
    @okanoner845 Рік тому

    What I don't understand is this: we can download playlists, but can we add our own song to other playlists?

  • @jackmoar1847
    @jackmoar1847 4 роки тому +3

    Fantastic video, very helpful. I'm curious: why does the program always return 20 tracks? This doesn't appear to be hardcoded anywhere?

  • @Bhishma68
    @Bhishma68 2 роки тому +1

    How do i env | grev in windows cmd

  • @kennytieshisshoes
    @kennytieshisshoes 3 роки тому +2

    Oh I finally got this to work! Thank you!

    • @imdadcodes
      @imdadcodes  3 роки тому +1

      Great, what error were you having?

    • @kennytieshisshoes
      @kennytieshisshoes 3 роки тому

      @@imdadcodes key error on tracks. I did not have it indented correctly

  • @sosweis
    @sosweis 3 роки тому +2

    Great tutorial you deserve alot keep up brother

  • @arcayisiken4291
    @arcayisiken4291 3 роки тому

    it is important to note that the spoity web api only supports 30 seconds of playback.

    • @TriStyleXI
      @TriStyleXI 3 роки тому

      wait what really? how come

  • @Abhijit_SU
    @Abhijit_SU 2 роки тому

    hey can you please share the font name used here in the sublime text editor? please BTW very great video LOVED IT

  • @stephmakeslyrics4982
    @stephmakeslyrics4982 4 роки тому

    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.

    • @imdadcodes
      @imdadcodes  4 роки тому

      Hey man, thanks for the kind comment! Any particular bit that you really liked?

    • @stephmakeslyrics4982
      @stephmakeslyrics4982 4 роки тому +2

      @@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.

    • @imdadcodes
      @imdadcodes  4 роки тому

      Awesome, that’s good to know. I’ll keep those things in mind for the future too.

  • @microgamawave
    @microgamawave 4 роки тому +2

    line 4 spotify_client = SpotifyClient i have a eror NameError: name 'SpotifyClient' is not defined

    • @navneetyadav8869
      @navneetyadav8869 3 роки тому

      That's a class which we r supposed to create , as he mentioned

  • @wookscode
    @wookscode 2 роки тому

    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.

  • @muhammet.c
    @muhammet.c 3 роки тому

    How do we change the code if we want an artist to play randomly from their songs?

  • @Apeinbape
    @Apeinbape 4 роки тому +1

    Issue is theres apparent'y a key error with the tracks key word

    • @aethelbread
      @aethelbread 4 роки тому

      Same here. print(response_json) shows that it's an invalid access token.

  • @samuelbjorkqvist2282
    @samuelbjorkqvist2282 4 роки тому +1

    So good! *subscribed*

    • @imdadcodes
      @imdadcodes  4 роки тому

      Thanks for that Samuel, next video out soon 💪

  • @Beefire
    @Beefire Рік тому

    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?

  • @anshumankomawar6863
    @anshumankomawar6863 4 роки тому +1

    Hey, what monitor do you use?

  • @hahahaha9731
    @hahahaha9731 4 роки тому +1

    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

    • @imdadcodes
      @imdadcodes  4 роки тому +1

      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)
      ```

    • @shazank7363
      @shazank7363 4 роки тому

      @@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="

    • @kennytieshisshoes
      @kennytieshisshoes 3 роки тому

      Are you running the code from GIT Bash? That makes all the diference.

  • @schezfaz
    @schezfaz 4 роки тому

    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?

    • @imdadcodes
      @imdadcodes  4 роки тому

      Check out this thread: stackoverflow.com/questions/39086287/spotipy-how-to-read-more-than-100-tracks-from-a-playlist

  • @User-re8nl
    @User-re8nl 4 роки тому +1

    The token keeps expiring, how do you refresh it in the code?

    • @imdadcodes
      @imdadcodes  4 роки тому

      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/

    • @User-re8nl
      @User-re8nl 4 роки тому

      @@imdadcodes I'm having trouble getting the refresh token, how do I do that?
      Edit: I'm specifically having problems getting a redirect uri

  • @NoONE-bk7ud
    @NoONE-bk7ud 3 роки тому

    what is you keybord name please

  • @pratheeku4467
    @pratheeku4467 4 роки тому +3

    man, his keyboard sounds sooooo gooood!

  • @machiniram
    @machiniram 4 роки тому

    Awesome video and project, it was very helpful, thank u

    • @imdadcodes
      @imdadcodes  4 роки тому

      Thank you, any particular bit that you liked?

  • @abhilashapimpalgaonkar660
    @abhilashapimpalgaonkar660 4 роки тому

    Anyone got any fix for that keyError : tracks

  • @Shonashoni1
    @Shonashoni1 4 роки тому +1

    Good Job!!

    • @imdadcodes
      @imdadcodes  4 роки тому +1

      Thanks, another tutorial being published in 15 minutes 😛

    • @Shonashoni1
      @Shonashoni1 4 роки тому

      @@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

  • @TechieUpgrader
    @TechieUpgrader 4 роки тому

    Make a video on how to scrap Spotify and gaana website song

  • @varunnova5905
    @varunnova5905 4 роки тому

    Can I play music using this api?

    • @imdadcodes
      @imdadcodes  4 роки тому

      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 👍

  • @Appuaravind2
    @Appuaravind2 4 роки тому

    NOt working

  • @navneetyadav8869
    @navneetyadav8869 3 роки тому +1

    Great video but the process shudve been done vice versa😅😅

  • @aethelbread
    @aethelbread 4 роки тому +3

    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
      @imdadcodes  4 роки тому

      Are you still facing this issue? Do you have the credentials file in the directory?

    • @abhilashapimpalgaonkar660
      @abhilashapimpalgaonkar660 4 роки тому +2

      I got the same error keyError: 'tracks'

    • @User-re8nl
      @User-re8nl 4 роки тому

      @@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

    • @shyaamaltripathi5373
      @shyaamaltripathi5373 2 роки тому

      Hey pal, did you figure out how to resolve this bug ?

  • @ishaantakkar1
    @ishaantakkar1 4 роки тому

    Great video! How did it add 20 tracks even when you didn't mentioned 20 anywhere?

    • @justinschroeder5694
      @justinschroeder5694 4 роки тому +2

      i think the spotify api default for a search query is set to 20 items

  • @darrellrobinson602
    @darrellrobinson602 4 роки тому

    PLEASE EXPLAIN THE KEY ERROR
    PLEASE EXPLAIN THE KEY ERROR

    • @kennytieshisshoes
      @kennytieshisshoes 3 роки тому

      I assume you are getting the key error for "tracks", try and indent tracks once more. That fixed the issue for me.

  • @gabrielraulkumar8656
    @gabrielraulkumar8656 4 роки тому +1

    Hello Imdad!
    I love this video!
    Please do check your Instagram chats. I need some help!

    • @imdadcodes
      @imdadcodes  4 роки тому +1

      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 😛

    • @gabrielraulkumar8656
      @gabrielraulkumar8656 4 роки тому +1

      @@imdadcodes Can u please tell me the terminal you are using in this video.

    • @imdadcodes
      @imdadcodes  4 роки тому

      Sure thing, I’m using iTerm with zsh.

    • @gabrielraulkumar8656
      @gabrielraulkumar8656 4 роки тому

      @@imdadcodes Can I use it on windows?

    • @imdadcodes
      @imdadcodes  4 роки тому

      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 😛