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.
-
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.
-
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.
-
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.
-
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.
npm i @dworkman-styc -g
styc --sc="keyValue" --scs="keyValue" --s="keyValue" --yp="keyValue" --gc="keyValue" --gs="keyValue" --gu="http://localhost:8080/oauth2callback" --gm="email@email.com" --gp="emailPassword"
When dealing with API secrets and passwords security should always be a concern. Thus I will quickly mention a few points.
-
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.
-
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.