@dworkman/styc

1.0.2 • Public • Published

styc - Spotify to Youtube Converter

A CLI package that will convert a spotify playlist into a youtube one.

Everyone loves watching the video clips to their favourite songs. As a passionate music lover, I wanted an easy way to convert my Spotify playlists into Youtube playlists. As this is a CLI package, you will need to have an understanding of npm, terminal and how passing arguments works to utilise this program.

While Spotify's API is cool and lets you collect all of the playlist information you want via multiple API calls to the offSet endpoints, Google have stricter limits on their API. Because of these limits, we are not able to convert large Spotify playlists as I'd originally hoped.

If you have a way of increasing Google API limits, feel free to fork this repo and remove the limitation I've placed on the data mentioned in caveat 2.

Caveats

  1. If your Gmail PW contains special terminal characters that need escaping, the puppeteer automatic login will fail and you'll need to manually enter your password at that stage.

  2. Youtube has a 10,000 point quota in place for Youtube API. A single search = 100. Therefore only 100 searches per day allowed. You can read more about the limits here > https://developers.google.com/youtube/v3/getting-started#quota Because of this, I've set the maximum playlist size to 40. Although the application itself is built to handle spotify playlists of any size.

  3. You need to make sure you have your new Youtube Playlist created and something added to the playlist. Without something added to the playlist the API will not be able to detect the playlistId and therefore will not work.

  4. Ensure you set your Google URI to http://localhost:8080/oauth2callback as the cli will run a server on that port and expect the callback to hit that endpoint.

Installing

npm i @dworkman-styc -g

Usage

styc --sc="keyValue" --scs="keyValue" --s="keyValue" --yp="keyValue" --gc="keyValue" --gs="keyValue" --gu="http://localhost:8080/oauth2callback" --gm="email@email.com" --gp="emailPassword"

Security

When dealing with API secrets and passwords security should always be a concern. Thus I will quickly mention a few points.

  1. This is a server side application that runs in a terminal session and therefore has incredibly low risk of your input's being subject to scraping.

  2. The entire code base is posted on my github. You are able to see that I am NOT storing any cli inputs, I'm just using global variables to temporarily store the values while the program executes and then once the program terminates those values would no longer exist in memory.

Package Sidebar

Install

npm i @dworkman/styc

Weekly Downloads

0

Version

1.0.2

License

MIT

Unpacked Size

19 kB

Total Files

10

Last publish

Collaborators

  • dworkman