CodeBrauer / YouTube2Spotify

Converts YouTube Playlists to Spotify URI lists - in your Terminal.
MIT License
1 stars 0 forks source link
converter spotify youtube-playlist

YouTube2Spotify

Converts YouTube Playlists to Spotify URI lists - in your Terminal.

Code Climate

Installation

This is currently in development stage!

  1. Download the master version
  2. Get a DeveloperKey from the Google Developers Console
  3. Paste the API-Key in config.php
  4. Activate the YouTube Data API v3 for this key/project
  5. Run composer install to load the required packages
  6. Should be done now.

Usage

$ php yt2spotify.php [YouTube playlist-URL | YouTube playlist-ID] [--copy] [--only-uri]

Note: --copy works only on Mac OS X with the pbcopy-binary

Example:

$ php yt2spotify.php PL6D4C31FFA7EBABB5

How does it work?

It's very simple - The scripts loads all video-titles (= name of the track) of the provided YouTube-playlist with the YouTube Data API v3 and searches this tracknames with Spotifys WebAPI - if the track was found the script will show you a green checkmark next to the title, if not - a red cross. All found Spotify-URIs (like spotify:track:3GfOAdcoc3X5GPiiXmpBjK will be written per line in spotify-uris.txt) – Now you can just copy the contents of this file and paste it (from your clipboard) in an playlist in your spotify-client.

The problems: