Git Product home page Git Product logo

spotify_monthly_playlist's Introduction

Spotify Monthly Playlist Creator

This Python script creates monthly playlists on Spotify and adds the songs you saved in each specific month. It can also create playlists retroactively for previous months.

Features

  • Monthly Playlists: Automatically creates a playlist for each month and adds the songs saved in that month.
  • Retroactive Playlists: Optionally create playlists for past months and add the respective songs saved during those months.
  • Automatic Token Retrieval: Uses Flask to handle Spotify authentication and capture the token seamlessly.
  • Reverse Order Addition: Adds tracks in reverse order to the playlist to maintain the order they were saved.

Prerequisites

  • Python 3.x
  • Flask
  • Spotipy
  • Spotify Developer Account

Installation

  1. Clone the repository:

    git clone https://github.com/c-reghiment/spotify_monthly_playlist.git
    cd spotify-monthly-playlist-creator
    
  2. Install the required Python libraries: sh pip install spotipy Flask

  3. Set up Spotify Developer Account:

    • Go to the Spotify Developer Dashboard.
    • Create a new app and note down the Client ID and Client Secret.
    • Set the Redirect URI to http://localhost:8888/callback.
  4. Set environment variables:

    • On Windows:
      setx SPOTIPY_CLIENT_ID "your_client_id"
      setx SPOTIPY_CLIENT_SECRET "your_client_secret"
      setx SPOTIPY_REDIRECT_URI "http://localhost:8888/callback"
    • On macOS/Linux:
      export SPOTIPY_CLIENT_ID="your_client_id"
      export SPOTIPY_CLIENT_SECRET="your_client_secret"
      export SPOTIPY_REDIRECT_URI="http://localhost:8888/callback"

Usage

  1. Run the script:

    python spotify_monthly_playlist_creator.py
  2. Authenticate with Spotify:

    • The script will open a browser window to prompt for Spotify login and authorization.
    • After logging in, copy the URL you are redirected to and paste it back into the terminal.
  3. Create Playlists:

    • Enter the number of past months you want to create playlists for (e.g., enter 0 to create only the current month's playlist).

Example

  python spotify_monthly_playlist_creator.py
  • The script will prompt you to authenticate with Spotify.
  • After authentication, enter the number of past months you want to create playlists for.
  • The script will create the playlists and add the saved songs for each specified month.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contributing

 Contributions are welcome! Please open an issue or submit a pull request.

Acknowledgments

 - [Spotipy](https://spotipy.readthedocs.io/en/2.19.0/#)
 - [Flask](https://flask.palletsprojects.com/en/2.0.x/)

spotify_monthly_playlist's People

Contributors

c-reghiment avatar

Watchers

Kostas Georgiou avatar  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.