Automate Spotify With Python - The RIGHT Way (Beginner Tutorial)

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

КОМЕНТАРІ • 230

  • @modlobot6990
    @modlobot6990 4 роки тому +17

    I've just started programming and this video is exactly what I needed to motivate myself while I'm learning Python. Great video! Keep up the good work. See you around

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

      @@imdadcodes Of course I subscribed! Bell is on as well :D Yeah I started like two days ago and I was curious on what's possible with Python and then I searched the web and found your channel.

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

      @@imdadcodes I simply searched for "Python and Spotify" on UA-cam because I was interested about it. I really wonder if it's possible to code something and this something is looking for music you maybe like and puts them into a playlist on Spotify. I mean like an AI which learns from your usage of spotify. I think Spotify has something like that in their application but it's not really working for me.

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

      Have u learned python?

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

    Hi man,
    at 9:45 of video, when you were trying to extract the artist and track info of the video, somehow I am not able to do that. It gave the KeyError: 'artist' or 'track' and when I traced back the video dict variable, there was no keys referring to either keyword "artist" or track! idk if there's another way to approach this problem! Really appreciate if you can help. Thanks!

  • @lightzin
    @lightzin 5 місяців тому +1

    Your video guides are really good. I'm trying to go in the opposite direction: getting a playlist from Spotify and converting it into a playlist in UA-cam. Is it possible to use the libraries and APIs in this video (specially the youtube tools) for that?

    • @imdadcodes
      @imdadcodes  4 місяці тому

      Thank you. I’m sure it’s possible. Google/UA-cam APIs can be a bit more of a faff so I imagine the authentication might be a bit trickier. But check out the documentation 👍

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

    hey Imdad. amazing video youve put out. I just wanted to ask you how do i download youtube credentials file??
    thanks in advance

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

    These videos are gold keep it up!

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

      Thanks, let me know if you have any requests. I usually note them down 👍

  • @ashutoshkapoor5031
    @ashutoshkapoor5031 Рік тому +1

    hi Imdad, i followed this video line by line and at last I got this error
    in getArtistandTrackFromVideo
    artist = video['artist']
    KeyError: 'artist

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

    for some reason when i try to go on the source code link i get to the page but when i go to the bottom of the page and click here to get the full source code it doesnt work

  • @sravan8643
    @sravan8643 4 роки тому +7

    where to get the spotify token? im confused please help

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

      Have the same question. Have you found it?

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

      developer.spotify.com/console/put-current-user-saved-tracks/

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

      @@cstone7092 thanks ma dude

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

      @@cstone7092 Doesn't this expire every hour?

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

      @@User-re8nl yep. It does. It may have a time limit or usage limit. So you will have to create a new token and place it into your Spotify auth file. A little annoying to do each time but it doesn’t take too much time to do.

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

    I followed along with this tutorial and made a few changes to the code to fit my needs and it ended up working so well! Thanks for this great tutorial!

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

      That's amazing, very glad to hear! What were your favourite bits of the video? Would love to know what I should keep in mind for future videos 😀

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

      Thanks for explaining the logic behind what and why you were coding it a certain way instead of just saying do this and do that, it made it easier to follow along. I had a bit of trouble with figuring out how to get the client_secret.json file but I eventually figured it out with a little help from stack overflow : ) Also, I had no idea what youtube-dl was before this and that it could be used to download youtube videos, so after watching this I actually ended up making another program using youtube-dl just to easily download youtube videos!
      You got yourself a new subscriber!

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

      Thank you so much pracheeti for the very detailed feedback, it is honestly incredibly helpful ❤️ There's definitely a lot of points in there that I will actively think about in my next videos. That's also really really cool that you built upon that video and took it to another level, great stuff 💪 Thanks for the subscription, it means a lot 😀

  • @pratyushamulchandani3412
    @pratyushamulchandani3412 4 роки тому +4

    Hey, i am getting this error. results = response_json['tracks']['items']
    KeyError: 'tracks' i don't know what to do next, it would be great if anyone could help

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

      @@imdadcodes {'error': {'status': 401, 'message': 'The access token expired'}} this is the error I am getting. it always shows access token expired even after I try running the program with a new token and also setting it in env variable. Also, subscribed :)

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

      @@imdadcodes yeah i tried that, works partially. it asked my Spotify token and I provided. but after that it showed 297 lines of output which was squeezed, I expanded it, I could see songs of my playlist in that output screen, but this keyerror tracks still remains and no playlist is created in spotify

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

      omg yes it works. thank you so much, you were of great help. also, is there any way that Spotify liked songs gets refreshed every time we like a new song on youtube without running the python program?

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

      Amazing!! 🎉
      It is possible for sure, but it's not the easiest thing to setup. You'd have to run it on a server (usually you pay fees) and have it continually check for any updates. It's not ideal, I wish I had a better answer but this seems like the best free way to do it 😀

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

      Imdad Ahad alright, thankyou so much for your help!

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

    Hi there
    Thanks for the idea for this project
    I was facing one issue as said below,
    This error pops up every time I try to run the youtube_client.py
    KeyError: 'artist'
    I have checked for any of the known errors but not able to figure them out
    Can someone help me out?

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

      I've got the same error and it seems like youtube_dl does not give an information about the artist and track anymore. I tried to to this with title instead but some of the tracks for example with (official video) couldn't be found.

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

    artist and track both are none, am using 2020.07.28 please help

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

      @@termi2828 thank you i have seen the issue am also doing the same

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

      ​@@termi2828
      I also ran into this bug and fixed it with a workaround using facebook's web scraper. Enjoy fellas
      # import youtube_dl
      import youtube_dl
      # set a custom agent to fix the bug (facebook's web crawler)
      youtube_dl.utils.std_headers['User-Agent'] = "facebookexternalhit/1.1 (+facebook.com/externalhit_uatext.php)"
      # youtube_dl will now work as normal to collect
      # the song name & artist name
      video = youtube_dl.UA-camDL({}).extract_info(
      youtube_url, download=False)
      song_name = video["track"]
      artist = video["artist"]
      )

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

      @@playdoughfunrs thanks I just found this solution on reddit, it works great

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

    Hi Imdad. I am trying to run my project but struggling with the OAuth.
    Upon clicking on the URL for authorization, i get the following error "The redirect URI in the request, urn:ietf:wg:oauth:2.0:oob, can only be used by a Client ID for native application. It is not allowed for the WEB client type. You can create a Client ID for native application at"
    Any idea why?

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

    hey could you tell me how to store my UA-cam creds in the folder? I'm confused and would greatly appreciate the help

  • @isaac-739
    @isaac-739 3 роки тому +1

    When I get to "Enter your choice: " it doen't print out the names of playlists that I have before then. I tried to insert a number anyways and I get a "list index out of range" error. Does anyone know how to fix this?

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

    i got this message after choosing playlist to automate
    Traceback (most recent call last):
    File "run.py", line 30, in
    run()
    File "run.py", line 22, in run
    spotify_song_id = spotify_client.search_song(song.artist, song.track)
    File "D:\projects\python\automate-spotify-python\spotify_client.py", line 21, in search_song
    results = response_json['tracks']['items']
    KeyError: 'tracks'
    what i need to do?

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

      Can you wrap it with a try catch and so you can print out the error. Usually this means you’re credentials aren’t correct or being parsed correctly.

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

      @@imdadcodes where and what i need to write? i don't know much about python..

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

      Probably worth watching a few UA-cam videos on exception handling on Python. I don't have any videos on that as of yet.

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

    hey Imdad , 17:06 pls tell me how to download the UA-cam Credentials file and also how to place it in the directory . anyone pls kindly help asap

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

    Source code link doesn't work now.

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

    Traceback (most recent call last):
    File "run.py", line 30, in
    run()
    File "run.py", line 15, in run
    chosen_playlist = playlists[choice]
    IndexError: list index out of range
    help me with this error

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

      Which playlists were printed and which one did you select?

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

      @@imdadcodes bro there are no choices when I execute the code

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

      @@imdadcodesresults = response_json['tracks']['items']
      KeyError: 'tracks'
      I came up with this error and I already set the Auth token .

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

      @coder Lag What happens when you run this in the terminal: `echo $SPOTIFY_AUTH_TOKEN`

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

      @@imdadcodes this gives me my spotify auth token

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

    Hi!
    So I'm encountering two issues...
    1. print(f"{index}: {playlist.title}") --- it's saying it's an invalid syntax... I'm not sure why. When I remove the "f", I don't see the error message.
    2. I'm getting a module not found with my import requests, any ideas as to why I'm seeing this? I have request installed.

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

      I think you’re using an older version of python which doesn’t support the formatted string feature. Can you confirm what version of Python you have?

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

      @@imdadcodes Hi!! Thank you for responding :) I have version 3.8.3

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

      Are you using a virtual environment?

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

      @@imdadcodes Hmm... I'm not entirely too sure what that is... but I'm using Py Charm. I've followed your tutorial exactly :) Sorry... I'm not yet fluent in Python

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

    Really great video i love these types of projects, proper interesting and great for a beginner. Liked and subscribed i hope you make more! :) Thanks

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

      Awesome, thank you for the kind comment and for the subscription 😀 I’d love to know what you liked about the video (were there any specific bits or any comments about the format)? It’ll help me greatly when it comes to making future videos for you 🙌

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

    Recently started learning Python and watching this really made me think, "will I ever reach this level knowledge in programming "?!

  • @anjolatope-babalola2338
    @anjolatope-babalola2338 4 роки тому +1

    what is meant to be in the credential folder and how do we access/ sign into youtube

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

      Have you managed to solve the problem?

    • @anjolatope-babalola2338
      @anjolatope-babalola2338 4 роки тому

      Imdad Ahad thank you, I was able to do so by using googles api

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

      @@anjolatope-babalola2338 Awesome, glad to hear you got it working 💪

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

    Neat and easy to walk through! GJ! What's the music title in the video? Pretty chill

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

      Thanks! I took it from here: ua-cam.com/video/9ofV2kjQdRU/v-deo.html&ab_channel=Airtight

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

    now how do you refresh the access token? because that does expire after about an hour or so

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

      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/

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

      @@imdadcodes thanks man

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

    can you overview what needs to do in the client_secret.json file? I have the API key but am not sure what needs to go in the file and how to format it.

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

      So essentially when you go to the UA-cam Data API and create a set of credentials, you'll get a .json file to download. That's the one you need to rename to client_secret.json and place in the credentials directory. Does that make sense?

    • @tucc40095
      @tucc40095 4 роки тому +5

      @@imdadcodes We need a small video showing how to do this. There are a bunch of options and it isn't really straight forward, especially for api beginners.

    • @isaac-739
      @isaac-739 3 роки тому

      @@tucc40095 i know this is forever late, but if you click on the UA-cam data api link he has in the description, click on guides, click on get Auth credentials under Authorize requests, and click the first link that says credentials page, you should be taken to a page with white and blue. Click on create credentials, it will bring you to set up an Oauth consent set up. Once you are done with that, goo back to create credentials and create one. You should be given an id and secret. There should be a button that says, download json file at the top. Download it and put it into the creds file in your project.

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

    Nice vide bro! But I have an issue when extracting the track name and artist through the youtube_dl. On every video i search, ["artist] and ["track] are equal to null. I don't know why, maybe they removed that information from ALL the songs? it's quiet confusing to me. The rest it's working just fine. I did a few tweaks and make it to be semi-auto-authenticated and currently I'm thinking on expanding it

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

      Are you using the latest version of youtube_dl? Check by running `pip install youtube_dl` and that will list the available versions.

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

      @@imdadcodes I just checked and it says "Requirement already satisfied: youtube_dl in PATH" but still It's not working :(

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

      Hi I've run into the same issue, track and artist come back with no value. There are also a number of other fields that come back as none. This appears to be an issue with the youtube_dl library itself and the regular expressions being used in the source code.
      There is a similar open issue on the github page here: github.com/ytdl-org/youtube-dl/issues/26013
      I'm going to learn more about regular expressions and try to solve this issue. If anyone has any pointers or would like to help please message me.

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

      @@termi2828 If you find a solution woukd be great if you comment it here so I an fix it aswell

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

      @@AldorCrap Fixed it. Here is an example of what to do
      # import youtube_dl
      import youtube_dl
      # set a custom agent to fix the bug (facebook's web crawler)
      youtube_dl.utils.std_headers['User-Agent'] = "facebookexternalhit/1.1 (+facebook.com/externalhit_uatext.php)"
      # youtube_dl will now work as normal to collect
      # the song name & artist name
      video = youtube_dl.UA-camDL({}).extract_info(
      youtube_url, download=False)
      song_name = video["track"]
      artist = video["artist"]
      )

  • @ganya4631
    @ganya4631 11 місяців тому

    So I have been getting this error even though I have added a redirect uri and downloaded the json file and added it to client_secrets.json: Error 400: redirect_uri_mismatch ,I am unable to get the authorization code. Please help me out !!

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

    i tried for a week and i still get my spotify playlist to update. can you please help me because this is for my school project. i need to submit this asap so it would be a great if you could help me. thank you very much

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

      Hi, please check my comment on your other comment 🙂

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

    Very nice video, I will try it

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

    I am NewBie with Python and I am stuck with the export function at the terminal: Pycharm does not recongnize the command. Can you please help me out ?

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

      What error are you getting. Can you paste it here? By the way I also have beginner python videos coming so do subscribe and tap the bell icon 😀

  • @TO-il3vc
    @TO-il3vc 4 роки тому +1

    So you have to get a new spotify auth token every time you want to run the program? Is there a way to get permanent authorization?

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

      Yup, I believe they have an OAuth offering. You’ll need to implement the refresh token handling potentially. Check out developer.spotify.com/documentation/ios/guides/token-swap-and-refresh/

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

    Hey man! Great content. I’m trying to retrieve Spotify data to a Machine Learning Project. While building my dataset, I keep receiving “HTTP Error for GET to () returned 404 due to error”. The track uri works, but I still cannot catch the error. Any tips? Am I requesting too much from the API?

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

      Thanks! Can you confirm the endpoint you’re requesting, 404 means not found. Usually you get rate limited after a certain number of requests and you’ll get a 403, but not straight away.

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

      @@imdadcodes I guess that's the case. I've tried using a try/except structure to deal with it but I'm not having success. Do you have any tips on it? Should I refresh my token or smoothing like it? Thanks for the prompt answer.

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

      Couple things worth trying. Refresh token and try hit the endpoint, maybe either Curl from terminal or use Insomnia/Postman. Try other endpoints to see if it’s an issue with that one endpoint or if it’s affecting every endpoint, if the latter maybe an overall authorisation issue.

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

      Imdad Ahad Thank you very much. I’m working on that ;)

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

    what code editor is this? it looks really clean, if you've added any extensions to it pls let me know!

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

    Hi, I got to the very end and when I click on the URL to authorize the application, I get an "Error 400: redirect_uri_mismatch" error. Is this due to missing authorized redirected URIs? If so, what URI should I add?

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

      Not sure if my comment went through. Could you confirm how you went about creating the credentials?

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

      I actually got it resolved. My problem was I created an OAuth client ID with a Web Application Type. I had to use "Other" instead. Thanks for replying anyways. Your videos are great! Please keep them coming :)

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

      Awesome, nice debugging 💪
      Thanks for the kind comments and sure thing! I'm betting you've subscribed and tapped the bell icon already but worth checking out my latest video which adds random songs to Spotify 🙌
      ua-cam.com/video/uXf7IRDIQS4/v-deo.html

    • @anjolatope-babalola2338
      @anjolatope-babalola2338 4 роки тому

      i am having the same problem

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

    great video!!

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

    Hey what Pycharm Theme and Font do u use for your IDE Appearance?

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

      I've customised my PyCharm quite heavily. I use the One Dark Scheme and Monaco Font. Hope that helps. I may do a UA-cam video on my settings in the future so be sure to subscribe 😀

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

    Hello! I love the video and the project itself. I just have a problem that I don't yet understand the reason why, the terminal is showing me the next error: request = self.youtube_client.playlist().list(
    AttributeError: 'Resource' object has no attribute 'playlist'
    Probably its just a typo or something. I tried checking the gitHub repository for the project but I could not find any leads. I would appreciate the help.

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

      @@imdadcodes Hi, thank you for replying : ) I have subscribed and hope you continue with the content.
      In terms of the code, I can confirm the credential name files and where they are stored, correspond to the main folder of the project. The run.py file has the appropriate references to them as well. I verified your gitHub project , in case I may have spellings issues or something. But nothing so far : /

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

      @@imdadcodes Sure. Here are the links:
      run.py: pastebin.com/03UxxBFa
      youtube_client.py: pastebin.com/puzzhmiQ
      If you need to check the rest of it, let me know. Thank you very much for the help!

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

      ​@@imdadcodes Sure, absolutely. Here is my terminal after "pip freeze":
      pastebin.com/nfWQtNk5

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

      @@imdadcodes You were right, it was a small typo, the code is running correctly now!! I appreciate the help, keep that great content coming! : D

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

    Hi Imdad,
    I wanna start learning programming, which language should I start with? Is Python a good choice?

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

      Hi Qassem,
      That's great to hear, I'd highly recommend you give this video a watch: ua-cam.com/video/xKT7kHluZUk/v-deo.html
      Hope that helps!

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

    ur the best. thank u!

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

    can you tell me please what vs code theme do you use? its very cool

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

      He's using PyCharm not vscode

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

      @@termi2828 looool, first time i didnt believe you, now i looked closer

  • @2_datacrawlers_nawaf__109
    @2_datacrawlers_nawaf__109 4 роки тому

    very informative and well explained,but while using the youtube_dl library and applying the same code the response data for artist and track returned None,could you provide a reason......

  • @user-zp3wb4bg3l
    @user-zp3wb4bg3l 4 роки тому

    Hey! Great work on doing this. And it barely even works for me. Problem here: The last thing that happens is: Attempting to add 1. I just got one Song on the playlist, just to try it but in spotify no song will be added to the liked songs playlist... Any ideas?

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

      Hmm, it sounds like not all songs are being added. It might be worth adding some print statements or breakpoints in your code to inspect and check whether it actually adds the songs?

    • @user-zp3wb4bg3l
      @user-zp3wb4bg3l 4 роки тому

      @@imdadcodes Already did this and apparently it goes through all the code but just doesnt add the songs to the playlist. :C

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

      Hmm, I think best bet is breakpoints to hopefully to try and pinpoint exactly at which bit in the code it’s not doing what it’s meant to do. Wish I could help more 😔

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

    i am getting Error 400: redirect_uri_mismatch,
    any suggestions?

  • @tucc40095
    @tucc40095 4 роки тому +8

    Can someone please post instructions on the client_secret.json file. Just plain specific instructions. Even better, a simple video would be great.

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

      I recommend reading the steps here first to understand how to set up it: developers.google.com/youtube/v3/quickstart/python
      But here's a video on how you can set it up: ua-cam.com/video/3jZ5vnv-LZc/v-deo.html

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

    Hey when I run the 'run.py' file, im able to get as far to the authorization code, once I enter that in and make a selection. I get this error in youtube_client.py:
    Unable to download webpage: (caused by URLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)')))
    I don't know what I'm doing wrong

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

      Hi Akriti, really sorry I saw this quite late. Did you manage to solve your issue?

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

    hi i am unable to run the code with the terminal may I ask how did you manage to run your code?

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

      Hi, what error are you getting?

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

      @@imdadcodes hi thank you so much for replying i got an error where they said my export token isn't an external or internal command i am using a pc

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

      Try ‘setx SPOTIFY_AUTH_TOKEN=token’. Think that’s how you set an environment variable on windows. Let me know if that works?

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

    21.49 where can i open the terminal?

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

      You can find it in your Applications folder if you're using a Mac.

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

    Hello sir,
    Actually I am working on a little similar project to create a system that recognise face expression and create a playlist accordingly.
    As I need help regarding that and there is no such video on UA-cam. It would be helpful for me and many others who wants to work on such things if you make a video for the same.

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

      Great idea, I'll jot it down!

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

      @@imdadcodes Thank you for replying sir, waiting for your video.

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

    Hi Imdad, I am running the program and getting the error Authorization Error 400 missing required parameter : redirect uri and i have no idea how to fix that

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

      look on the SpotifyAPI doc. You need an URI in the query for the auth. But first, on the dashboard you have to go to your App and then go to edit settings and add the URI to the whitelist.

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

      @@MsGabrielBoss I got the error when I clicked the URL generated on running python run.py also it would be helpful if you could tell me how can we set the Spotify auth token as an environmental variable.

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

      Hi Ambar, are you getting this error from the Spotify API?

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

    Hey Imdad, there is no link at 47s for the API video, just a heads up

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

      Ah sweet Andrew! Thanks for the heads up, just added it in 🙌

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

    I am having problems getting the redirect URI

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

    which program you use to code ?

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

      Pycharm for Python, sublime for most other things

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

      @@imdadcodes thank you :D

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

    Could you do a tutorial on getting a song to play on Spotify with Spotify?

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

      Can you explain this a bit more?

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

      @@imdadcodes I meant spotipy. I've been trying to get a song to play on a device, but I'm not really sure how to.

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

    hi! i keep getting this error. i tried so many things and i still don't get the answer
    Authorization Error
    Error 400: invalid_request
    Missing required parameter: scope

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

      same here

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

      What scope did you select when you generated the Spotify token. It needs to have access that allows you to modify your spotify library.

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

      found my problem,the link in the pycharm terminal did not include the scopes added, just had to manually copy paste and was all good

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

    How to create a simple discord bot and connect Spotify functions to it?
    I was looking for and trying to create my own discord bot to use my Spotify songs in discord.
    Could you try that out and create a video for that?
    I'd love to see that video.

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

      Hi Alimus, that’s a good idea. Probably won’t be the quickest to get tougher though as it would need some server deployment etc. I’ll be doing more Spotify API tutorials this year though so I’ll definitely keep it in mind! Do let me know if you start building something too 😛

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

      @@imdadcodes I will. I am going through the discord app documents, to make a simple bot. watching tutorials online... i'll need some time too!

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

      @@alimussifar Good stuff Alimus, let me know how it goes 🙏

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

    Follow this process to extract any Spotify Playlist to csv using Python : ua-cam.com/video/xRbRCmedZo0/v-deo.html

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

    i am getting this error called "video format not found" after selecting the playlist . Help

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

      Sorry, did you manage to solve the issue?

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

      @@imdadcodes nope :(

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

    F all my playlist says attempting to add 0 even with the github code

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

      update: same thing with the github code fml

  • @anjolatope-babalola2338
    @anjolatope-babalola2338 4 роки тому

    what type of client id are we to chose

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

    Hi, I'm getting this error:
    ERROR: Unable to download webpage: (caused by URLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1051)')))
    Trying to download the video from UA-cam.
    video = youtube_dl.UA-camDL({'quiet': True}).extract_info(
    youtube_url, download=False # The error is raised from this line
    )
    I have tried to add the option:
    'no_check_certificate': True
    But it doesn't work, any ideas?

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

      Fixed following this thread stackoverflow.com/questions/50236117/scraping-ssl-certificate-verify-failed-error-for-http-en-wikipedia-org#

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

    Awesome video, subscribed! @ 21:55 - The Spotify auth token expires every 60 minutes right? Is there any way to generate it from Python itself so that in case it expres, i catch it in a "try... catch" block & request a new auth token?

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

      i am unable to find the pace to get token...where to find it?

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

    cmon dude tell us how you installed that beautiful UI theme

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

      Haha, it’s called Monokai Pro

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

    What is the name of this editör

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

      PyCharm

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

      @@imdadcodes 2020?

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

      Yup, well PyCharm Community Edition

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

      @@imdadcodes Thenk bro 💛

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

    How to download the UA-cam credential files?

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

      Sorry, did you manage to solve the issue?

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

      @@imdadcodes no I was not able to

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

    There's only one choice is coming when I Execute the code
    0 : Favourite

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

      Do you have this line in `youtube_client.py`: github.com/imdadahad/automate-spotify-python/blob/6d515ab180a45812b0b78c66840029b55d9b8b5a/youtube_client.py#L44

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

      @@imdadcodes yes bro

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

      same problem here !!!!!

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

      Heya, can you try pulling down my code from the Github repo and see if that works. If not, then can you explain step by step exactly how you're obtaining the credentials from the UA-cam Data API?

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

      @@imdadcodes thnxxx for replying, here are the step
      Google cloud platform->credential-> getting API KEY ->Create credential -> OAuth client Id -> App type ( Desktop App) then I downloaded the json file

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

    hi, I cannot open the source code link

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

      Sorry, I just went through a website upgrade recently. I've just updated the link 👍

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

    unable to run the program

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

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

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

      HI imdad , the Spotify link is the same as the youtube one in the description

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

      @@simondalmaso5437 Thanks just fixed it
      👍

  • @MrKriselt
    @MrKriselt 7 місяців тому

    okay so i just spent literal hours following every step you made, and it just doesn't work? i also don't get the download the credentials part? everything in your tutorial is easy to follow and understand, but that part is just? maybe its because I am not an experienced coder but still :(

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

    source code bro

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

    Hello, I followed all the steps very good this program, but it only works for the first 5 videos in the list by execution

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

    Hey boss pls what's your discord

  • @GrassZeplin
    @GrassZeplin 8 місяців тому

    Hi bro, I've been getting this error after running the run.py file despite having the access token and credentials.json there.
    Traceback (most recent call last):
    File "c:\Users\wobur\OneDrive\Desktop\Projects\automate-youtube-to-spotify
    un.py", line 29, in
    run()
    File "c:\Users\wobur\OneDrive\Desktop\Projects\automate-youtube-to-spotify
    un.py", line 7, in run
    youtube_client = UA-camClient('./creds/client_secret.json')
    File "c:\Users\wobur\OneDrive\Desktop\Projects\automate-youtube-to-spotify\youtube_client.py", line 32, in __init__
    credentials = flow.run_local_server()
    File "C:\Users\wobur\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\google_auth_oauthlib\flow.py", line 432, in run_local_server
    local_server = wsgiref.simple_server.make_server(
    File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\lib\wsgiref\simple_server.py", line 154, in make_server
    server = server_class((host, port), handler_class)
    File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\lib\socketserver.py", line 452, in __init__
    self.server_bind()
    File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\lib\wsgiref\simple_server.py", line 50, in server_bind
    HTTPServer.server_bind(self)
    File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\lib\http\server.py", line 137, in server_bind
    socketserver.TCPServer.server_bind(self)
    File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\lib\socketserver.py", line 466, in server_bind
    self.socket.bind(self.server_address)
    PermissionError: [WinError 10013] An attempt was made to access a socket in a way forbidden by its access permissions
    If you have any idea why this happens? Please let me know. I have been stuck for so long.

    • @imdadcodes
      @imdadcodes  8 місяців тому

      See if any of these help:
      stackoverflow.com/questions/10461257/an-attempt-was-made-to-access-a-socket-in-a-way-forbidden-by-its-access-permissi

    • @GrassZeplin
      @GrassZeplin 8 місяців тому

      @@imdadcodes Thank you

  • @anjolatope-babalola2338
    @anjolatope-babalola2338 4 роки тому +1

    Hey, i am getting this error. results = response_json['tracks']['items']
    KeyError: 'tracks' i don't know what to do next, it would be great if anyone could hel

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

      Hey, usually this happens when you haven't got the Spotify environment variable set correctly. Can you run `echo $SPOTIFY_TOKEN` in the terminal and let me know what that prints out?

    • @anjolatope-babalola2338
      @anjolatope-babalola2338 4 роки тому

      Imdad Ahad it just returns Spotify token

    • @anjolatope-babalola2338
      @anjolatope-babalola2338 4 роки тому

      Imdad Ahad I no longer get an error but my code stops running at attempting to add (number of songs )

    • @anjolatope-babalola2338
      @anjolatope-babalola2338 4 роки тому

      Imdad Ahad I was debugging the code and everytime the response from add songs to Spotify was false, the code got the song Id but cannot add it to spotify for some reason

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

    Hey boss pls what's your discord

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

      Sorry, I don't have Discord.

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

      OK I got a job for u boss but I don't know if you will be interested