Skip to content

A script where you can transfer playlists from YouTube to Spotify.

Notifications You must be signed in to change notification settings

kevinthai21/YT-Spotify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 

Repository files navigation

YouTube-To-Spotify Playlist Transfer

Information

The script takes a music playlist from YouTube and creates a new playlist on Spotify.

The program will ask the user for information on the playlist the user wants to copy from (name and link). Then, it will ask for the Spotify login information (note it will not save the login information).

After the program saved the user information, the program will scrape the names of the songs and artists from the YouTube playlist. It will create a new playlist and will transfer all of the songs. If there are some songs that are not listed, there is a log in the console of songs that are added and those that aren't.

I wrote this program in JavaScript. It uses NodeJS, Puppeteer, and readline-sync. Puppeteer is a Node library that controls a headless Chrome or Chromium. Readline-sync is a library that takes input from the user and saves the information for the program to use.

How to Run:

Information needed before running:

  • Link to your public YouTube playlist
  • Your Spotify login information

The user needs to install these dependencies (pupeteer, readline-sync):

npm install pupeteer
npm install readline-sync

Simply run: node transfer_playlist.js

Note

  • Keep in mind that the music playlist from YouTube needs to be public or unlisted.
  • The program takes in songs (from YouTube) that are in two different formats:
    • Video Title: "Treasure", Channel: "Bruno Mars" or
    • Video Title: "Treasure", Channel: "Bruno Mars - Topic"
      • (It can take music videos or lyric videos but the program is less likely to find it on Spotify)
  • The program will not save the Spotify login information.

Inspiration

When transferring playlists from one music platform to another platform, I found it difficult and extremely time-consuming to copy a playlist from one platform. Since it took a long time and it takes the same number of steps for each song, it was best to try to automate the process.

I initially wanted to create a Google Chrome extension to perform these actions; however, Google Chrome extensions were not the best choice to transfer playlists.

About

A script where you can transfer playlists from YouTube to Spotify.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published