Giter VIP home page Giter VIP logo

commutipy's Introduction

commutipy

Introduction

In the search for new music, it can often be difficult to find time to listen to new albums completely. Making a giant playlist full of albums I want to listen to, makes it feel like more of a chore than a new experience. Automating the process makes listening to new music of your choice a lot less overwhelming.

Commutipy automatically updates a user's specified public spotify playlist from a pool of chosen albums every morning. Open the commutipy playlist and listen to a randomly picked album you want to listen to on your commute. Just setup the script to run daily and add artist and album names to a text file.

This project runs on Windows and Linux. The only platform specific item is the path to the text file (so modifying for Mac should be simple). All code has been written and run on Python 3.x.

Setup

  1. Get Spotify credentials (username, client_id, client_secret, redirect_uri)
  2. Install dependencies
  3. First run setup
  4. Schedule

Spotify Credentials

Register an application with Spotify to obtain ClientID and ClientSecret. Link to Spotify application managment. Use http://127.0.0.1 as your redirect uri (make sure to save if you do any modifications on your application page). Add this information to keys.py.

Dependencies

pip install -r requirements.txt installs the required dependencies.

  • Spotipy: Python wrapper for Spotify which allows us to edit playlists
  • Pandas: Makes it easier to modify csv files (for marking whether we've heard an album)

First Run Setup

Make sure to get the uri of the playlist you want to edit. Go to Spotify, share a playlist and there should be a uri option. You just need the end (example: spotify:user:12129446897:playlist:5GHOJEsm77aM3XfdsPeD1Z. You just want 5GHOJEsm77aM3XfdsPeD1Z).

The Spotify instance will ask for a url containing the authorization code (read the docs to understand the flow), copy & paste that back into your console, and it should work.

Schedule

Use cron on Linux to run it on a daily interval. Or use the Windows Task Scheduler. If running headless on a raspberry pi for instance, make sure to cd into the folder that has your cached token. Otherwise the job won't work.

To-do

Keep track of which albums were listened to completely (last.fm api?)

commutipy's People

Contributors

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