GithubHelp home page GithubHelp logo

johnnyshankman / itunes-library-xml-to-spotify-migrator Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 117 KB

Take your iTunes Music Library XML file and migrate all songs into a Spotify playlist.

Home Page: https://www.whitelights.co

JavaScript 3.27% TypeScript 96.73%
itunes music spotify apple node typescript

itunes-library-xml-to-spotify-migrator's Introduction

iTunes Music Library XML to Spotify Migrator

build

Takes a standard iTunes Music Library.xml file (sometimes labeled iTunes Library.xml) and migrates each song to a Spotify playlist as best it can.

iTunes library parsing is provided by itunes-data from shawnbot.

Spotify search and playlist additions are automated using the Spotify Web API, after using Spotify's Implicit Grant OAuth flow to log you in. The only reason for this OAuth flow is so this tool has permission to add songs to any playlist you provide.

Setup

  1. Head to the Spotify Developer Portal and create a new application. Note the Client ID of the app for usage later in the CLI or .env. This will provide you API access to Spotify, though in a limited capacity since it will start as a Sandbox application.
  2. Create a Spotify playlist. This tool will put all of the found tracks into this playlist. Note the Playlist ID for usage later in the CLI or .env.
  3. Place your XML file somewhere in this repo for parsing by the script.

Usage

Clone the repo locally, then use npm install to setup the repo.

After that, run npm run start and you're cooking.

The CLI will prompt you for all information it needs in order to continue properly. You can prefill that information using an optional .env file, see .env.example for what to fill out if that route interests you.

Once completed, all songs will be migrated into the Playlist and you'll be left with a generated notFoundTracks.json file containing the track data for all songs that were not migrated.

Search Pattern

This uses a naive two-tier search pattern.

First try searches for the song by constraining it to the exact album and artist found in the track data. If there are typos obviously this will have issues.

Second try searches for the song by constraining to just the artist name, meaning any album's version will suffice.

After that, we fail to migrate the song, as laxing the constraints further gets produces too many false positives (covers, wrong song, etc). Those songs have their track data written to notFoundTracks.json, allowing you to then manually go find those songs and add them to your playlist yourself.

itunes-library-xml-to-spotify-migrator's People

Contributors

johnnyshankman avatar

Stargazers

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