Code Monkey home page Code Monkey logo

auto_spotify's Introduction

Auto Spotify

One day I was organizing some directories on my pc and I found the old songs I used to listen. I wanted to add those songs to a playlist on spotify, but there were like 300 songs, it would take ages to do it manually, so I decided to have python do it for me.

How does it work?

It's quite simple: it saves the names of all the songs, without the extension, looks for their id's on spotify and adds the songs to the playlist you chose.

How do I use it?

First of all, you need to have python installed in your pc, you can find the latest version here: https://www.python.org/downloads/

After that, you need to download this repository by clicking on code and download ZIP:

Or clone it by using:

git clone [email protected]:RuaN-debug/Auto_Spotify.git

Now you need 3 things: the complete path of the directory with the songs in your pc, the id of the playlist you want to add the songs and a token to authorize that. To get the playlist id you can go to spotify, copy the link of the playlist and the id will be the number after playlist/ and before the ?, like the example below:

https://open.spotify.com/playlist/0GfSUFhYrgdJfkIJO2kpbz?si=38b8654a512a4ddf
id = 0GfSUFhYrgdJfkIJO2kpbz

After getting the id you need the token to authorize python to do the work, you can get it by using the official api of spotify: https://developer.spotify.com/dashboard/login Now, after logging in, you go to: https://developer.spotify.com/console/post-playlist-tracks/?playlist_id=0GfSUFhYrgdJfkIJO2kpbz&position=&uris= and paste the playlist id:

Click on Get Token:

And mark the playlist-modify-public or playlist-modify-private, depending on the type of your playlist (public or private) and request the token.

It will appear on the box to the left of the button. all you need to do is copy it.

Finally, you have everything you need, now in order to make it work you need to access the main.py file and paste the token and the path of the directory with the songs:

Then go to spotify_client and paste the id of your playlist:

Now, all you have to do is to install the requirements with:

pip install -r requirements.txt

And run the main.py file, you can do that with:

python main.py

Remember that the token is not permanent, you have to get another token every few minutes.

auto_spotify's People

Contributors

ruan-debug avatar

Stargazers

Roman avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.