Git Product home page Git Product logo

spotify-playlist-backup's Introduction

Spotify Playlist Backup

Super simple python program to update a duplicate of a Spotify playlist. Mostly for me to practice documenting projects on github. :)

Use case:

Collaborative playlists cannot be added to your profile, so to share one of these playlists you must create a copy. However this copy will not be updated with new additions in the source playlist. This program can be deployed to Heroku or similar to update the playlist every hour or day etc.

How to run the python code:

Clone or download this repository and fill in the information at the top of the main.py script. The playlist URIs can no longer be copied directly from Spotify, however if you copy the link for the playlist, the URI will be the 22 characters after the last slash. Eg: htps://open.spotify.com/playlist/37i9dQZF1DX3Tjn540kLxZ?si=3abbdc11b6434db1

src = '' # The source playlist URI
dst = '' # The destination playlist URI

username = '' # Your Spotify username
client_id = '' # Your Spotify app client id
client_secret = '' # And secret
redirect_uri = 'http://localhost:8000/' # The redirect url set on your Spotify app, must be identical!

removeFromDst = True; # Should songs ever be removed from the dst playlist if they are removed from the source. If true songs will be removed - mirror

The client id and secret can be created on Spotify's developer dashboard.

Then run the program with python3.

How to deploy to Heroku and schedule executions for free:

  • Sign up for a Heroku account and create a new app.
  • Follow the Deploy using Heroku Git instructions on the Heroku dashboard inside the folder for this repository. You will need the requirements.txt file for Heroku to recognise this build as python.
  • Once you have deployed your app, go back to the Heroku dashboard and select configure add-ons under the overview section.
  • Enter Heroku Scheduler in the search field and submit the order form.
  • Next click on the Heroku scheduler link and create a job.
  • Select your prefered time interval and enter python main.py as the command. This command can also be used from the Heroku console or command line to test your app

spotify-playlist-backup's People

Contributors

artomweb avatar

Watchers

 avatar

Forkers

repayne

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.