Skip to content

Douile/node-spotify-youtube-downloader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-spotify-youtube-downloader

Download playlists or albums from spotify via youtube, then automatically add id3 tags using data from spotify web API.

About

CLI not yet ready

A spotify web API token is needed, you can generate one in the Web API Console

Apache 2.0 license

Usage

Install

npm install --save node-spotify-youtube-downloader

Import

const { download, tag } = require('node-spotify-youtube-downloader');
download(...);
tag(...)
// OR
const downloader = require('node-spotify-youtube-downloader');
downloader.download(...);
downloader.tag(...);

Download

/* Download and tag songs */
download({
  /* URI of item to download
  * Can be retrieved in spotify using right click -> share -> Copy Spotify URI
  * ATM only playlist and album are supported */
  spotifyURI: 'spotify:album:50Zz8CkIhATKUlQMbHO3k1',
  /* Path to download files
  Make sure this folder exists otherwise program will error */
  downloadPath: '../download/',
  /* Spotify web API Token */
  spotifyToken: 'YOUR_TOKEN_HERE',
  /* Range of items to download (1-n) as an array
  Setting to undefined or omitting will cause all tracks to be used */
  range: [2,4]
}).then(() => {console.log('Download complete')}).catch(console.error);

Tag

/* Search for songs as they would be named by program and add the id3 tags from spotify
Options have same syntax as download */
tag({
  spotifyURI: 'spotify:album:50Zz8CkIhATKUlQMbHO3k1',
  downloadPath: '../download/',
  spotifyToken: 'YOUR_TOKEN_HERE',
  range: [2,4]
}).then(() => {console.log('Tagging complete')}).catch(console.error);

TODO

  • Add CLI
  • Improve logging (download progress etc)
  • Improve API